Commit 0eb4097b authored by xioln's avatar xioln

入库流程

parent d896849b
...@@ -208,6 +208,10 @@ export default { ...@@ -208,6 +208,10 @@ export default {
basicData: { basicData: {
type: Object, type: Object,
required: true required: true
},
jobResponseInTestData: {
type: Object,
required: true
} }
}, },
data() { data() {
...@@ -314,7 +318,7 @@ export default { ...@@ -314,7 +318,7 @@ export default {
}, },
created() { created() {
// 初始化数据 // 初始化数据
this.form = this.basicData this.form = this.jobResponseInTestData
}, },
methods: { methods: {
onSubmit() { onSubmit() {
...@@ -322,6 +326,11 @@ export default { ...@@ -322,6 +326,11 @@ export default {
...this.form, ...this.form,
'jobTestCheckItems': this.jobTestCheckItems 'jobTestCheckItems': this.jobTestCheckItems
} }
if (this.form.isPassCode === '合格' || this.form.isPassCode === 'Y') {
params.hasTestPass = true
} else {
params.hasTestPass = false
}
params.operator = 'MODIFY' params.operator = 'MODIFY'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.form.validate((isok) => { this.$refs.form.validate((isok) => {
......
...@@ -918,6 +918,11 @@ export default { ...@@ -918,6 +918,11 @@ export default {
...this.form, ...this.form,
'jobTestCheckItems': this.jobTestCheckItems 'jobTestCheckItems': this.jobTestCheckItems
} }
if (this.form.isPassCode === '合格' || this.form.isPassCode === 'Y') {
params.hasTestPass = true
} else {
params.hasTestPass = false
}
params.operator = 'MODIFY' params.operator = 'MODIFY'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.form.validate((isok) => { this.$refs.form.validate((isok) => {
......
...@@ -178,6 +178,10 @@ export default { ...@@ -178,6 +178,10 @@ export default {
basicData: { basicData: {
type: Object, type: Object,
required: true required: true
},
jobResponseInTestData: {
type: Object,
required: true
} }
}, },
data() { data() {
...@@ -283,7 +287,7 @@ export default { ...@@ -283,7 +287,7 @@ export default {
}, },
created() { created() {
// 初始化数据 // 初始化数据
this.form = this.basicData this.form = this.jobResponseInTestData
}, },
methods: { methods: {
onSubmit() { onSubmit() {
...@@ -291,6 +295,11 @@ export default { ...@@ -291,6 +295,11 @@ export default {
...this.form, ...this.form,
'jobTestCheckItems': this.jobTestCheckItems 'jobTestCheckItems': this.jobTestCheckItems
} }
if (this.form.isPassCode === '合格' || this.form.isPassCode === 'Y') {
params.hasTestPass = true
} else {
params.hasTestPass = false
}
params.operator = 'MODIFY' params.operator = 'MODIFY'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.form.validate((isok) => { this.$refs.form.validate((isok) => {
......
<!--
* @Author: Lean
* @Date: 2021-03-01 14:40:26
* @LastEditTime: 2021-03-09 20:17:23
* @Description: 打印标签
* @FilePath: applications/dee-mes/src/privateComponents/components/WarehousingConfirmationConfirm/component/PrintTag.vue
-->
<!--
@prop config
@prop Number config.width 设置宽度 default = 300
@prop Array config.prints 打印的数据
@prop String config.prints[].QRcode 二维码
@prop String config.prints[].propertys 二维码下显示的属性
* 测试参数结构
config: {
width: 300,
prints: [
{
text: 'asdasdasd',
propertys: [
{ label: '编码', value: '' },
{ label: '名称', value: '' }
]
},
{
text: 'asdasdasd',
propertys: [
{ label: '编码', value: '' },
{ label: '名称', value: '' }
]
}
]
}
-->
<template>
<section ref="print" class="print">
<section
v-for="(item, index) in config.prints || []"
:key="index"
:style="{ width: '19%' }"
class="item"
>
<header>
<vue-qr style="height:218px;" :size="config.width" :margin="0" :text="item.text.toString()" :qid="index.toString()" />
</header>
<footer>
<ul>
<li
v-for="property in item.propertys"
:key="property.label"
>
<p>{{ property.label }}</p>
<span>{{ property.value }}</span>
</li>
</ul>
</footer>
</section>
</section>
</template>
<script>
import VueQr from 'vue-qr'
export default {
name: 'Print',
components: {
VueQr
},
props: {
config: {
type: Object,
default: () => {
return {
width: 300,
prints: []
}
}
}
},
data() {
return {
timer: null,
flag: true
}
},
beforeDestroy() {
this.timer = null
},
methods: {
print() {
if (this.flag) {
this.flag = false
this.timer = setInterval(() => {
if (this.$refs.print.innerHTML) {
this.printTag()
clearInterval(this.timer)
}
}, 300)
setTimeout(() => {
this.flag = true
}, 1000)
}
},
printTag() {
var iframe = document.createElement('IFRAME')
var doc = null
iframe.setAttribute('style', 'position:absolute; width:0; height:0; margin-top: -1000px; margin-left: -1000px;')
document.body.appendChild(iframe)
doc = iframe.contentWindow.document
doc.write(`
<style>
ul, li {
margin: 0;
padding: 0;
list-style: none;
font-size: 17px;
}
.item {
min-height:700px;
}
li {
position: relative;
width: 306px;
display: flex;
padding: 0 5px;
align-items: center;
border-left: 2px solid #222;
border-right: 2px solid #222;
border-bottom: 2px solid #222;
}
li::after{
content: '';
position: absolute;
left: calc(35% - 5px);
top: 0;
height: 100%;
border-left: 2px solid #222;
width: 0;
}
ul {
width: 320px;
border-top: 4px solid #222;
}
li p {
margin: 0;
width: 35%;
padding: 3.5px 0;
}
li span {
display: inline-block;
width: 65%;
text-align: left;
padding-left: 6px;
}
img {
width: 320px;
height:290px;
margin-bottom: 4px;
}
</style>
`)
doc.write(this.$refs.print.innerHTML)
doc.close()
iframe.contentWindow.focus()
iframe.contentWindow.print()
}
}
}
</script>
<style lang="scss" scoped>
.print {
position: absolute;
z-index: -999;
left: -1000px;
top: -1110px;
}
</style>
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
default: () => null default: () => null
}, },
backVal: { backVal: {
type: Object, type: String,
default: () => null default: () => null
} }
}, },
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
this.locationList = res.items.content.map((item) => { this.locationList = res.items.content.map((item) => {
return { return {
label: item.extcode, label: item.extcode,
value: item.id value: `${item.id}+${item.extcode}`
} }
}) })
} else { } else {
......
...@@ -6,15 +6,21 @@ ...@@ -6,15 +6,21 @@
*/ */
<template> <template>
<div class="warehousing-confirmation-confirm"> <div class="warehousing-confirmation-confirm">
<dee-table v-if="basicData.id" ref="treeTable" :data="tableData" :columns="columns" :options="optionsTree" /> <dee-table v-if="basicData.id" ref="treeTable" selection-row :data="tableData" :columns="columns" :options="optionsTree" :highlight-current-row="true" @selection-change="selectionChange">
<dee-tools slot="header" :tools="tools" mode="normal" :collapse="false" />
</dee-table>
<!-- 打印标签 -->
<PrintTag ref="print" :config="printConfig" />
</div> </div>
</template> </template>
<script> <script>
import { post } from '@/utils/http' import { post } from '@/utils/http'
import WarehouseSelect from './component/warehouseSelect.vue' import WarehouseSelect from './component/warehouseSelect.vue'
import PrintTag from './component/PrintTag.vue'
export default { export default {
componentName: '验收入库确认签审对象', componentName: '验收入库确认签审对象',
name: 'WarehousingConfirmationConfirm', // name写在组件的最前方,自定义组件为必填 name: 'WarehousingConfirmationConfirm', // name写在组件的最前方,自定义组件为必填
components: { PrintTag },
props: { props: {
basicData: { basicData: {
type: Object, type: Object,
...@@ -36,18 +42,21 @@ export default { ...@@ -36,18 +42,21 @@ export default {
show: true, show: true,
props: { props: {
basicData: this.basicData, basicData: this.basicData,
backVal: '2' backVal: '回显'
}, },
handler: { handler: {
save: (extWorkUnitId) => { save: (extWorkUnitId) => {
if (!extWorkUnitId.split('+')[0]) return this.$utils.showMessageWarning('请选择库位')
const params = { const params = {
id: this.inventoryJobResponses.id, id: this.inventoryJobResponsesId,
operator: 'MODIFY', operator: 'MODIFY',
extWorkUnitId: extWorkUnitId, extWorkUnitId: extWorkUnitId.split('+')[0],
extWorkUnitIdType: 'ExtDxProductWorkUnit' extWorkUnitIdType: 'ExtDxProductWorkUnit'
} }
this.$api.recursion('JobResponseInStorage', params).then(res => { this.$api.recursion('JobResponseInStorage', params).then(res => {
this.$utils.showMessageSuccess('保存成功') this.$utils.showMessageSuccess('保存成功')
this.extWorkUnitName = extWorkUnitId.split('+')[1]
this.searchInStorageRequestItem(this.basicData.id)
}) })
} }
} }
...@@ -124,7 +133,24 @@ export default { ...@@ -124,7 +133,24 @@ export default {
rowKey: 'id', rowKey: 'id',
'tree-props': { children: 'children' } 'tree-props': { children: 'children' }
}, },
inventoryJobResponses: null tools: [
{
name: '打印标签',
icon: '/icons/components/new/add.png',
handler: {
click: () => this.print()
}
}
],
inventoryJobResponsesId: null,
// 打印标签
printConfig: {
visible: false,
width: 300,
prints: []
},
selections: [],
extWorkUnitName: ''
} }
}, },
computed: { computed: {
...@@ -140,6 +166,7 @@ export default { ...@@ -140,6 +166,7 @@ export default {
} }
}, },
created() { created() {
console.log('basicData', { ...this.basicData })
// 初始化数据 // 初始化数据
// this.searchInStorageRequestItem(this.basicData.businessObject.id) // this.searchInStorageRequestItem(this.basicData.businessObject.id)
}, },
...@@ -192,20 +219,18 @@ export default { ...@@ -192,20 +219,18 @@ export default {
}, },
{ {
'name': 'inventoryJobResponses', 'name': 'inventoryJobResponses',
'searchItems': {
'items': [
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'JobResponseInEntry'
}
]
},
'openProps': [ 'openProps': [
{ { 'name': 'extWorkUnit' }
'name': 'extWorkUnit'
}
] ]
// 'searchItems': {
// 'items': [
// {
// 'fieldName': 'subTypeName',
// 'operator': 'EQ',
// 'value': 'JobResponseInEntry'
// }
// ]
// },
} }
], ],
'sortItem': [ 'sortItem': [
...@@ -256,7 +281,7 @@ export default { ...@@ -256,7 +281,7 @@ export default {
post('InStorageRequestItem/treeSearch', param).then(res => { post('InStorageRequestItem/treeSearch', param).then(res => {
const data = res.items const data = res.items
this.treeTableNoArrange(data) this.treeTableNoArrange(data)
this.inventoryJobResponses = data[0].inventoryJobResponses[0] this.inventoryJobResponsesId = data[0].inventoryJobResponses[0].id || ''
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
...@@ -271,6 +296,62 @@ export default { ...@@ -271,6 +296,62 @@ export default {
} }
}) })
this.tableData = tableData this.tableData = tableData
},
selectionChange(row) {
this.selections = row
},
// 打印标签
print() {
if (!this.selections.length) {
this.$utils.showMessageWarning('请先选择需要操作的数据')
return
}
console.log('selections', { ...this.selections[0] })
// 获取需要打印的数据
this.printConfig.prints = []
let JobResponseInStorageEntryId = ''
this.selections.forEach((row) => {
this.$message.closeAll()
if (!this.extWorkUnitName) {
this.$utils.showMessageWarning('打印标签需要先选择库位')
return
}
JobResponseInStorageEntryId = this.extWorkUnitName
this.printConfig = Object.assign({}, this.printConfig, {
visible: true
})
this.printConfig.prints.push({
text: JobResponseInStorageEntryId,
propertys: [
{ label: '编码', value: row.extMaterial.resCode },
{ label: '名称', value: row.extMaterial.resName },
{ label: '型号/牌号/件号', value: row.extMaterial.modelNo },
{ label: '规格', value: row.extMaterial.spec },
{ label: '批号', value: row.lotNo },
{ label: '系列号/序列号', value: row.serialNo },
{ label: '机型', value: row.airModel },
{ label: '验收单号', value: row.purchaseOrderNo },
// {
// label: '保证保管期',
// value:
// item.pbo.guaranteePeriod &&
// item.pbo.guaranteePeriod.replace(' 00:00:00', '')
// },
// {
// label: '贮存期',
// value:
// item.pbo.qualityPeriod &&
// item.pbo.qualityPeriod.replace(' 00:00:00', '')
// },
{ label: '库位号', value: this.extWorkUnitName || '' },
{ label: '备注', value: row.remark || '' }
]
})
})
// 打印操作
this.selections.every((item) => this.extWorkUnitName) &&
this.$refs.print.print()
} }
} }
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"tinymce": "^5.10.3", "tinymce": "^5.10.3",
"vcrontab": "^0.3.5", "vcrontab": "^0.3.5",
"vue-qr": "^2.3.0",
"vuedraggable": "^2.24.3" "vuedraggable": "^2.24.3"
} }
} }
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