Commit 97d2e6b8 authored by 旭艳's avatar 旭艳

生产准备检查页面开发

parent a30a1365
<!--
* @Author:fangk
* @Date: 2021-03-23
* @Description: 生产准备检查-生产准备检查
* @setAuthor:fangk 2021-03-22
-->
<template>
<div class="production-preparation-inspection-confirmation">
<el-table
:ref="onlyUuid"
:data="confirmaData"
row-key="id"
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column type="index" align="center" label="序号" :width="65" />
<el-table-column
prop="materNo"
label="装配单元/AO号"
sortable
:min-width="150"
/>
<el-table-column
v-if="conStatus === 'Y'"
prop="planStateCode"
align="center"
label="状态"
sortable
:width="90"
:formatter="planStateCodeFormatter"
/>
<el-table-column
prop="fitRates"
align="center"
label="齐套率"
sortable
:width="90"
:formatter="fitRatesFormatter"
/>
<el-table-column
prop="workHour"
align="center"
label="工期(h)"
:width="70"
/>
<el-table-column
prop="scheduledStart"
align="center"
label="计划开工时间"
sortable
:min-width="170"
/>
<el-table-column
prop="scheduledEnd"
align="center"
label="计划完工时间"
sortable
:min-width="170"
/>
<el-table-column
prop="index"
align="center"
label="前置节点"
:width="100"
:formatter="preposeFormatter"
/>
</el-table>
</div>
</template>
<script>
import { v4 as uuidv4 } from 'uuid'
// import { exportExcel } from '@/api/exportExcel-elementUI.js'
export default {
props: {
confirmaData: {
type: Array,
default: () => []
},
conStatus: {
type: String,
default: 'N'
}
},
data() {
return {
onlyUuid: ''
}
},
mounted() { this.onlyUuid = uuidv4() },
created() {},
methods: {
/**
*格式化齐套率
*/
fitRatesFormatter(row, column, cellValue, index) {
return cellValue === 1 ? '符合' : '不符合'
},
/**
*格式化前置
*/
preposeFormatter(row, column, cellValue, index) {
const that = this
var linkTitle = []
if (row.executorVoList && row.executorVoList.length) {
row.executorVoList.forEach((p) => {
if (row.parenId) {
const data = that.confirmaData.filter(
(t) => t.id === row.parenId
)[0].children
const item = data.filter((t) => t.id === p.prevNodeId)
if (item && item.length) {
linkTitle.push(item[0].index)
}
} else {
const item = that.confirmaData.filter((t) => t.id === p.prevNodeId)
if (item && item.length) {
linkTitle.push(item[0].index)
}
}
})
}
return linkTitle.join(',')
},
/**
* 状态
*/
planStateCodeFormatter(row, column, cellValue, index) {
if (!cellValue) return
var dictValue = this.$parent.joExecutePlanStateData.filter(
(p) => p.dictKey === cellValue
)
if (dictValue && dictValue.length) {
return dictValue[0].dictValue
}
return ''
}
/**
* 导出数据
*/
// exportTable() {
// exportExcel(this.$refs[this.onlyUuid].$el, '总装制造执行系统')
// },
// exportTable2() {
// exportExcel(this.$parent.$refs[this.$parent.onlyUuid].$el, '准备情况')
// }
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment