Commit 1002b33c authored by xioln's avatar xioln

供外物料类型选择

parent fc83cdf4
/**
* @Description: 物料类型
* @author xioln
* @date 2023-08-23
* @FilePath: applications/dee-mes/src/privateComponents/components/extResourceTypeSelect/index.vue
*/
<template>
<div>
<el-select v-model="form.materialType" :disabled="disabledVal">
<el-option
v-for="(item,i) in materialTypeOptions"
:key="i"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</template>
<script>
export default {
componentName: '物料类型',
name: 'ExtResourceTypeSelect',
components: {},
props: {
form: {},
itemObj: {
type: Object,
default: null
}
},
data() {
return {
materialTypeOptions: [],
isFirst: true,
disabledVal: false
}
},
computed: {},
watch: {
'form.extWorkCenterId'(val) {
if (val) {
this.$set(this.form, 'materialType', this.form.materialTypeId || '')
if (!this.isFirst) {
this.$set(this.form, 'materialType', '')
}
this.getMaterialType(val)
}
},
itemObj: {
immediate: true,
deep: true,
handler(v) {
if (v.component.hasOwnProperty('disabled')) {
this.disabledVal = v.component.disabled
}
}
}
},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
},
methods: {
getMaterialType(val) {
this.isFirst = false
const params = {
searchItems: {
items: [{ 'fieldName': 'sourceId', operator: 'EQ', value: val }],
operator: 'AND'
},
openProps: [{ 'name': 'target' }]
}
this.$api.searchApi('ExtCenterResourceTypeLink', params).then(res => {
const materialTypeOptions = res.items.content.map(row => {
return {
value: row.target.id,
label: row.target.typeName
}
})
this.materialTypeOptions = materialTypeOptions
})
}
}
}
</script>
<style lang='scss' scoped>
</style>
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
*/ */
<template> <template>
<div class="procurement-Warehousing-import"> <div class="procurement-Warehousing-import">
<dee-dialog <el-dialog
:dialog-visible="dialogVisible" :visible.sync="dialogVisible"
title="导入" title="导入"
width="40%" width="40%"
close-on-click-modal
show-close
> >
<el-form ref="fileForm" label-width="100px"> <el-form ref="fileForm" label-width="100px">
<el-form-item label="选择文件"> <el-form-item label="选择文件">
...@@ -38,7 +40,7 @@ ...@@ -38,7 +40,7 @@
@click="handleImportExcel" @click="handleImportExcel"
>确定导入</el-button> >确定导入</el-button>
</div> </div>
</dee-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -123,13 +125,14 @@ export default { ...@@ -123,13 +125,14 @@ export default {
this.$api.apiUploadFile(`/InStorageRequestItem/importByExcel?id=${id}`, formData).then(res => { // 调用接口 this.$api.apiUploadFile(`/InStorageRequestItem/importByExcel?id=${id}`, formData).then(res => { // 调用接口
this.uploading = false this.uploading = false
if (res.code === '0') { if (res.code === '0') {
this.$message.success(res.message) this.$utils.showMessageSuccess(res.message)
this.close() this.close()
} else { } else {
this.$message.error(res.message) this.$utils.showMessageError(res.message)
} }
}).catch(err => { }).catch(err => {
this.$message.error(err) // this.$utils.showMessageError(err)
console.log('err', err)
}) })
} }
} }
...@@ -138,7 +141,7 @@ export default { ...@@ -138,7 +141,7 @@ export default {
<style lang='scss'> <style lang='scss'>
.procurement-Warehousing-import { .procurement-Warehousing-import {
.dialog-footer{ .dialog-footer{
float: right; margin-right: 25px;
} }
} }
</style> </style>
...@@ -442,13 +442,11 @@ export default { ...@@ -442,13 +442,11 @@ export default {
}, },
methods: { methods: {
back() { back() {
setTimeout(() => { this.$store.dispatch('tagsView/delView', this.$route)
this.$store.dispatch('tagsView/delView', this.$route) this.$router.replace({
this.$router.replace({ path: '/page/86a5fa19-e245-4732-aff6-c48b18e2b5c7',
path: '/page/86a5fa19-e245-4732-aff6-c48b18e2b5c7', query: { title: '采购入库', menuRootAppId: '1626781924331' }
query: { title: '采购入库', menuRootAppId: '1626781924331' } })
})
}, 2000)
}, },
initData() { initData() {
this.getInventoryRequest() this.getInventoryRequest()
...@@ -547,7 +545,7 @@ export default { ...@@ -547,7 +545,7 @@ export default {
if (targetItem) { if (targetItem) {
targetItem.component.options = res.items.content.map(row => ({ value: row.id, label: row.typeName })) targetItem.component.options = res.items.content.map(row => ({ value: row.id, label: row.typeName }))
} }
this.form.materialTypeId = '' // this.form.materialTypeId = ''
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
......
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