Commit a5e889de authored by xioln's avatar xioln

移库库位选择

parent 85444f35
......@@ -93,37 +93,43 @@ export default {
return {
'subTypeName': 'InStorageRecallItem',
'reqStatus': 'Apply',
'outStorageId': r.inventory && r.inventory.jobResponseId || '',
'outStorageIdType': r.inventory && r.inventory.jobResponseIdType || '',
'inventoryId': r.inventoryId || '',
'inventoryIdType': r.inventoryIdType || '',
'purchaseUnitId': r.inventory && r.inventory.jobResponse.jobOrder.extMaterial.extUnitId || '',
'purchaseUnitIdType': r.inventory && r.inventory.jobResponse.jobOrder.extMaterial.extUnitIdType || '',
'extDxSipplierId': r.inventory && r.inventory.jobResponse.jobOrder.extDxSipplierId || '',
'extDxSipplierIdType': r.inventory && r.inventory.jobResponse.jobOrder.extDxSipplierIdType || '',
extDxSipplier: r.inventory && r.inventory.jobResponse.jobOrder.extDxSipplier || '',
extMaterial: r.inventory && r.inventory.jobResponse.jobOrder.extMaterial || '',
storageZone: r.inventory && r.inventory.jobResponse.jobOrder.storageZone || '',
storageCondition: r.inventory && r.inventory.jobResponse.jobOrder.storageCondition || '',
'extMaterialId': r.inventory && r.inventory.jobResponse.jobOrder.extMaterialId || '',
'extMaterialIdType': r.inventory && r.inventory.jobResponse.jobOrder.extMaterialIdType || '',
'arrivalDate': r.inventory && r.inventory.jobResponse.jobOrder.arrivalDate || '',
'reqAmount': r.inventory && r.inventory.jobResponse.jobOrder.reqAmount || '',
'airModel': r.inventory && r.inventory.jobResponse.jobOrder.airModel || '',
'sorties': r.inventory && r.inventory.jobResponse.jobOrder.sorties || '',
'manufacturer': r.inventory && r.inventory.jobResponse.jobOrder.manufacturer || '',
'contractNo': r.inventory && r.inventory.jobResponse.jobOrder.contractNo || '',
'stockPrice': r.inventory && r.inventory.jobResponse.jobOrder.stockPrice || '',
'lotNo': r.inventory && r.inventory.jobResponse.jobOrder.lotNo || '',
'taxRate': r.inventory && r.inventory.jobResponse.jobOrder.taxRate || '',
'taxUnitPrice': r.inventory && r.inventory.jobResponse.jobOrder.taxUnitPrice || '',
'taxPrice': r.inventory && r.inventory.jobResponse.jobOrder.taxPrice || '',
'stockUnitPrice': r.inventory && r.inventory.jobResponse.jobOrder.stockUnitPrice || '',
'purchaseOrderNo': r.inventory && r.inventory.jobResponse.jobOrder.purchaseOrderNo || '',
'inventory': {
'testNo': r.inventory.testNo,
'ispass': r.inventory.ispass,
'materialType': r.inventory.materialType,
'materialCode': r.inventory.materialCode,
'materialName': r.inventory.materialName,
'modelNo': r.inventory.modelNo,
'techspec': r.inventory.techspec,
'spce': r.inventory.spce,
'suppstatus': r.inventory.suppstatus,
'lotNo': r.inventory.lotNo,
'serno': r.inventory.serno,
'aircraftType': r.inventory.aircraftType,
'sorties': r.inventory.sorties,
// 'extUnit': { unitName: r.inventory.extUnit.unitName },
'workcenter': r.inventory.workcenter,
'workunit': r.inventory.workunit,
'suppname': r.inventory.suppname,
'arrDate': r.inventory.arrDate,
'madDate': r.inventory.madDate,
'qualityPeriod': r.inventory.qualityPeriod,
'longPeriod': r.inventory.longPeriod,
'spotCheckPeriod': r.inventory.spotCheckPeriod,
'arrDrawNo': r.inventory.arrDrawNo,
'taxRate': r.inventory.taxRate,
'stockUnitPrice': r.inventory.stockUnitPrice,
'stockPrice': r.inventory.stockPrice,
'applyUserName': r.inventory.applyUserName,
'contractNo': r.inventory.contractNo
},
'reqAmount': r.reqAmount,
'arrivalVer': r.arrivalVer,
'taxUnitPrice': r.taxUnitPrice,
'taxPrice': r.taxPrice,
'remark': r.remark,
'operator': 'ADD',
remark: r.inventory && r.inventory.jobResponse.jobOrder.remark || '',
'isRoot': r.inventory && r.inventory.jobResponse.jobOrder.isRoot
'isRoot': r.inventory.jobResponse.jobOrder.isRoot
}
})
this.$emit('submitEvent', { formData: data })
......
/**
* @Description: 移库入库库位选择
* @author xioln
* @date 2023-08-14
* @FilePath: applications/dee-mes/src/privateComponents/components/InStorageMoveWarehouseSelect/index.vue
*/
<template>
<div class="inStorageMoveWarehouse-select">
<el-select
v-model="selVal"
v-el-select-loadmore="loadmore"
:remote-method="remoteMethod"
:loading="loading"
clearable
filterable
remote
placeholder="请输入并选择"
size="mini"
@change="changeVal"
>
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</template>
<script>
export default {
componentName: '移库入库库位选择',
name: 'InStorageMoveWarehouseSelect', // name写在组件的最前方,自定义组件为必填
components: {},
// 自定义指令(和method同级)
directives: {
// 下拉框懒加载(el-select-loadmore是自定义的指令,使用时前面加v-)
'el-select-loadmore': {
// el:使用自定义指令的元素(下拉框),
bind(el, binding) {
// 下拉框下拉的框
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
// 增加滚动监听,
SELECTWRAP_DOM.addEventListener('scroll', function() {
// scrollHeight:当前所有选项的高度
// scrollTop:滚动的距离
// clientHeight:下拉框的高度
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight + 1
// 当滚动条滚动到最底下的时候执行接口加载下一页
if (condition) {
binding.value()
}
})
}
}
},
props: {
itemObj: {
type: Object,
default: null
},
form: {
type: Object,
default: () => { }
},
middleForm: {
type: Object,
default: () => { }
},
value: {
type: [Number, String, Object],
default: () => ''
}
},
data() {
return {
options: [],
selVal: '',
querys: '', // 远程搜索输入的内容
selectLoading: false, // select加载
stopLoading: false, // 最后一次加载之后,不再加载
pageData: {// 懒加载相关参数,这里代表从第一条数据开始加载,一次加载十项
pageNumber: 1,
pageSize: 10
},
loading: false
}
},
computed: {},
watch: {
'form.extWorkCenterId': {
immediate: true,
deep: true,
handler(val) {
if (val) {
// this.getdata()
}
}
}
},
created() {
},
methods: {
changeVal() {
this.$emit('input', this.selVal)
},
// 下拉框滚动分页加载
loadmore() {
if (!this.stopLoading) {
const querys = {
pageFrom: this.pageData.pageNumber++,
pageSize: 10,
searchItems: {
items: [
{ 'fieldName': 'extname', operator: 'LIKE', value: this.querys },
{ 'fieldName': 'extCenterId', operator: 'EQ', value: this.form.extWorkCenterId }
],
operator: 'AND'
}
}
this.getdatas(querys)// 调用接口获取下拉框数据
}
},
// 远程搜索物料类别
remoteMethod(query) {
this.querys = query// 保存搜索内容
let querys = {}
// 有内容则搜索
if (query !== '') {
querys = {
pageFrom: 1,
pageSize: 10,
searchItems: {
items: [
{ 'fieldName': 'extname', operator: 'LIKE', value: query },
{ 'fieldName': 'extCenterId', operator: 'EQ', value: this.form.extWorkCenterId }
],
operator: 'AND'
}
}
} else {
// 没有内容搜10
querys = {
pageFrom: 1,
pageSize: 10,
searchItems: {
items: [
{ 'fieldName': 'extCenterId', operator: 'EQ', value: this.form.extWorkCenterId }
],
operator: 'AND'
}
}
// 重置懒加载
this.stopLoading = false
this.pageData = {// 懒加载相关参数,这里代表从第一条数据开始加载,一次加载二十项
pageNumber: 1,
pageSize: 10
}
}
// 调用接口
this.selectLoading = true
this.getdata(querys)
},
getdata(querys) {
this.selectLoading = true
this.$api.searchApi('ExtDxProductWorkUnit', querys).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.extname
}
})
}).finally(() => {
this.selectLoading = false
})
},
getdatas(querys) {
if (!this.querys) {
return
}
this.selectLoading = true
this.$api.searchApi('ExtDxProductWorkUnit', querys).then(res => {
const arr = res.items.content
// 如果某次返回值是[],表示已经加载完了,不必再加载
if (arr.length === 0) {
this.stopLoading = true
return
}
// 保存数据
if (querys.pageNumber === 1) {
this.options = arr.map(row => {
return {
value: row.id,
label: row.extname
}
})
} else {
this.options = [...this.options, ...arr.map(row => {
return {
value: row.id,
label: row.extname
}
})]
}
}).finally(() => {
this.selectLoading = false
})
}
}
}
</script>
<style lang='scss'></style>
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