Commit 0eb4097b authored by xioln's avatar xioln

入库流程

parent d896849b
......@@ -208,6 +208,10 @@ export default {
basicData: {
type: Object,
required: true
},
jobResponseInTestData: {
type: Object,
required: true
}
},
data() {
......@@ -314,7 +318,7 @@ export default {
},
created() {
// 初始化数据
this.form = this.basicData
this.form = this.jobResponseInTestData
},
methods: {
onSubmit() {
......@@ -322,6 +326,11 @@ export default {
...this.form,
'jobTestCheckItems': this.jobTestCheckItems
}
if (this.form.isPassCode === '合格' || this.form.isPassCode === 'Y') {
params.hasTestPass = true
} else {
params.hasTestPass = false
}
params.operator = 'MODIFY'
return new Promise((resolve, reject) => {
this.$refs.form.validate((isok) => {
......
......@@ -918,6 +918,11 @@ export default {
...this.form,
'jobTestCheckItems': this.jobTestCheckItems
}
if (this.form.isPassCode === '合格' || this.form.isPassCode === 'Y') {
params.hasTestPass = true
} else {
params.hasTestPass = false
}
params.operator = 'MODIFY'
return new Promise((resolve, reject) => {
this.$refs.form.validate((isok) => {
......
......@@ -178,6 +178,10 @@ export default {
basicData: {
type: Object,
required: true
},
jobResponseInTestData: {
type: Object,
required: true
}
},
data() {
......@@ -283,7 +287,7 @@ export default {
},
created() {
// 初始化数据
this.form = this.basicData
this.form = this.jobResponseInTestData
},
methods: {
onSubmit() {
......@@ -291,6 +295,11 @@ export default {
...this.form,
'jobTestCheckItems': this.jobTestCheckItems
}
if (this.form.isPassCode === '合格' || this.form.isPassCode === 'Y') {
params.hasTestPass = true
} else {
params.hasTestPass = false
}
params.operator = 'MODIFY'
return new Promise((resolve, reject) => {
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 {
default: () => null
},
backVal: {
type: Object,
type: String,
default: () => null
}
},
......@@ -97,7 +97,7 @@ export default {
this.locationList = res.items.content.map((item) => {
return {
label: item.extcode,
value: item.id
value: `${item.id}+${item.extcode}`
}
})
} else {
......
......@@ -6,15 +6,21 @@
*/
<template>
<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>
</template>
<script>
import { post } from '@/utils/http'
import WarehouseSelect from './component/warehouseSelect.vue'
import PrintTag from './component/PrintTag.vue'
export default {
componentName: '验收入库确认签审对象',
name: 'WarehousingConfirmationConfirm', // name写在组件的最前方,自定义组件为必填
components: { PrintTag },
props: {
basicData: {
type: Object,
......@@ -36,18 +42,21 @@ export default {
show: true,
props: {
basicData: this.basicData,
backVal: '2'
backVal: '回显'
},
handler: {
save: (extWorkUnitId) => {
if (!extWorkUnitId.split('+')[0]) return this.$utils.showMessageWarning('请选择库位')
const params = {
id: this.inventoryJobResponses.id,
id: this.inventoryJobResponsesId,
operator: 'MODIFY',
extWorkUnitId: extWorkUnitId,
extWorkUnitId: extWorkUnitId.split('+')[0],
extWorkUnitIdType: 'ExtDxProductWorkUnit'
}
this.$api.recursion('JobResponseInStorage', params).then(res => {
this.$utils.showMessageSuccess('保存成功')
this.extWorkUnitName = extWorkUnitId.split('+')[1]
this.searchInStorageRequestItem(this.basicData.id)
})
}
}
......@@ -124,7 +133,24 @@ export default {
rowKey: 'id',
'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: {
......@@ -140,6 +166,7 @@ export default {
}
},
created() {
console.log('basicData', { ...this.basicData })
// 初始化数据
// this.searchInStorageRequestItem(this.basicData.businessObject.id)
},
......@@ -192,20 +219,18 @@ export default {
},
{
'name': 'inventoryJobResponses',
'searchItems': {
'items': [
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'JobResponseInEntry'
}
]
},
'openProps': [
{
'name': 'extWorkUnit'
}
{ 'name': 'extWorkUnit' }
]
// 'searchItems': {
// 'items': [
// {
// 'fieldName': 'subTypeName',
// 'operator': 'EQ',
// 'value': 'JobResponseInEntry'
// }
// ]
// },
}
],
'sortItem': [
......@@ -256,7 +281,7 @@ export default {
post('InStorageRequestItem/treeSearch', param).then(res => {
const data = res.items
this.treeTableNoArrange(data)
this.inventoryJobResponses = data[0].inventoryJobResponses[0]
this.inventoryJobResponsesId = data[0].inventoryJobResponses[0].id || ''
}).catch((err) => {
console.log(err)
})
......@@ -271,6 +296,62 @@ export default {
}
})
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 @@
"node-sass": "^4.14.1",
"tinymce": "^5.10.3",
"vcrontab": "^0.3.5",
"vue-qr": "^2.3.0",
"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