feat: update MES tracking and reporting workflows
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
<el-table-column align="center" label="物料编码" prop="缺件物料编码" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="物料名称" prop="缺件物料名称" width="150" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="缺件数量" prop="缺件数量" width="90" />
|
||||
<el-table-column align="center" label="库存数量" prop="库存数量" width="90" />
|
||||
<el-table-column align="center" label="属性" prop="缺件属性" width="90" />
|
||||
<el-table-column align="center" label="生产订单号" prop="缺件生产订单号" width="100" />
|
||||
<el-table-column align="center" label="进度" prop="进度" width="130" show-overflow-tooltip />
|
||||
@@ -93,7 +94,6 @@
|
||||
<el-table-column align="center" label="预计完成时间" width="130">
|
||||
<template slot-scope="detail">{{ formatDate(detail.row.预计完成时间) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="采购员" prop="采购员" width="90" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="采购未清数量" prop="采购未清数量" width="110" />
|
||||
<el-table-column align="center" label="到货草稿" prop="到货草稿" width="90" />
|
||||
<el-table-column align="center" label="质检状态" width="90">
|
||||
@@ -269,13 +269,13 @@ export default {
|
||||
缺件物料编码: row.缺件物料编码,
|
||||
缺件物料名称: row.缺件物料名称,
|
||||
缺件数量: this.formatQuantity(row.缺件数量),
|
||||
库存数量: this.formatQuantity(row.库存数量),
|
||||
缺件属性: row.缺件属性,
|
||||
缺件生产订单号: row.缺件生产订单号,
|
||||
进度: row.进度,
|
||||
工艺路线: row.工艺路线,
|
||||
工艺路线明细: this.parseRouteDetails(row.工艺路线明细),
|
||||
预计完成时间: row.预计完成时间,
|
||||
采购员: row.采购员,
|
||||
采购未清数量: this.formatQuantity(row.采购未清数量),
|
||||
到货草稿: row.到货草稿,
|
||||
质检状态: row.质检状态,
|
||||
@@ -315,39 +315,88 @@ export default {
|
||||
辅助结束: 3,
|
||||
开始加工: 4,
|
||||
暂停: 5,
|
||||
报工: 6
|
||||
报工: 6,
|
||||
装配加工: 4
|
||||
}
|
||||
return statusMap[value] || 0
|
||||
},
|
||||
isProcessComplete(process) {
|
||||
const progress = this.toProcessNumber(process.进度)
|
||||
const planCount = this.toProcessNumber(process.计划数量)
|
||||
const finishCount = this.toProcessNumber(process.完成数量)
|
||||
const checkedCount = this.toProcessNumber(process.收检合格数) + this.toProcessNumber(process.收检不合格数)
|
||||
return progress >= 100 ||
|
||||
(planCount > 0 && finishCount >= planCount) ||
|
||||
(planCount > 0 && checkedCount >= planCount)
|
||||
isOutsourceProcess(process) {
|
||||
return process.指派对象 === '外协' ||
|
||||
String(process.工序名称 || '').includes('(外协)') ||
|
||||
String(process.工序名称 || '').includes('(外协)')
|
||||
},
|
||||
getProcessClass(process, index, processes) {
|
||||
if (this.isProcessComplete(process)) {
|
||||
return 'process-route-blue'
|
||||
}
|
||||
isBlueProcess(process) {
|
||||
const statusNum = this.getProcessStatusNum(process.加工状态)
|
||||
if (this.isValidProcessDate(process.开工时间) || [2, 4].includes(statusNum) || this.toProcessNumber(process.进度) > 0) {
|
||||
const countNum = parseInt(process.收检合格数)
|
||||
return statusNum === 6 || statusNum === 3 || countNum > 0
|
||||
},
|
||||
isGreenProcess(process) {
|
||||
return this.isOutsourceProcess(process) &&
|
||||
this.toProcessNumber(process.收料数量) > this.toProcessNumber(process.收检合格数) + this.toProcessNumber(process.收检不合格数)
|
||||
},
|
||||
getProcessBaseClass(process) {
|
||||
if (this.isGreenProcess(process)) {
|
||||
return 'process-route-green'
|
||||
}
|
||||
if (index > 0 && this.isProcessComplete(processes[index - 1])) {
|
||||
return 'process-route-orange'
|
||||
|
||||
if (this.isBlueProcess(process)) {
|
||||
return 'process-route-blue'
|
||||
}
|
||||
|
||||
const statusNum = this.getProcessStatusNum(process.加工状态)
|
||||
if (statusNum === 2 || statusNum === 4) {
|
||||
return 'process-route-green'
|
||||
}
|
||||
|
||||
return 'process-route-red'
|
||||
},
|
||||
getRouteProcessName(process) {
|
||||
const name = String(process.工序名称 || '')
|
||||
const assignee = String(process.指派对象 || '')
|
||||
if (!assignee || name.includes(`(${assignee})`) || name.includes(`(${assignee})`)) {
|
||||
return name
|
||||
getOutsourceGroupClassState(processes) {
|
||||
const classes = new Map()
|
||||
let currentIndexes = []
|
||||
let lastProcess = null
|
||||
|
||||
const flushOutsourceRun = () => {
|
||||
if (currentIndexes.length > 0 && lastProcess) {
|
||||
const className = this.getProcessBaseClass(lastProcess)
|
||||
currentIndexes.forEach(index => classes.set(index, className))
|
||||
}
|
||||
currentIndexes = []
|
||||
lastProcess = null
|
||||
}
|
||||
return `${name}(${assignee})`
|
||||
|
||||
const isSameContinuousGroup = process => {
|
||||
if (!lastProcess) {
|
||||
return true
|
||||
}
|
||||
const lineNo = this.toProcessNumber(process.订单行号)
|
||||
const lastLineNo = this.toProcessNumber(lastProcess.订单行号)
|
||||
return lineNo === lastLineNo + 1 &&
|
||||
String(process.外协分组 || '') === String(lastProcess.外协分组 || '')
|
||||
}
|
||||
|
||||
processes.forEach((process, index) => {
|
||||
if (!this.isOutsourceProcess(process)) {
|
||||
flushOutsourceRun()
|
||||
return
|
||||
}
|
||||
if (!isSameContinuousGroup(process)) {
|
||||
flushOutsourceRun()
|
||||
}
|
||||
currentIndexes.push(index)
|
||||
lastProcess = process
|
||||
})
|
||||
flushOutsourceRun()
|
||||
|
||||
return classes
|
||||
},
|
||||
getProcessClass(process, index, outsourceGroupClasses) {
|
||||
if (this.isOutsourceProcess(process)) {
|
||||
return outsourceGroupClasses.get(index) || this.getProcessBaseClass(process)
|
||||
}
|
||||
return this.getProcessBaseClass(process)
|
||||
},
|
||||
getRouteProcessName(process) {
|
||||
return String(process.工序名称 || '')
|
||||
},
|
||||
escapeProcessHtml(value) {
|
||||
return String(value == null ? '' : value)
|
||||
@@ -365,6 +414,7 @@ export default {
|
||||
|
||||
const maxPerRow = 8
|
||||
const rows = Math.ceil(processes.length / maxPerRow)
|
||||
const outsourceGroupClasses = this.getOutsourceGroupClassState(processes)
|
||||
let html = '<div class="process-route-wrap"><table class="process-route-table"><tbody>'
|
||||
|
||||
for (let rowIndex = 0; rowIndex < rows; rowIndex++) {
|
||||
@@ -376,20 +426,20 @@ export default {
|
||||
|
||||
html += '<tr>'
|
||||
rowProcesses.forEach((process, index) => {
|
||||
const className = this.getProcessClass(process, startIndex + index, processes)
|
||||
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
|
||||
const date = this.formatDate(process.计划开始时间 || process.计划完成时间)
|
||||
html += `<td class="process-route-date ${className}">${this.escapeProcessHtml(date)}</td>`
|
||||
if (index < rowProcesses.length - 1) html += '<td class="process-route-arrow-hidden"></td>'
|
||||
})
|
||||
html += '</tr><tr>'
|
||||
rowProcesses.forEach((process, index) => {
|
||||
const className = this.getProcessClass(process, startIndex + index, processes)
|
||||
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
|
||||
html += `<td class="${className}">${this.escapeProcessHtml(this.getRouteProcessName(process))}</td>`
|
||||
if (index < rowProcesses.length - 1) html += '<td class="process-route-arrow">→</td>'
|
||||
})
|
||||
html += '</tr><tr>'
|
||||
rowProcesses.forEach((process, index) => {
|
||||
const className = this.getProcessClass(process, startIndex + index, processes)
|
||||
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
|
||||
const count = this.formatQuantity(process.收检合格数)
|
||||
html += `<td class="process-route-count ${className}">合格${this.escapeProcessHtml(count)}</td>`
|
||||
if (index < rowProcesses.length - 1) html += '<td class="process-route-arrow-hidden"></td>'
|
||||
@@ -473,39 +523,53 @@ export default {
|
||||
|
||||
.process-route {
|
||||
overflow-x: auto;
|
||||
padding: 2px 0;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
::v-deep .process-route-wrap {
|
||||
min-width: 480px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
::v-deep .process-route-table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
margin: 0 auto;
|
||||
border-collapse: collapse;
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
table-layout: auto;
|
||||
}
|
||||
|
||||
::v-deep .process-route-table td {
|
||||
border-radius: 2px;
|
||||
line-height: 20px;
|
||||
min-width: 72px;
|
||||
padding: 2px 5px;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
min-width: 35px;
|
||||
padding: 2px 2px;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
::v-deep .process-route-date,
|
||||
::v-deep .process-route-date {
|
||||
color: #8899aa !important;
|
||||
font-size: 10px !important;
|
||||
padding: 2px 2px !important;
|
||||
}
|
||||
|
||||
::v-deep .process-route-count {
|
||||
font-size: 12px;
|
||||
font-size: 12px !important;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
::v-deep .process-route-arrow,
|
||||
::v-deep .process-route-arrow-hidden {
|
||||
background: transparent;
|
||||
color: #606266;
|
||||
min-width: 18px;
|
||||
width: 18px;
|
||||
min-width: 8px;
|
||||
padding: 2px 0 !important;
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
::v-deep .process-route-arrow {
|
||||
color: rgba(0, 164, 255, 0.6) !important;
|
||||
font-size: 10px !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
::v-deep .process-route-arrow-hidden {
|
||||
@@ -513,29 +577,24 @@ export default {
|
||||
}
|
||||
|
||||
::v-deep .process-route-spacer td {
|
||||
height: 6px;
|
||||
line-height: 6px;
|
||||
padding: 0;
|
||||
height: 4px;
|
||||
line-height: 1 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
::v-deep .process-route-green {
|
||||
background: #f0f9eb;
|
||||
color: #67c23a;
|
||||
color: #28d961;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
::v-deep .process-route-blue {
|
||||
background: #ecf5ff;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
::v-deep .process-route-orange {
|
||||
background: #fdf6ec;
|
||||
color: #e6a23c;
|
||||
color: #09a8ff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
::v-deep .process-route-red {
|
||||
background: #fef0f0;
|
||||
color: #f56c6c;
|
||||
color: #ff3f37;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
::v-deep .detail-row td {
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<div class="app-container product-pass-rate-page">
|
||||
<el-card>
|
||||
<div class="search-container" @keyup.enter="searchTable">
|
||||
<span class="show-text">关闭日期:</span>
|
||||
<el-date-picker
|
||||
v-model="searchForm.closeDateStart"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="开始日期"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 140px; margin-right: 6px"
|
||||
/>
|
||||
<span class="date-separator">至</span>
|
||||
<el-date-picker
|
||||
v-model="searchForm.closeDateEnd"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="结束日期"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 140px; margin-right: 10px"
|
||||
/>
|
||||
<span class="show-text">生产订单:</span>
|
||||
<el-input
|
||||
v-model="searchForm.orderNo"
|
||||
clearable
|
||||
placeholder="生产订单"
|
||||
size="small"
|
||||
style="width: 120px; margin-right: 10px"
|
||||
/>
|
||||
<span class="show-text">物料编码:</span>
|
||||
<el-input
|
||||
v-model="searchForm.itemCode"
|
||||
clearable
|
||||
placeholder="物料编码"
|
||||
size="small"
|
||||
style="width: 170px; margin-right: 10px"
|
||||
/>
|
||||
<span class="show-text">物料名称:</span>
|
||||
<el-input
|
||||
v-model="searchForm.itemName"
|
||||
clearable
|
||||
placeholder="物料名称"
|
||||
size="small"
|
||||
style="width: 150px; margin-right: 10px"
|
||||
/>
|
||||
<span class="show-text">工序:</span>
|
||||
<el-input
|
||||
v-model="searchForm.process"
|
||||
clearable
|
||||
placeholder="工序"
|
||||
size="small"
|
||||
style="width: 110px; margin-right: 10px"
|
||||
/>
|
||||
<span class="show-text">工位:</span>
|
||||
<el-input
|
||||
v-model="searchForm.station"
|
||||
clearable
|
||||
placeholder="工位"
|
||||
size="small"
|
||||
style="width: 110px; margin-right: 10px"
|
||||
/>
|
||||
<span class="show-text">合格状态:</span>
|
||||
<el-select
|
||||
v-model="searchForm.passStatus"
|
||||
clearable
|
||||
placeholder="合格状态"
|
||||
size="small"
|
||||
style="width: 110px; margin-right: 10px"
|
||||
>
|
||||
<el-option label="不合格" value="不合格" />
|
||||
<el-option label="合格" value="合格" />
|
||||
<el-option label="全部" value="全部" />
|
||||
</el-select>
|
||||
<el-button
|
||||
:disabled="loading"
|
||||
icon="el-icon-search"
|
||||
plain
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="searchTable"
|
||||
>查询</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
height="76vh"
|
||||
highlight-current-row
|
||||
size="mini"
|
||||
style="width: 100%; margin-top: 12px"
|
||||
tooltip-effect="dark"
|
||||
>
|
||||
<el-table-column type="expand" width="44">
|
||||
<template slot-scope="scope">
|
||||
<div class="detail-wrapper">
|
||||
<el-table
|
||||
:data="scope.row.children"
|
||||
border
|
||||
class="detail-table"
|
||||
empty-text="无二级数据"
|
||||
size="mini"
|
||||
>
|
||||
<el-table-column align="center" label="工序" prop="工序" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="工序号" prop="工序号" width="80" />
|
||||
<el-table-column align="center" label="工位(指派对象)" prop="工位" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column align="right" label="完工数量" prop="完成数量" width="100" />
|
||||
<el-table-column align="right" label="不良数量" prop="不良数量" width="100" />
|
||||
<el-table-column align="center" label="合格率" width="100">
|
||||
<template slot-scope="childScope">
|
||||
<span :class="getRateClass(childScope.row.合格率)">
|
||||
{{ formatRate(childScope.row.合格率) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="检验说明" prop="检测说明" min-width="220" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed label="序号" type="index" width="50" />
|
||||
<el-table-column align="center" label="关闭日期" width="120">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.关闭日期) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="生产订单号" prop="生产订单号" width="100" />
|
||||
<el-table-column align="left" label="物料名称" prop="物料名称" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="物料编码" prop="物料编码" min-width="190" show-overflow-tooltip />
|
||||
<el-table-column align="right" label="计划数量" prop="计划数量" width="100" />
|
||||
<el-table-column align="right" label="完成数量" prop="完成数量" width="100" />
|
||||
<el-table-column align="right" label="不良数量" prop="不良数量" width="100" />
|
||||
<el-table-column align="center" label="合格率" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span :class="getRateClass(scope.row.合格率)">
|
||||
{{ formatRate(scope.row.合格率) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ProductPassRateWorkstation',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
searchForm: {
|
||||
closeDateStart: this.getDefaultDateStart(),
|
||||
closeDateEnd: this.getDefaultDateEnd(),
|
||||
orderNo: '',
|
||||
itemCode: '',
|
||||
itemName: '',
|
||||
process: '',
|
||||
station: '',
|
||||
passStatus: '不合格'
|
||||
},
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async searchTable() {
|
||||
this.loading = true
|
||||
this.tableData = []
|
||||
|
||||
const param = []
|
||||
param.push(['生产订单号', this.searchForm.orderNo || ''])
|
||||
param.push(['物料编码', this.searchForm.itemCode || ''])
|
||||
param.push(['物料名称', this.searchForm.itemName || ''])
|
||||
param.push(['关闭日期_Start', this.searchForm.closeDateStart || ''])
|
||||
param.push(['关闭日期_End', this.searchForm.closeDateEnd || ''])
|
||||
param.push(['工序', this.searchForm.process || ''])
|
||||
param.push(['工位', this.searchForm.station || ''])
|
||||
param.push(['合格状态', this.searchForm.passStatus || ''])
|
||||
|
||||
const data = this.CreateData('11', '生产管理_产品合格率工位_查询', param)
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
const list = response.data || []
|
||||
this.tableData = list.map(row => ({
|
||||
...row,
|
||||
children: this.parseDetails(row.明细JSON)
|
||||
}))
|
||||
} catch (error) {
|
||||
console.error('产品合格率查询失败:', error)
|
||||
this.$message.error('查询失败')
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
parseDetails(value) {
|
||||
if (!value) return []
|
||||
try {
|
||||
const details = JSON.parse(value)
|
||||
return Array.isArray(details) ? details : []
|
||||
} catch (error) {
|
||||
console.error('产品合格率明细解析失败:', error)
|
||||
return []
|
||||
}
|
||||
},
|
||||
getDefaultDateStart() {
|
||||
const start = new Date()
|
||||
start.setDate(start.getDate() - 30)
|
||||
return this.formatPickerDate(start)
|
||||
},
|
||||
getDefaultDateEnd() {
|
||||
return this.formatPickerDate(new Date())
|
||||
},
|
||||
formatPickerDate(date) {
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
formatDate(value) {
|
||||
if (!value) return ''
|
||||
return String(value).split('T')[0].split(' ')[0]
|
||||
},
|
||||
formatRate(value) {
|
||||
if (value === null || value === undefined || value === '') return ''
|
||||
const numberValue = Number(value)
|
||||
if (Number.isNaN(numberValue)) return ''
|
||||
return `${numberValue.toFixed(2)}%`
|
||||
},
|
||||
getRateClass(value) {
|
||||
const numberValue = Number(value)
|
||||
if (Number.isNaN(numberValue)) return ''
|
||||
if (numberValue >= 100) return 'rate-good'
|
||||
if (numberValue >= 90) return 'rate-warning'
|
||||
return 'rate-danger'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.product-pass-rate-page {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.show-text {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.date-separator {
|
||||
margin-right: 6px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.detail-wrapper {
|
||||
padding: 8px 28px 10px 58px;
|
||||
background: #f7fbff;
|
||||
}
|
||||
|
||||
.detail-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.rate-good {
|
||||
color: #67c23a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.rate-warning {
|
||||
color: #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.rate-danger {
|
||||
color: #f56c6c;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
@@ -221,18 +221,7 @@
|
||||
width="80"
|
||||
prop="工位名称"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="供应商"
|
||||
width="80"
|
||||
prop="供应商"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="采购收货单"
|
||||
width="100"
|
||||
prop="采购收货单"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="加急数量"
|
||||
@@ -285,6 +274,18 @@
|
||||
width="180"
|
||||
prop="检测说明"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="供应商"
|
||||
width="80"
|
||||
prop="供应商"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="采购收货单"
|
||||
width="100"
|
||||
prop="采购收货单"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" width="350" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@@ -396,7 +397,7 @@
|
||||
style="width: 200px"
|
||||
@change="handleQualifiedChange"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label"> 检验人</span>
|
||||
@@ -445,7 +446,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="info-container">
|
||||
<div class="info-container">
|
||||
<div class="info-item">
|
||||
<span class="info-label"> 检测说明</span>
|
||||
|
||||
@@ -576,7 +577,7 @@ export default {
|
||||
Urgentarr: {},
|
||||
seeVisible:false,
|
||||
downPDF:MESDownFile,
|
||||
submitLoading: false,
|
||||
submitLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -604,7 +605,7 @@ export default {
|
||||
this.$message.error('未上传图纸');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
getitemdraw2(row) {
|
||||
var param = [];
|
||||
@@ -620,7 +621,7 @@ export default {
|
||||
this.$message.error('未上传图纸');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
Urgent(row){
|
||||
var param = []
|
||||
@@ -702,7 +703,7 @@ export default {
|
||||
param.push(["检测类别", this.type]);
|
||||
param.push(["检测状态", this.checkstatus]);
|
||||
param.push(["属性", this.attribute]);
|
||||
|
||||
|
||||
// 调用封装方法生成请求数据 - 使用新的存储过程名称
|
||||
var Data = this.CreateData(
|
||||
"11",
|
||||
@@ -799,14 +800,14 @@ export default {
|
||||
this.$message.warning("数量输入错误");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 调用存储过程保存数据
|
||||
this.saveReceiveCheck();
|
||||
},
|
||||
async saveReceiveCheck() {
|
||||
// 设置提交状态为true,防止重复提交
|
||||
this.submitLoading = true;
|
||||
|
||||
|
||||
var param = [];
|
||||
param.push(["TaskAID", this.receiveCheckData.TaskAID || ""]);
|
||||
param.push(["检测类型编号", 6]);
|
||||
@@ -825,14 +826,14 @@ export default {
|
||||
param.push(["放行数量", this.receiveCheckData.放行数量]);
|
||||
param.push(["工位名称", this.receiveCheckData.工位名称]);
|
||||
console.log(param);
|
||||
|
||||
|
||||
try {
|
||||
if(this.receiveCheckData.工位名称 == '外协' && this.receiveCheckData.合格数 > 0){
|
||||
var result = await postB1("/QueryService_PostQuery",{
|
||||
"QueryPath": "$crossjoin(PurchaseOrders,PurchaseOrders/DocumentLines)",
|
||||
var result = await postB1("/QueryService_PostQuery",{
|
||||
"QueryPath": "$crossjoin(PurchaseOrders,PurchaseOrders/DocumentLines)",
|
||||
"QueryOption": "$expand=PurchaseOrders($select=DocEntry, DocNum,CardCode,CardName),PurchaseOrders/DocumentLines($select=ItemCode,LineNum,Price,U_WWOworID,U_WWOrstHS,LineStatus)&$filter=PurchaseOrders/DocEntry eq PurchaseOrders/DocumentLines/DocEntry and PurchaseOrders/DocumentLines/U_WWOworID eq "+this.receiveCheckData.计划号+""
|
||||
})
|
||||
|
||||
|
||||
if (result.success) {
|
||||
if(result.data.value.length>0){
|
||||
let processed = false;
|
||||
@@ -842,13 +843,13 @@ export default {
|
||||
console.log(element['PurchaseOrders/DocumentLines'].U_WWOrstHS)
|
||||
console.log(element['PurchaseOrders/DocumentLines'].LineStatus)
|
||||
console.log(this.receiveCheckData.工序名称 == element['PurchaseOrders/DocumentLines'].U_WWOrstHS & element['PurchaseOrders/DocumentLines'].LineStatus == 'O')
|
||||
|
||||
|
||||
if( this.receiveCheckData.工序名称 == element['PurchaseOrders/DocumentLines'].U_WWOrstHS && element['PurchaseOrders/DocumentLines'].LineStatus == 'O' ){
|
||||
var CardCode = element.PurchaseOrders.CardCode
|
||||
var CardName = element.PurchaseOrders.Cardname
|
||||
var DocEntry = element.PurchaseOrders.DocEntry
|
||||
var LineNum = element['PurchaseOrders/DocumentLines'].LineNum
|
||||
|
||||
|
||||
// 创建采购收货单
|
||||
const deliveryResult = await postB1(
|
||||
"/PurchaseDeliveryNotes",
|
||||
@@ -879,7 +880,7 @@ export default {
|
||||
}
|
||||
if (!processed) {
|
||||
const errorElement = failedElement || (result.data.value.length > 0 ? result.data.value[0] : null);
|
||||
|
||||
|
||||
if (errorElement) {
|
||||
const docEntry = errorElement['PurchaseOrders'].DocEntry;
|
||||
const processName = errorElement['PurchaseOrders/DocumentLines'].U_WWOrstHS;
|
||||
@@ -904,11 +905,11 @@ export default {
|
||||
throw new Error('外协订单查询失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 执行收检操作
|
||||
var Data = this.CreateData("12", "质量管理_序检收检_新增", param);
|
||||
const response = await this.ExecDatabase(Data);
|
||||
|
||||
|
||||
if (
|
||||
response.data &&
|
||||
response.data[0] &&
|
||||
@@ -950,8 +951,8 @@ export default {
|
||||
// param.push(["放行数量", this.receiveCheckData.放行数量]);
|
||||
// console.log(param);
|
||||
// if(this.receiveCheckData.工位名称 == '外协'){
|
||||
// var result = await postB1("/QueryService_PostQuery",{
|
||||
// "QueryPath": "$crossjoin(PurchaseOrders,PurchaseOrders/DocumentLines)",
|
||||
// var result = await postB1("/QueryService_PostQuery",{
|
||||
// "QueryPath": "$crossjoin(PurchaseOrders,PurchaseOrders/DocumentLines)",
|
||||
// "QueryOption": "$expand=PurchaseOrders($select=DocEntry, DocNum,CardCode,CardName),PurchaseOrders/DocumentLines($select=ItemCode,LineNum,Price,U_WWOworID,U_WWOrstHS,LineStatus)&$filter=PurchaseOrders/DocEntry eq PurchaseOrders/DocumentLines/DocEntry and PurchaseOrders/DocumentLines/U_WWOworID eq "+this.receiveCheckData.计划号+""
|
||||
// })
|
||||
// }else{
|
||||
@@ -1027,14 +1028,14 @@ export default {
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
// } else {
|
||||
// this.$message.error('质检失败:外协采购订单未创建');
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// },
|
||||
|
||||
formatDateTime(date) {
|
||||
@@ -1207,4 +1208,4 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user