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