Commit 39a41766 authored by jingnan's avatar jingnan 👀

退库入库确认环节修改(增加编辑库位)

parent a2dcafcd
<template>
<div class="ExtDxProductWorkUnitSelect">
<el-select
:value="selVal"
:loading="loading"
filterable
remote
:remote-method="remoteMethod"
:disabled="disabled"
loading-text="数据正在加载中..."
:placeholder="!options.length?'至少输入三位进行查询':'暂无数据'"
@change="change"
>
<el-option
v-for="item in options"
:key="item.key"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</template>
<script>
export default {
name: 'ExtDxProductWorkUnitSelect',
componentName: '远程搜索库位',
props: {
value: {
type: [String, Number],
default: ''
},
basicData: {
type: Object,
default: () => ({})
},
form: {
type: Object,
default: () => {}
},
scope: {
type: Object,
default: () => {}
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
loading: false,
options: [],
remoteFlag: true,
storageZoneId: '',
selVal: ''
}
},
computed: {},
watch: {
value: {
immediate: true,
handler(val) {
if (val) {
this.selVal = val
}
}
},
'scope.row': {
immediate: true,
deep: true,
handler: function(val) {
val && (this.storageZoneId = val.storageZoneId)
const inventoryJobResponses = val.inventoryJobResponses
let targetObject = null
if (inventoryJobResponses && inventoryJobResponses.length) {
targetObject = inventoryJobResponses.find(item => item.subTypeName === 'JobResponseInEntry')
}
if (targetObject && targetObject.extWorkUnit && !this.value) {
this.selVal = targetObject.extWorkUnit.extcode
}
}
}
},
methods: {
remoteMethod(query, id) {
if (!this.storageZoneId) return this.$utils.showMessageWarning('缺少库房信息!')
if ((!query || query.length < 3) && !id) return
if (this.remoteFlag) {
this.remoteFlag = false
const requestUrl = 'ExtDxProductWorkUnit'
const params = {
'pageFrom': 1,
'pageSize': 10,
'searchItems': {
'items': [
{
'fieldName': 'extCenterId', 'operator': 'EQ', 'value': this.storageZoneId
},
{
'fieldName': 'extcode', 'operator': 'LIKE', 'value': query
}
]
},
'openProps': []
}
this.loading = true
this.options = []
this.$api.searchApi(requestUrl, params).then(res => {
if (res.items && res.items.content.length) {
this.options = res.items.content.map((item) => {
return {
label: item.extcode,
value: `${item.id}+${item.extcode}`
}
})
} else {
this.locationList = []
}
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
this.remoteFlag = true
})
} else {
this.$utils.showMessageWarning('上一步请求正在查询中,请稍后')
}
},
change(val) {
// this.$emit('input', val)
this.save(val)
},
save(val) {
if (!val) this.$utils.showMessageWarning('请选择库位')
const idValue = val.split('+')[0]
const codeValue = val.split('+')[1]
// this.selVal = codeValue
this.$emit('input', codeValue)
this.saveExtWorkUnit(idValue)
},
saveExtWorkUnit(resValue) {
let targetObject = null
const inventoryJobResponses = this.scope.row.inventoryJobResponses
if (inventoryJobResponses && inventoryJobResponses.length) {
targetObject = inventoryJobResponses.find(item => item.subTypeName === 'JobResponseInEntry')
}
if (!targetObject || !targetObject.id) return this.$utils.showMessageWarning('该条数据下无响应数据')
if (!resValue) return this.$utils.showMessageWarning('请选择库位')
const params = {
id: targetObject.id,
operator: 'MODIFY',
extWorkUnitId: resValue,
extWorkUnitIdType: 'ExtDxProductWorkUnit'
}
this.$api.recursion('JobResponseInStorage', params).then(res => {
this.$utils.showMessageSuccess('保存成功')
this.$bus.$emit('refreshUseItemConfirm')
})
}
}
}
</script>
<style lang="scss">
</style>
......@@ -324,6 +324,13 @@ export default {
},
deep: true,
immediate: true
},
jobResponseInTestData: {
immediate: true,
deep: true,
handler(val) {
val && (this.subTypeNameDisabled = true)
}
}
},
created() {
......
......@@ -800,6 +800,13 @@ export default {
},
deep: true,
immediate: true
},
jobResponseInTestData: {
immediate: true,
deep: true,
handler(val) {
val && (this.subTypeNameDisabled = true)
}
}
// 'form.isPerformRetest': {
// handler: function(v) {
......
......@@ -294,6 +294,13 @@ export default {
},
deep: true,
immediate: true
},
jobResponseInTestData: {
immediate: true,
deep: true,
handler(val) {
val && (this.subTypeNameDisabled = true)
}
}
},
created() {
......
<!--
* @Author: gjn
* @Date: 2023-09-08 16:22:41
* @Description:领用出库签审对象_确认环节
* @Description:签审对象_确认环节
-->
<template>
<div class="OutStorageUseApprovedObjectConfirm">
......@@ -10,7 +10,7 @@
ref="applyTable"
style="border:none;"
model-name="OutStorageUse"
:lay-config="cmpOptionsItem"
:lay-config="cmpOptions"
:basic-data="basicData"
/>
<dee-as-com
......@@ -18,7 +18,7 @@
class="dee-form-com"
style="border:none;"
model-name="OutStorageUse"
:lay-config="{typeName: 'OutStorageUseItem', layKey: 'edit_outStorageUseItem'}"
:lay-config="cmpOptionsItem"
:basic-data="basicData"
/>
</div>
......@@ -36,15 +36,54 @@ export default {
},
data() {
return {
cmpOptionsItem: {
cmpOptions: {
typeName: 'OutStorageUseItem',
layKey: 'OutStorageUseApprovedObject_confirm'
},
cmpOptionsItem: {
typeName: 'OutStorageUseItem',
layKey: 'edit_outStorageUseItem'
},
refreshKey: 1
}
},
computed: {},
watch: {},
watch: {
basicData: {
immediate: true,
deep: true,
handler(val) {
if (val && val.subTypeName) {
switch (val.subTypeName) {
case 'OutStorageUse': // 领用出库
this.cmpOptions = {
typeName: 'OutStorageUseItem',
layKey: 'OutStorageUseApprovedObject_confirm'
}
this.cmpOptionsItem = {
typeName: 'OutStorageUseItem',
layKey: 'edit_outStorageUseItem'
}
break
case 'InStorageUseBackItem': // 领用退库入库
case 'InStorageMatchBackItem': // 配套退库入库
case 'InStorageOutBackItem': // 供外退库入库
this.cmpOptions = {
typeName: 'InStorageBack',
layKey: 'InStorageBackApproved_confirm'
}
this.cmpOptionsItem = {
typeName: 'InStorageBackItem',
layKey: 'InStorageMatchBackItem_viewInConfirm'
}
break
default:
break
}
}
}
}
},
created() {
this.$bus.$on('refreshUseItemConfirm', (data) => {
this.$refs.itemTable && this.$refs.itemTable.$refs.asCom.getData()
......
......@@ -91,6 +91,9 @@ export default {
},
tbPrintCode(selectRows) {
const selection = selectRows
if (selection[0].subTypeName === 'InStorageMatchBackItem' || selection[0].subTypeName === 'InStorageUseBackItem' || selection[0].subTypeName === 'InStorageOutBackItem') {
if (selection.find(item => !item.inventory || !item.inventory.workunit)) return this.$utils.showMessageWarning('请选择库位后打印!')
}
// 获取需要打印的数据
this.config.prints = []
selection.forEach((row) => {
......
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