Commit eabd4aa5 authored by jingnan's avatar jingnan 👀

Merge branch 'dev' of http://94.191.100.41/tfmom/tf-mom-web into dev

parents 42d37ea3 5ba96176
......@@ -64,24 +64,24 @@ export default {
}, width: 100 },
{
title: '物料A', children: [
{ title: '物料', key: 'source.resType2.typeName', align: 'center' },
{ title: '物料编码', key: 'source.resCode', align: 'center' },
{ title: '物料名称', key: 'source.resName', align: 'center' },
{ title: '牌号/型号/件号', width: '120', key: 'source.modelNo', align: 'center' },
{ title: '技术条件', key: 'source.techSpec', align: 'center' },
{ title: '规格', key: 'source.spec', align: 'center' },
{ title: '供应状态', key: 'source.supplyStatus', align: 'center' },
{ title: '物料', key: 'source.resType2.typeName', align: 'center' }
{ title: '供应状态', key: 'source.supplyStatus', align: 'center' }
]
},
{
title: '物料B', children: [
{ title: '物料', key: 'target.resType2.typeName', align: 'center' },
{ title: '物料编码', key: 'target.resCode', align: 'center' },
{ title: '物料名称', key: 'target.resName', align: 'center' },
{ title: '牌号/型号/件号', width: '120', key: 'target.modelNo', align: 'center' },
{ title: '技术条件', key: 'target.techSpec', align: 'center' },
{ title: '规格', key: 'target.spec', align: 'center' },
{ title: '供应状态', key: 'target.supplyStatus', align: 'center' },
{ title: '物料', key: 'target.resType2.typeName', align: 'center' }
{ title: '供应状态', key: 'target.supplyStatus', align: 'center' }
]
}],
tableData: [],
......
......@@ -5,90 +5,91 @@
* @FilePath: applications/dee-mes/src/privateComponents/components/OutStorageOfferDetail/components/addOutStorageOfferDetailDialog.vue
*/
<template>
<div class="addOutStorageOfferDetail-dialog">
<div class="addOutStorageUseDetailDialog">
<dee-as-com
ref="OfferTable"
class="list-table"
:lay-config="{ typeName: 'ExtDxProcessMaterial', layKey: 'table' }"
@selectionChange="selectionChange"
:lay-config="{ typeName: 'OutStorageMatchItem', layKey: 'offerTableInfo'}"
:basic-data="basicData"
@row-click="handleRowClick"
/>
<el-form :model="form" :rules="formRules" style="margin-top: 50px;">
<el-form-item label="申领数量">
<el-input-number v-model="reqAmount" :min="0" />
<el-form ref="applyForm" :rules="rules" :model="applyForm" class="applyForm">
<el-form-item label="申领数量" prop="reqAmount" label-width="100px">
<el-input-number v-model="applyForm.reqAmount" placeholder="申领数量" :min="0" size="small" />
</el-form-item>
<el-form-item class="foot-btn-box">
<el-button type="primary" @click="submitEvent(true)">添加</el-button>
<el-button type="primary" @click="submitEvent(false)">确认</el-button>
<el-button @click.native="cancelEvent">取消</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="foot-btn-box">
<el-button type="primary" @click="addEvent">添加</el-button>
<el-button type="primary" @click="submitEvent">确认</el-button>
<el-button @click="cancelEvent">取消</el-button>
</div>
</div>
</template>
<script>
export default {
// componentName: '供外出库添加明细弹窗',
// name: 'AddOutStorageOfferDetailDialog',
componentName: '领用出库添加明细',
name: 'AddOutStorageUseDetailDialog',
components: {},
props: {
basicData: {
type: Object,
default: () => { }
default: () => {}
},
parentTableData: {
type: Object,
default: () => {}
}
},
data() {
return {
selection: [],
selection: null,
defaultData: {},
form: {
},
reqAmount: 0,
formRules: {
reqAmount: [{ required: true, message: '申领数量' }]
},
submitData: []
applyForm: {},
rules: {
reqAmount: [
{ required: true, message: '请填写申领数量', trigger: 'blur' }
]
}
}
},
computed: {
// maxNum: {
// get() {
// // this.selection
// return 0
// }
// }
computed: {},
watch: {
'value': {
immediate: true,
handler(val) {
console.log('val', val)
}
}
},
created() {
// 初始化数据
console.log('basicData', this.basicData)
},
methods: {
selectionChange(val) {
this.selection = val
},
addEvent() {
this.submit()
handleRowClick(val) {
this.selection = val.row
},
submitEvent() {
this.$emit('submitEvent', { formData: this.submitData })
},
submit() {
const selection = this.selection.filter(r => {
if (!this.basicData.inStorageRequestItems) {
return true
submitEvent(addContinue) {
this.$refs['applyForm'].validate((valid) => {
if (valid && this.selection) {
if (this.applyForm.reqAmount > this.selection.unableAmount) return this.$utils.showMessageWarning('申领数量不能大于当前选中物料的可用数量!')
const data = {
'subTypeName': 'OutStorageUseItem',
'extMaterial': this.selection.extMaterial,
'extMaterialId': this.selection.extMaterialId,
// 'extSupportingItemId': this.selection.id,
// 'extSupportingItemIdType': this.selection.subTypeName,
'takeAmount': this.selection.takeAmount,
'unableAmount': this.selection.unableAmount,
'reqAmount': this.applyForm.reqAmount
}
return !this.basicData.inStorageRequestItems.find(item => r.id === item.extMaterialId)
})
if (selection.length) {
const data = selection.map(r => {
return {
'subTypeName': 'OutStorageOutItem',
'extMaterial': r,
'extMaterialId': r.id,
'operator': 'ADD',
'reqAmount': this.reqAmount
this.$emit('submitEvent', { formData: data, addContinue })
} else {
this.$utils.showMessageWarning('至少选择一条物料并且申领数量必填!')
return false
}
})
this.submitData = this.submitData.concat(data)
}
},
cancelEvent() {
this.$emit('cancel')
......@@ -97,12 +98,14 @@ export default {
}
</script>
<style lang='scss'>
.addOutStorageOfferDetail-dialog {
.list-table {
height: 310px !important;
.addOutStorageUseDetailDialog{
.list-table{
height: 510px!important;
}
.foot-btn-box {
.applyForm{
margin-top: 30px;
}
.foot-btn-box{
display: flex;
margin-top: 10px;
justify-content: center;
......
/**
* @Description: 供外出库添加明细弹框
* @author xioln
* @date 2023-08-09
* @FilePath: applications/dee-mes/src/privateComponents/components/OutStorageOfferDetail/components/addOutStorageOfferDetailDialog.vue
*/
<template>
<div class="addOutStorageOfferDetail-dialog">
<dee-as-com
ref="OfferTable"
class="list-table"
:lay-config="{ typeName: 'ExtDxProcessMaterial', layKey: 'table' }"
@selectionChange="selectionChange"
/>
<el-form :model="form" :rules="formRules" style="margin-top: 50px;">
<el-form-item label="申领数量">
<el-input-number v-model="reqAmount" :min="0" />
</el-form-item>
</el-form>
<div slot="footer" class="foot-btn-box">
<el-button type="primary" @click="addEvent">添加</el-button>
<el-button type="primary" @click="submitEvent">确认</el-button>
<el-button @click="cancelEvent">取消</el-button>
</div>
</div>
</template>
<script>
export default {
// componentName: '供外出库添加明细弹窗',
// name: 'AddOutStorageOfferDetailDialog',
components: {},
props: {
basicData: {
type: Object,
default: () => { }
}
},
data() {
return {
selection: [],
defaultData: {},
form: {
},
reqAmount: 0,
formRules: {
reqAmount: [{ required: true, message: '申领数量' }]
},
submitData: []
}
},
computed: {
// maxNum: {
// get() {
// // this.selection
// return 0
// }
// }
},
created() {
// 初始化数据
},
methods: {
selectionChange(val) {
this.selection = val
},
addEvent() {
this.submit()
},
submitEvent() {
this.submit()
this.$emit('submitEvent', { formData: this.submitData })
},
submit() {
var arr = []
this.selection.forEach(sel => {
if (!this.submitData) {
arr.push(sel)
}
this.submitData.forEach(item => {
if (sel.id === item.extMaterialId) {
item.reqAmount = this.reqAmount
} else {
arr.push(sel)
}
})
})
console.log('arr', arr)
if (arr.length) {
const data = arr.map(r => {
return {
'subTypeName': 'OutStorageOutItem',
'extMaterial': r,
'extMaterialId': r.id,
'operator': 'ADD',
'reqAmount': this.reqAmount
}
})
this.submitData = [...data, ...this.submitData]
console.log('this.submitData', this.submitData)
this.$refs.OfferTable.$refs.asCom.getData()
this.$utils.showMessageSuccess('添加成功!')
}
},
cancelEvent() {
this.$emit('cancel')
}
}
}
</script>
<style lang='scss'>
.addOutStorageOfferDetail-dialog {
.list-table {
height: 310px !important;
}
.foot-btn-box {
display: flex;
margin-top: 10px;
justify-content: center;
align-content: center;
}
}
</style>
......@@ -84,6 +84,9 @@ export default {
},
// 手动占用
occupy() {
if (this.infoSelection.length === 0) {
return this.$utils.showMessageWarning('请选择占用数据!')
}
const param = this.infoSelection.map(item => {
if (item.allocatedAmount === 0 || !item.hasOwnProperty('allocatedAmount')) {
return this.$utils.showMessageWarning('请输入分配数量!')
......@@ -94,7 +97,6 @@ export default {
}
}
})
console.log('param', param)
if (!param.includes(undefined)) {
post('InStorageRequestItem/adjust/reTake?itemId=' + this.selectDatas[0].id, param).then(res => {
this.$utils.showMessageSuccess('占用成功!')
......
......@@ -21,6 +21,13 @@
<dee-dialog width="70%" title="调整占用" :visible.sync="aoDialogVisible" @on-cancel="aoCancel">
<OutStorageOfferAdjustOccupy ref="adjustOffer" :select-datas="selectTableData" :form="form" @submitEvent="addData" />
</dee-dialog>
<dee-dialog width="70%" title="查看占用" :visible.sync="viewVisible" @on-cancel="viewCancel">
<dee-as-com
ref="viewTable"
:basic-data="rowData"
:lay-config="{ typeName: 'JobResponseOutStorageOut', layKey: 'table' }"
/>
</dee-dialog>
</div>
</template>
<script>
......@@ -46,6 +53,24 @@ export default {
return {
dialogVisible: false,
tableColumns: [
{ title: '操作', key: 'operate', align: 'center', width: '100',
component: {
show: true,
name: 'EditTableRow',
props: {
btns: [
{
operation: '查看占用详情',
icon: '/icons/c-scan.png',
handleClick: (row, index) => {
this.rowData = row
this.viewVisible = true
}
}
]
}
}
},
{ title: '物料编码', key: 'extMaterial.resCode', align: 'center' },
{ title: '物料名称', key: 'extMaterial.resName', align: 'center' },
{ title: '牌号/型号/件号', key: 'extMaterial.modelNo', align: 'center', minWidth: '120' },
......@@ -75,6 +100,7 @@ export default {
{ title: '占用数量', key: 'allocatedAmount', align: 'center' }
],
tableData: [],
rowData: null,
tools: [{
name: '添加出库物料',
icon: '/icons/c-add.png',
......@@ -140,7 +166,8 @@ export default {
}],
param: {},
aoDialogVisible: false,
selectTableData: []
selectTableData: [],
viewVisible: false
}
},
computed: {
......@@ -163,10 +190,16 @@ export default {
}
},
methods: {
addData(data) {
console.log('data', data)
this.tableData = data.formData
addData({ formData, addContinue }) {
const index = this.tableData.find(item => item.extMaterialId === formData.extMaterialId)
if (index) {
this.tableData[index] = formData
} else {
this.tableData.push(formData)
}
if (!addContinue) {
this.dialogVisible = false
}
},
handleSelectionChange(v) {
this.selectTableData = v
......@@ -177,6 +210,9 @@ export default {
aoCancel() {
this.aoDialogVisible = false
},
viewCancel() {
this.viewVisible = false
},
occupy() {
const form = { ...this.form }
form.aircraftType = form.aircraftType.split('+')[1]
......
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