Commit e8e47e45 authored by “lixuyan”'s avatar “lixuyan”

打印联调

parent d8e62c14
<template>
<div class="AssignCradInfo">
<div class="dee-form2 header">
<div class="form-row-title">详情</div>
<div v-show="basicData.appState==='deployed'" class="print-button" @click="print">
<img src="/icons/c-print.png" alt="">
<span>打印</span>
</div>
</div>
<dee-as-com
ref="detailCom"
dis-business
:lay-config="cmpOptions"
:basic-data="basicData"
/>
<PrintTag ref="print" :config="printConfig" />
</div>
</template>
<script>
import PrintTag from './printTag'
import { post } from '@/utils/http'
export default {
name: 'AssignCradInfo',
componentName: '调配卡详情',
components: {},
components: {
PrintTag
},
props: {
basicData: {
type: Object,
......@@ -21,7 +33,13 @@ export default {
},
data() {
return {
cmpOptions: {}
cmpOptions: {},
printConfig: {
visible: false,
width: 260,
prints: []
},
loading: false
}
},
watch: {
......@@ -47,8 +65,178 @@ export default {
}
}
}
},
methods: {
// 打印
print() {
this.loading = true
const params = {
'pageFrom': 1,
'pageSize': 1,
'searchItems': {
'items': [
{
'fieldName': 'id',
'operator': 'EQ',
'value': this.basicData.id
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'material'
},
{
'name': 'assignCardDetails'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/AssignCard/qualification', params)
.then((res) => {
var data = res.items.content[0]
this.printConfig = Object.assign({}, this.printConfig, {
visible: true
})
var b = data.validityEnd && data.validityEnd.split(':') || []
b.pop()
if (data.subTypeName === 'AssignCardPaint') {
const a = data.validityStart && data.validityStart.split(':') || []
a.pop()
this.printConfig.prints = [
{
text: data.cardNo,
title: '漆料合格标签',
count: data.actualWeight,
number: { label: '编号', value: data.cardNo },
mark: { label: '油漆牌号', value: data.material.modelNo },
mixingUnit: { label: '调配单位', value: data.assignUnit },
validity: {
label: '有效期',
value: {
start: {
label: '始',
value: a.join(':')
},
end: {
label: '止',
value: b.join(':')
}
}
},
deployment: { label: '调配员', value: data.creator.userName },
inspector: {
label: '检验员',
value: data.checker
}
}
]
} else if (data.subTypeName === 'AssignCardAlodine') {
const c = (data.assignTime && data.assignTime.split(':')) || []
c.pop()
this.printConfig.prints = [
{
text: data.cardNo,
title: '阿洛丁刷涂合格标签',
count: data.assignTotalAmount,
number: { label: '编号', value: data.cardNo },
mark: {
label: '阿洛丁牌号',
value: data.material.modelNo
},
mixingUnit: { label: '调配单位', value: data.assignUnit },
validity: {
label: '有效期',
value: {
start: {
label: '始',
value: c.join(':')
},
end: {
label: '止',
value: b.join(':')
}
}
},
deployment: { label: '调配员', value: data.creator.userName },
inspector: {
label: '检验员',
value: data.checker
}
}
]
} else if (data.subTypeName === 'AssignCardLacquer') {
const d = (data.mixStartTime && data.mixStartTime.split(':')) || []
d.pop()
const e = (data.mixEndTime && data.mixEndTime.split(':')) || []
e.pop()
this.printConfig.prints = [
{
text: data.cardNo,
title: '胶料合格标签',
count: data.actualWeight,
number: { label: '编号', value: data.cardNo },
mark: { label: '牌号', value: data.material.modelNo },
mixingUnit: {
label: '合格证号',
value: data.certificateNo
},
validity: {
label: '解冻及施工期',
value: {
start: {
label: '始',
value: d.join(':')
},
end: {
label: '止',
value: e.join(':')
}
}
},
deployment: { label: '调配员', value: data.creator.userName },
inspector: {
label: '检验员',
value: data.checker
}
}
]
}
this.$refs.print.print()
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
})
}
}
}
</script>
<style lang='scss'>
.AssignCradInfo{
.header{
display: flex;
justify-content: space-between;
align-content: center;
.form-row-title{
padding-left: 0px;
}
.print-button{
cursor: pointer;
display: flex;
align-items: center;
img{
width: 16px;
height: 16px;
}
}
}
}
</style>
......@@ -63,10 +63,12 @@
<div class="table">
<!-- 表格 -->
<dee-table
selection-row
:index-row="indexRow"
:columns="colums2"
:data="tableData2"
:options="tableOptions2"
@selection-change="selectionChange"
>
<dee-tools slot="header" :tools="tools" mode="normal" />
</dee-table>
......@@ -78,9 +80,11 @@
:card-id="basicData.id"
@reload="reload"
/>
<PrintTag ref="print" :config="printConfig" />
</div>
</template>
<script>
import PrintTag from './printTag'
import config from './config'
import Dialog from './dialog'
import { post } from '@/utils/http'
......@@ -88,7 +92,8 @@ export default {
name: 'LacquerFreeze',
componentName: '流程中冷冻',
components: {
Dialog
Dialog,
PrintTag
},
mixins: [config],
props: {
......@@ -120,6 +125,18 @@ export default {
this.$refs.dialog.open()
}
}
}, {
name: '打印',
icon: '/icons/c-print.png',
handler: {
click: (e) => {
if (this.sectionData.length !== 1) {
this.$message.error('请选择一条数据')
} else {
this.print()
}
}
}
}],
colums2: [
{
......@@ -215,21 +232,128 @@ export default {
stripe: true,
border: true,
height: '29vh'
},
sectionData: [],
printConfig: {
visible: false,
width: 260,
prints: []
}
}
},
watch: {
basicData: {
form: {
immediate: true,
deep: true,
handler: function(val) {
if (val.assignCardItems && val.assignCardItems.length > 0) {
this.tableData2 = this.basicData.assignCardItems
this.tableData2 = this.form.assignCardItems
}
}
}
},
methods: {
selectionChange(section) {
this.sectionData = section
},
print() {
this.loading = true
const params = {
'pageFrom': 1,
'pageSize': 1,
'searchItems': {
'items': [
{
'fieldName': 'id',
'operator': 'EQ',
'value': this.sectionData[0].id
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'assignCard',
'openProps': [
{
'name': 'material'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/AssignCardItem/detail', params)
.then((res) => {
var data = res.items.content[0]
this.printConfig = Object.assign({}, this.printConfig, {
visible: true
})
var b =
(data.assignCard.validityEnd &&
data.assignCard.validityEnd.split(':')) ||
[]
b.pop()
var c = (data.thawPickTime && data.thawPickTime.split(':')) || []
c.pop()
var d = (data.activeTime && data.activeTime.split(':')) || []
d.pop()
this.printConfig.prints = [
{
text: data.assignCard.cardNo,
title: '胶料冷冻标签',
count: data.weight,
number: { label: '编号', value: data.itemNo },
mark: {
label: '牌号',
value: data.assignCard.material.modelNo
},
mixingUnit: {
label: '合格证号',
value: data.assignCard.certificateNo
},
remainingConstructionPeriod: {
label: '剩余施工期',
value: data.assignCard.leftWorkMinutes
},
ineffectiveTime: {
label: '失效时间',
value: b.join(':')
},
validity: {
label: '解冻及施工期',
value: {
start: {
label: '始',
value: c.join(':')
},
end: {
label: '止',
value: d.join(':')
}
}
},
deployment: { label: '调配员', value: data.creator.userName },
inspector: {
label: '检验员',
value: data.assignCard.checker
}
}
]
this.$refs.print.print()
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
})
},
reload() {
this.getLasousInstallation()
},
......
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