Commit 4ca2dc3b authored by jingnan's avatar jingnan 👀

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

parents a171d2fb 6b1a4d85
/**
* element 导出excel
* @Author:fangk
*/
import FileSaver from 'file-saver'
import XLSX from 'xlsx'
/**
*
* @param {Dom元素} element
* @param {导出名称} name
* @returns
* 已知bug1:单元格如有英文逗号则不显示
* 已知bug2:树表格的情况收缩数据不下载
*/
export function exportExcel(element, name) {
/* out-table关联导出的dom节点 */
var wb = XLSX.utils.table_to_book(element)
/* get binary string as output */
var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
try {
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), name + '.xlsx')
} catch (e) { if (typeof console !== 'undefined') console.error(e, wbout) }
return wbout
}
<!--
* @Author:fangk
* @Date: 2021-03-23
* @Description: 生产准备检查-生产准备检查
* @setAuthor:fangk 2021-03-22
-->
<template>
<div class="production-preparation-inspection-confirmation">
<el-table
......@@ -70,7 +63,7 @@
</template>
<script>
import { v4 as uuidv4 } from 'uuid'
// import { exportExcel } from '@/api/exportExcel-elementUI.js'
import { exportExcel } from '@/api/exportExcel-elementUI.js'
export default {
props: {
confirmaData: {
......@@ -134,16 +127,16 @@ export default {
return dictValue[0].dictValue
}
return ''
}
},
/**
* 导出数据
*/
// exportTable() {
// exportExcel(this.$refs[this.onlyUuid].$el, '总装制造执行系统')
// },
// exportTable2() {
// exportExcel(this.$parent.$refs[this.$parent.onlyUuid].$el, '准备情况')
// }
exportTable() {
exportExcel(this.$refs[this.onlyUuid].$el, '总装制造执行系统')
},
exportTable2() {
exportExcel(this.$parent.$refs[this.$parent.onlyUuid].$el, '准备情况')
}
}
}
</script>
......@@ -64,14 +64,6 @@
end-placeholder="结束日期"
/>
</div>
<!-- <div>
<span>表格显示计划状态:</span>
<el-select v-model="tableShow" placeholder="请选择" size="small">
<el-option value="1" label="合并显示" />
<el-option value="2" label="显示准备情况确认表" />
<el-option value="3" label="显示生产准备确认项表" />
</el-select>
</div> -->
</div>
</div>
<div>
......@@ -126,37 +118,9 @@
</el-tabs>
<div>
<dee-tools :tools="tools" mode="normal" app-name="tf-mom" :collapse="false" />
<!-- <el-button
v-if="conStatus === 'Not'"
class="dee-tools"
size="small"
@click="preparaConfirmation(true)"
>
<img
src="/icons/c-newpart.png"
class="icon"
alt=""
>生产准备确认</el-button>
<el-button
v-else
class="dee-tools"
size="small"
@click="preparaConfirmation(false)"
>
<img
src="/icons/c-newpart.png"
class="icon"
alt=""
>撤销</el-button> -->
<!-- <el-button class="dee-tools" size="small" @click="exportTable">
<img
src="/icons/c-Import.png"
class="icon"
alt=""
>导出</el-button> -->
</div>
</header>
<div v-loading="confirmaLoading" class="table">
<div class="table">
<el-table
v-if="!confirmaLoading"
ref="table"
......@@ -304,16 +268,7 @@
>{{ item.name }}</el-radio-button>
</el-radio-group>
<div>
<!-- <el-button
class="dee-tools"
size="small"
@click="exportTableSituation"
>
<img
src="/icons/c-Import.png"
class="icon"
alt=""
>导出</el-button> -->
<dee-tools :tools="toolsRight" :collapse="false" style="width:100px" />
<div v-if="conStatus === 'Yes'" class="legnd">
<div
v-for="item in joExecutePlanStateData"
......@@ -330,7 +285,7 @@
</div>
</div>
</header>
<div v-loading="preparaLoading" class="table">
<div class="table">
<el-table
v-if="!preparaLoading"
:ref="onlyUuid"
......@@ -582,6 +537,7 @@
import { post } from '@/utils/http'
import { v4 as uuidv4 } from 'uuid'
import exportExcelTable from './exportExcelTable.vue'
import { exportExcel } from '@/api/exportExcel-elementUI.js'
export default {
name: 'StationPlanDetails',
components: {
......@@ -627,6 +583,17 @@ export default {
icon: '/icons/c-newpart.png'
}
],
toolsRight: [
{
name: '导出',
icon: '/icons/c-Import.png',
handler: {
click: () => {
this.exportTableSituation()
}
}
}
],
editRow: {
id: null,
parenId: null,
......@@ -996,6 +963,12 @@ export default {
getCheckConfirmYes(status) {
var that = this
that.confirmaLoading = true
let state = null
if (status) {
state = status
} else {
state = this.conStatus === 'Not' ? this.conStatus : 'Y'
}
post(
'WrProduction/findProductionPrepare',
{
......@@ -1004,7 +977,7 @@ export default {
serialNumber: this.AOname,
scheduledStart: (this.date.length && this.date[0]) || '',
scheduledEnd: (this.date.length && this.date[1]) || '',
state: this.conStatus
state: state
}
)
.then((res) => {
......@@ -1430,26 +1403,26 @@ export default {
})
.catch((err) => console.error(err))
.finally(() => {})
}
},
/**
* 导出数据
*/
// exportTable() {
// this.$refs.exportExcelTable.exportTable()
// },
// exportTableSituation() {
// var title = ''
// this.confirmaData.forEach((p) => {
// p.children.forEach((q) => {
// if (q.highlight) title = q.materNo
// })
// })
// var label = ''
// this.tabsData.forEach((p) => {
// if (this.readyStatus === p.typeName) label = p.name
// })
// exportExcel(this.$refs[this.onlyUuid].$el, title + '-' + label)
// }
exportTable() {
this.$refs.exportExcelTable.exportTable()
},
exportTableSituation() {
var title = ''
this.confirmaData.forEach((p) => {
p.children.forEach((q) => {
if (q.highlight) title = q.materNo
})
})
var label = ''
this.tabsData.forEach((p) => {
if (this.readyStatus === p.typeName) label = p.name
})
exportExcel(this.$refs[this.onlyUuid].$el, title + '-' + label)
}
}
}
</script>
......
......@@ -13,7 +13,7 @@
:form-btn-position="'center'"
@on-submit="initData(searchForm)"
/>
<dee-table
<dee-up-table
:columns="tableColumns"
:data="tableData"
:index-row="{ title: '序号', width: '60', align: 'center', fixed: true }"
......@@ -24,7 +24,7 @@
@selection-change="selectionChange"
>
<dee-tools slot="header" :tools="tools" mode="normal" :collapse="false" />
</dee-table>
</dee-up-table>
<dee-dialog width="70%" title="新增" :visible.sync="addDialogVisible" @on-cancel="addCancel">
<add-form ref="addForm" @cancel="addCancel" />
</dee-dialog>
......@@ -231,5 +231,9 @@ export default {
}
</script>
<style lang='scss'>
.materialReferenceLink-table {}
.materialReferenceLink-table {
.dee-up-table {
height: 500px;
}
}
</style>
......@@ -5,7 +5,7 @@
* @FilePath: applications/dee-mes/src/privateComponents/components/purchasingWarehousingNewOrEdit/index.vue
*/
<template>
<div class="className">
<div class="purchasingWarehousing-newOrEdit">
<!-- <dee-tools :tools="topTools" mode="normal" style="justify-content: end;" /> -->
<dee-form
ref="form"
......@@ -16,16 +16,17 @@
@on-submit="submit"
/>
<div class="sub-title"> 采购入库申请明细 </div>
<dee-table
<dee-up-table
ref="treeTable"
:data="tableData"
:columns="columns"
:options="optionsTree"
:empty-content="emptyContent"
>
<div slot="header" class="table-title-wrap">
<dee-tools :tools="tools" mode="normal" />
</div>
</dee-table>
</dee-up-table>
<span style="position: absolute;top: calc(100% - 70px);left: calc(50% - 70px);}">
<el-button type="primary" class="searchBtn" @click="submit">确认</el-button>
<el-button type="primary" class="searchBtn" @click="back">取消</el-button>
......@@ -437,7 +438,8 @@ export default {
tableData: [],
tableParam: [],
operator: null,
addData: {}
addData: {},
emptyContent: { 'icon': '/icons/dee-doc/noData.png', 'text': '暂无数据' }
}
},
computed: {
......@@ -829,4 +831,10 @@ export default {
}
}
</script>
<style lang='scss'></style>
<style lang='scss'>
.purchasingWarehousing-newOrEdit{
.dee-up-table {
height: 300px;
}
}
</style>
......@@ -15,7 +15,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="站位:">
<el-select v-model="form.postion" placeholder="站位" @change="changeFrom">
<el-select v-model="form.postion" placeholder="站位" @change="changePostion">
<el-option
v-for="(item, i) in postionList"
:key="item.value + i"
......@@ -86,6 +86,10 @@ export default {
changeFrom(val) {
this.$emit('input', val)
},
changePostion(val) {
this.$emit('input', val)
this.$bus.$emit('getTableData', this.form)
},
getStation(val) {
this.postionList = []
this.$set(this.form, 'postion', '')
......
<template>
<div class="instructions-issued">
<dee-search-server
v-model="searchFormData"
:show-reset-btn="false"
:show-search-btn="false"
class="instructions-search-box"
:form-data="seachForm"
/>
<split-pane
:min-percent="18"
:default-percent="75"
split="vertical"
class="detail-pane"
>
<template slot="paneL">
<dee-tab :tabs="tabItems" :show-swipe="false" :is-detail="false">
<div slot="0" style="height:100%;box-sizing:border-box">
<dee-as-com
ref="detailCom"
:key="layConfig.typeName"
:lay-config="layConfig"
/>
</div>
<div slot="1" style="height:100%;box-sizing:border-box">
<dee-as-com
ref="detailCom"
:key="layConfigAlready.typeName"
:lay-config="layConfigAlready"
/>
</div>
</dee-tab>
</template>
<template slot="paneR">
<div class="sub-title">
下达班组
</div>
<el-select v-model="group" size="small" placeholder="请选择" style="width:100%" @change="selectGroup">
<el-option
v-for="item in groupList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</split-pane>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
data() {
return {
sortiesData: [],
postionList: [],
seachForm: [
{
key: 'sorties',
title: '架次',
component: {
name: 'el-select',
options: this.sortiesData,
clearable: true
}
},
{
key: 'postion',
title: '站位',
component: {
name: 'el-select',
options: this.postionList,
clearable: true
}
}
],
searchFormData: {
sorties: '',
postion: ''
},
group: '',
groupList: [
{
label: '班组1',
value: 1
},
{
label: '班组2',
value: 2
}
]
}
},
computed: {
tabItems() {
return [
{
name: '待下达',
id: '0'
},
{
name: '已下达',
id: '1'
}
]
},
layConfig() {
return {
typeName: 'JoExecutePlan',
layKey: 'instructionsIssuedListTo'
}
},
layConfigAlready() {
return {
typeName: 'JoExecutePlan',
layKey: 'instructionsIssuedListAlready'
}
}
},
watch: {
'searchFormData.sorties': {
immediate: true,
handler(val) {
const sorties = this.sortiesData.find(r => r.value === val)
this.$set(this.searchFormData, 'sortiesName', sorties && sorties.sortiesName || '')
this.$utils.getDicListByCode('SoriteType').then(res => {
this.SoriteTypeOptions = res
this.getStation(val)
})
}
},
'searchFormData.postion': {
immediate: true,
handler(val) {
const postion = this.postionList.find(r => r.value === val)
this.$set(this.searchFormData, 'postionName', postion && postion.label || '')
}
}
},
created() {
this.getSortiesList()
},
methods: {
getSortiesList() {
this.sortiesData = []
const params = { 'searchItems': { 'items': [] }, 'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }] }
params.openProps = [{ name: 'target' }, { name: 'source' }]
this.$api.searchApi('SoritesLink', params).then(res => {
if (res.items && res.items.content) {
this.sortiesData = res.items.content.map(row => {
return {
value: `${row.sourceId}:${row.targetId}`,
label: this.getSoritesLabel(row),
sortiesName: row.source.defName
}
})
this.$set(this.seachForm[0].component, 'options', this.sortiesData)
this.$set(this.searchFormData, 'sorties', this.sortiesData[0].value)
this.$set(this.searchFormData, 'sortiesName', this.sortiesData[0].sortiesName)
this.getStation()
}
})
},
getSoritesLabel(row) {
const type = (row.target && row.target.type) ? this.SoriteTypeOptions.find(r => r.value === row.target.type) : ''
return `${row.source.defName} ${type && type.label || ''}`
},
getStation(val) {
this.postionList = []
this.$set(this.searchFormData, 'postion', '')
if (val) {
const sortiesId = val.split(':')[0]
const sortiesTypeId = val.split(':').slice(-1)[0]
const params = {
'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': sortiesId }, { 'fieldName': 'soritesTypeId', 'operator': 'EQ', 'value': sortiesTypeId }] },
'openProps': [{ name: 'aircraftSorties' }],
'sortItem': [{ 'fieldName': 'serialNumber', 'sortOrder': 'asc' }]
}
post('ExtPosition/search', params).then(res => {
if (res.items && res.items.content) {
this.postionList = res.items.content.map(row => {
return {
value: `${row.id}`,
label: row.serialNumber
}
})
this.$set(this.seachForm[1].component, 'options', this.postionList)
this.$set(this.searchFormData, 'postion', this.postionList[0].value)
this.$set(this.searchFormData, 'postionName', this.postionList[0].label)
}
})
}
},
selectGroup() {
}
}
}
</script>
<style lang="scss">
.instructions-issued{
background: #ffff;
height: 100%;
.instructions-search-box{
margin-bottom: 0;
padding: 8px 0 0 8px;
.el-form-item{
margin-bottom: 10px;
}
}
}
</style>
......@@ -78,6 +78,8 @@ export default {
mounted() {
this.$bus.$on('getTableData', (data) => {
this.$nextTick(() => {
this.getLeftCount(data)
this.getRightCount(data)
const formData = {
items: [],
operator: 'AND'
......@@ -98,10 +100,7 @@ export default {
methods: {
rowClick(data) {
this.rowData = data
this.getLeftCount(data.row.extProcessPlan)
this.getRightCount(data.row.extProcessPlan)
this.getMissInfo(data.row.extProcessPlan)
// this.$emit('rowClick', data.row)
},
// getPageData(val) {
// this.getMissInfo(this.rowData.row, val)
......@@ -113,12 +112,12 @@ export default {
{
'fieldName': 'extProcessPlan.sorties',
'operator': 'EQ',
'value': obj.sorties
'value': obj.sortiesName
},
{
'fieldName': 'extProcessPlan.positionNumber',
'operator': 'EQ',
'value': obj.positionNumber
'value': obj.postionName
},
{
'fieldName': 'extProcessPlan.subTypeName',
......@@ -151,12 +150,12 @@ export default {
{
'fieldName': 'sorties',
'operator': 'EQ',
'value': obj.sorties
'value': obj.sortiesName
},
{
'fieldName': 'positionNumber',
'operator': 'EQ',
'value': obj.positionNumber
'value': obj.postionName
},
{
'fieldName': 'subTypeName',
......
......@@ -80,7 +80,6 @@ export default {
deep: true,
immediate: true,
handler(val) {
console.log(1212, val)
this.detailInfo = val
}
}
......
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