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 @@
*/
<template>
<div class="procurement-Warehousing-import">
<dee-dialog
:dialog-visible="dialogVisible"
<el-dialog
:visible.sync="dialogVisible"
title="导入"
width="40%"
close-on-click-modal
show-close
>
<el-form ref="fileForm" label-width="100px">
<el-form-item label="选择文件">
......@@ -38,7 +40,7 @@
@click="handleImportExcel"
>确定导入</el-button>
</div>
</dee-dialog>
</el-dialog>
</div>
</template>
<script>
......@@ -123,13 +125,14 @@ export default {
this.$api.apiUploadFile(`/InStorageRequestItem/importByExcel?id=${id}`, formData).then(res => { // 调用接口
this.uploading = false
if (res.code === '0') {
this.$message.success(res.message)
this.$utils.showMessageSuccess(res.message)
this.close()
} else {
this.$message.error(res.message)
this.$utils.showMessageError(res.message)
}
}).catch(err => {
this.$message.error(err)
// this.$utils.showMessageError(err)
console.log('err', err)
})
}
}
......@@ -138,7 +141,7 @@ export default {
<style lang='scss'>
.procurement-Warehousing-import {
.dialog-footer{
float: right;
margin-right: 25px;
}
}
</style>
......@@ -6,12 +6,7 @@
*/
<template>
<div class="storageDetails-create">
<dee-dialog
:dialog-visible="dialogVisible"
title="采购入库申请创建"
width="90%"
@handleClose="handleClose"
>
<dee-dialog :dialog-visible="dialogVisible" title="采购入库申请创建" width="90%" @handleClose="handleClose">
<dee-form
ref="form"
:form="form"
......@@ -19,11 +14,12 @@
:rules="rules"
label-width="200px"
form-btn-position="center"
:form-buttons="formButtons"
@on-submit="save"
@on-cancel="handleClose"
>
<section>
<el-button :disabled="disabled" type="primary" size="medium" @click="save">确定</el-button>
<el-button :disabled="disabled" size="medium" @click="handleClose">取消</el-button>
</section>
<!-- <el-button ref="saveButton" :disabled="disabled" :loading="saveLoading" type="primary" size="medium" @click.native="()=>{save()}">确定</el-button>
<el-button :disabled="disabled" size="medium" @click="handleClose">取消</el-button> -->
</dee-form>
</dee-dialog>
</div>
......@@ -45,15 +41,30 @@ export default {
return {
dialogVisible: false,
disabled: false,
saveLoading: false,
header: {},
billType: '',
form: { },
form: {},
formFileds: [
{
split: 3,
data: []
}
],
formButtons: [
{
text: '提交',
type: 'submit',
component: {
type: 'primary',
loading: false
}
},
{
text: '取消',
type: 'cancel'
}
],
material: [],
suppliers: [],
// 表单校验
......@@ -236,6 +247,7 @@ export default {
},
methods: {
handleOpen(type, basicData, row) {
console.log('rwo', row)
this.basicData = basicData
this.form = { 'reqAmount': 1 }
this.dialogVisible = true
......@@ -248,10 +260,10 @@ export default {
this.$set(this.form, 'operator', 'ADD')
delete row.id
this.form = row
this.$set(this.form, 'supplier', row.extDxSipplier.supplierFullName || '')
this.$set(this.form, 'supplier', row.extDxSipplierId)
this.$set(this.form, 'withProductMaterial', Array.isArray(row.withProductMaterial) ? row.withProductMaterial : row.withProductMaterial.split(';'))
this.resetMaterial(row.extMaterial.resCode)
this.changeMaterial(row.extMaterial.resCode)
this.resetMaterial(row.extMaterial ? row.extMaterial.resCode : '')
this.changeMaterial(row.extMaterial ? row.extMaterial.resCode : '')
this.$set(this.form, 'resCode', '')
this.$set(this.form, 'resName', '')
this.$set(this.form, 'reqUnit', '')
......@@ -284,8 +296,8 @@ export default {
const v = this.basicData
if (
v.billType === 'AirEquipment' &&
(['标准件', '金属材料', '非金属材料'].includes(v.materialTypeName.label)) &&
this.formFileds[0].data.find(item => item.title !== '所属设备')
(['标准件', '金属材料', '非金属材料'].includes(v.materialTypeName.label)) &&
this.formFileds[0].data.find(item => item.title !== '所属设备')
) {
this.formFileds[0].data.unshift({
title: '所属设备',
......@@ -456,7 +468,7 @@ export default {
title: '供应商',
key: 'supplier',
component: {
name: 'el-input',
name: 'el-select',
disabled: true,
placeholder: '请输入供应商'
},
......@@ -751,6 +763,7 @@ export default {
component: {
clearable: true,
name: 'el-input',
disabled: childrenAddOrEdit,
placeholder: '请输入架次'
}
},
......@@ -766,7 +779,6 @@ export default {
},
handler: {
change: (v) => {
console.log('123', v)
this.changeComputed()
}
}
......@@ -775,7 +787,7 @@ export default {
title: '供应商',
key: 'supplier',
component: {
name: 'el-input',
name: 'el-select',
disabled: true,
placeholder: '请输入供应商'
},
......@@ -1130,6 +1142,7 @@ export default {
component: {
clearable: true,
name: 'el-input',
disabled: childrenAddOrEdit,
placeholder: '请输入架次'
}
},
......@@ -1150,7 +1163,7 @@ export default {
title: '供应商',
key: 'supplier',
component: {
name: 'el-input',
name: 'el-select',
disabled: true,
placeholder: '请输入供应商'
},
......@@ -1396,6 +1409,8 @@ export default {
this.defaultAirModel()
// 设置随产品资料
this.resetProductFiles()
// 设置供应商
this.getExtDxSipplier()
},
// 设置物料类型下拉
async resetMaterial(query) {
......@@ -1662,7 +1677,7 @@ export default {
)
.then((res) => {
this.form.storageZone =
res.items && res.items.content.length ? res.items.content[0].id : ''
res.items && res.items.content.length ? res.items.content[0].id : ''
const STORAGE = this.formFileds[0].data.find(
(item) => item.key === 'storageZone'
)
......@@ -1692,6 +1707,17 @@ export default {
this.extUnitId = SELECT_MATERIAL.extUnitId || ''
}
},
// 供应商ExtDxSipplier/find/recursion
getExtDxSipplier() {
const param = {}
post('ExtDxSipplier/find/recursion', param).then(res => {
this.formFileds[0].data.forEach(item => {
item.key === 'supplier' && (item.component.options = res.items.content.map(row => { return { value: row.id, label: `${row.supplierCode}-${row.supplierName}` } }))
})
}).catch((err) => {
console.log(err)
})
},
// 设置随产品资料
resetProductFiles(value) {
const PRODUCT = this.formFileds[0].data.find(
......@@ -1794,9 +1820,10 @@ export default {
}
},
save() {
this.$set(this.formButtons[0].component, 'loading', true)
this.$refs.form.validate((isok) => {
console.log('validate', this.form)
if (isok) {
this.handleClose()
// 校验通过
const newTableData = {
...this.form,
......@@ -1850,60 +1877,60 @@ export default {
'MaterialResCode': this.form.resCode
}
this.$emit('addTableData', newTableData)
this.handleClose()
}
this.$set(this.formButtons[0].component, 'loading', false)
})
// post(
// '/InStorageRequestItem/recursion',
// {
// 'operator': 'ADD',
// 'subTypeName': 'InStoragePurchaseItem',
// 'extMaterialId': this.extMaterialId,
// 'extMaterialIdType': 'ExtDxProcessMaterial',
// 'purchaseUnitId': this.extUnitId,
// 'purchaseUnitIdType': 'ExtUnit',
// 'lotNo': this.form.lotNo,
// 'airModel': this.form.airModel,
// 'sorties': this.form.sorties,
// 'reqAmount': this.form.reqAmount,
// 'extDxSipplierId': this.basicData.extDxSipplierId,
// 'extDxSipplierIdType': 'ExtDxSipplier',
// 'manufacturer': this.form.manufacturer,
// 'arrivalDate': this.form.arrivalDate ? this.form.arrivalDate : null,
// 'producedTime': this.form.producedTime ? this.form.producedTime + ' 00:00:00' : null,
// 'storageCondition': this.form.storageCondition,
// 'withProductMaterial': this.form.withProductMaterial ? this.form.withProductMaterial.join(';') : '',
// 'urgency': this.form.urgency,
// 'arrivedDrawNo': this.form.arrivedDrawNo,
// 'arrivalVer': this.form.arrivalVer,
// 'stockUnitPrice': this.form.stockUnitPrice,
// 'taxRate': this.form.taxRate,
// 'stockPrice': this.form.stockPrice,
// 'taxUnitPrice': this.form.taxUnitPrice,
// 'taxPrice': this.form.taxPrice,
// 'storageZoneId': this.form.storageZone,
// 'storageZoneIdType': 'ExtDxProductWorkCenter',
// 'inventoryReqId': this.basicData.id,
// 'inventoryReqIdType': 'InventoryRequest',
// 'contractNo': this.form.contractNo,
// 'isRoot': true,
// 'subEquipment': this.form.subEquipment,
// 'productDwawVer': this.form.productDwawVer,
// 'atpName': this.form.atpName,
// 'atpNo': this.form.atpNo,
// 'softConfPieceNo': this.form.softConfPieceNo,
// 'elecHardwareConfPieceNo': this.form.elecHardwareConfPieceNo,
// 'approvalCert': this.form.approvalCert,
// 'isNewlyProduct': this.form.isNewlyProduct
// }
// ).then((res) => {
// this.$utils.showMessageSuccess('保存成功')
// this.handleClose()
// })
// .catch((err) => {
// console.log(err)
// })
// post(
// '/InStorageRequestItem/recursion',
// {
// 'operator': 'ADD',
// 'subTypeName': 'InStoragePurchaseItem',
// 'extMaterialId': this.extMaterialId,
// 'extMaterialIdType': 'ExtDxProcessMaterial',
// 'purchaseUnitId': this.extUnitId,
// 'purchaseUnitIdType': 'ExtUnit',
// 'lotNo': this.form.lotNo,
// 'airModel': this.form.airModel,
// 'sorties': this.form.sorties,
// 'reqAmount': this.form.reqAmount,
// 'extDxSipplierId': this.basicData.extDxSipplierId,
// 'extDxSipplierIdType': 'ExtDxSipplier',
// 'manufacturer': this.form.manufacturer,
// 'arrivalDate': this.form.arrivalDate ? this.form.arrivalDate : null,
// 'producedTime': this.form.producedTime ? this.form.producedTime + ' 00:00:00' : null,
// 'storageCondition': this.form.storageCondition,
// 'withProductMaterial': this.form.withProductMaterial ? this.form.withProductMaterial.join(';') : '',
// 'urgency': this.form.urgency,
// 'arrivedDrawNo': this.form.arrivedDrawNo,
// 'arrivalVer': this.form.arrivalVer,
// 'stockUnitPrice': this.form.stockUnitPrice,
// 'taxRate': this.form.taxRate,
// 'stockPrice': this.form.stockPrice,
// 'taxUnitPrice': this.form.taxUnitPrice,
// 'taxPrice': this.form.taxPrice,
// 'storageZoneId': this.form.storageZone,
// 'storageZoneIdType': 'ExtDxProductWorkCenter',
// 'inventoryReqId': this.basicData.id,
// 'inventoryReqIdType': 'InventoryRequest',
// 'contractNo': this.form.contractNo,
// 'isRoot': true,
// 'subEquipment': this.form.subEquipment,
// 'productDwawVer': this.form.productDwawVer,
// 'atpName': this.form.atpName,
// 'atpNo': this.form.atpNo,
// 'softConfPieceNo': this.form.softConfPieceNo,
// 'elecHardwareConfPieceNo': this.form.elecHardwareConfPieceNo,
// 'approvalCert': this.form.approvalCert,
// 'isNewlyProduct': this.form.isNewlyProduct
// }
// ).then((res) => {
// this.$utils.showMessageSuccess('保存成功')
// this.handleClose()
// })
// .catch((err) => {
// console.log(err)
// })
},
generateUUID() {
let d = new Date().getTime()
......
......@@ -442,13 +442,11 @@ export default {
},
methods: {
back() {
setTimeout(() => {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.replace({
path: '/page/86a5fa19-e245-4732-aff6-c48b18e2b5c7',
query: { title: '采购入库', menuRootAppId: '1626781924331' }
})
}, 2000)
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.replace({
path: '/page/86a5fa19-e245-4732-aff6-c48b18e2b5c7',
query: { title: '采购入库', menuRootAppId: '1626781924331' }
})
},
initData() {
this.getInventoryRequest()
......@@ -547,7 +545,7 @@ export default {
if (targetItem) {
targetItem.component.options = res.items.content.map(row => ({ value: row.id, label: row.typeName }))
}
this.form.materialTypeId = ''
// this.form.materialTypeId = ''
}).catch((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