Commit 9a37e807 authored by jingnan's avatar jingnan 👀

Merge branch 'dev' of http://94.191.100.41/tfmom/tf-mom-web into dev

parents ecaf8cb9 eccf2fcf
<!--
* @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>
......@@ -38,6 +38,8 @@
import { post, del, get } from '@/utils/http'
import StorageDetails from './component/storageDetailsCreateCom'
import ImportFile from './component/importFile'
import { downloadFile } from '@/utils/http'
export default {
componentName: '采购入库申请创建编辑',
name: 'PurchasingWarehousingNewOrEdit', // name写在组件的最前方,自定义组件为必填
......@@ -225,25 +227,39 @@ export default {
})
}
}
},
{
name: '模版下载',
icon: '/icons/c-down.png',
handler: {
click: () => {
this.$refs.form.validate((isok) => {
if (isok) {
let fileName = ''
// 使用一个映射来将不同的billType映射到对应的文件名
const billTypeToFileNameMap = {
'Material': '器材导入模板.xlsx',
'AirEquipment': '机载设备导入模板.xlsx',
'OutSource': '外包产品导入模板.xlsx'
}
if (billTypeToFileNameMap[this.form.billType]) {
fileName = billTypeToFileNameMap[this.form.billType]
}
// {
// name: '模版下载',
// icon: '/icons/c-down.png',
// handler: {
// click: () => {
// this.$utils.downLoadFileUrl('/download/template/器材导入模板.xlsx', '器材导入模板.xlsx')
// this.$refs.form.validate((isok) => {
// if (isok) {
// // 校验通过
// // this.$utils.downLoadFileUrl('/download/template/器材导入模板.xlsx', '器材导入模板.xlsx')
// } else {
// this.$utils.showMessageWarning('请填写基本信息!')
// }
// })
// }
// }
// }
// 然后下载文件
if (fileName) {
downloadFile(`/download/template/${fileName}`, 'get').then(res => {
this.$utils.downLoadFile(res, fileName)
})
}
} else {
this.$utils.showMessageWarning('请填写基本信息!')
}
})
}
}
}
],
topTools: [
{
......
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