Commit d509d9c1 authored by xioln's avatar xioln

供外出库修改

parent fff6b53a
...@@ -9,10 +9,16 @@ ...@@ -9,10 +9,16 @@
<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: 'ExtDxProcessMaterial', layKey: 'table' }"
@selectionChange="selectionChange" @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"> <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 type="primary" @click="submitEvent">确认</el-button>
<el-button @click="cancelEvent">取消</el-button> <el-button @click="cancelEvent">取消</el-button>
</div> </div>
...@@ -20,55 +26,68 @@ ...@@ -20,55 +26,68 @@
</template> </template>
<script> <script>
export default { export default {
// componentName: '供外出库添加明细弹窗', // componentName: '供外出库添加明细弹窗',
// name: 'AddOutStorageOfferDetailDialog', // name: 'AddOutStorageOfferDetailDialog',
components: {}, components: {},
props: { props: {
basicData: { basicData: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
data() { data() {
return { return {
selection: [], selection: [],
defaultData: {} defaultData: {},
form: {
},
reqAmount: 0,
formRules: {
reqAmount: [{ required: true, message: '申领数量' }]
},
submitData: []
} }
}, },
computed: {}, computed: {
// maxNum: {
// get() {
// // this.selection
// return 0
// }
// }
},
created() { created() {
// 初始化数据 // 初始化数据
console.log('basicData', this.basicData) console.log('basicData', this.basicData)
}, },
methods: { methods: {
sss(OKAffirmRequestParams) {
// OKAffirmRequestParams = {
// ...this.form,
// inStorageRequestItems: selectedData
// }
},
selectionChange(val) { selectionChange(val) {
this.selection = val this.selection = val
}, },
addEvent() {
this.submit()
},
submitEvent() { submitEvent() {
console.log('this.basicData', this.basicData) this.$emit('submitEvent', { formData: this.submitData })
},
submit() {
const selection = this.selection.filter(r => { const selection = this.selection.filter(r => {
if (!this.basicData.inStorageRequestItems) { if (!this.basicData.inStorageRequestItems) {
return true return true
} }
return !this.basicData.inStorageRequestItems.find(item => r.id === item.extMaterialId) return !this.basicData.inStorageRequestItems.find(item => r.id === item.extMaterialId)
}) })
console.log('selection', selection)
if (selection.length) { if (selection.length) {
const data = selection.map(r => { const data = selection.map(r => {
return { return {
'subTypeName': 'OutStorageOutItem', 'subTypeName': 'OutStorageOutItem',
'extMaterial': r, 'extMaterial': r,
'extMaterialId': r.id, 'extMaterialId': r.id,
'operator': 'add' 'operator': 'ADD',
'reqAmount': this.reqAmount
} }
}) })
this.$emit('submitEvent', { formData: data }) this.submitData = this.submitData.concat(data)
} }
}, },
cancelEvent() { cancelEvent() {
...@@ -78,11 +97,12 @@ export default { ...@@ -78,11 +97,12 @@ export default {
} }
</script> </script>
<style lang='scss'> <style lang='scss'>
.addOutStorageOfferDetail-dialog{ .addOutStorageOfferDetail-dialog {
.list-table{ .list-table {
height: 510px!important; height: 310px !important;
} }
.foot-btn-box{
.foot-btn-box {
display: flex; display: flex;
margin-top: 10px; margin-top: 10px;
justify-content: center; justify-content: center;
......
...@@ -51,23 +51,24 @@ export default { ...@@ -51,23 +51,24 @@ export default {
{ title: '牌号/型号/件号', key: 'extMaterial.modelNo', align: 'center', minWidth: '120' }, { title: '牌号/型号/件号', key: 'extMaterial.modelNo', align: 'center', minWidth: '120' },
{ title: '规格', key: 'extMaterial.spec', align: 'center' }, { title: '规格', key: 'extMaterial.spec', align: 'center' },
{ title: '单位名称', key: 'extMaterial.extUnit.unitName', align: 'center' }, { title: '单位名称', key: 'extMaterial.extUnit.unitName', align: 'center' },
{ { title: '申领数量', key: 'reqAmount', align: 'center' },
title: '申领数量', key: 'reqAmount', align: 'center', minWidth: '160', fixed: 'right', // {
component: { // title: '申领数量', key: 'reqAmount', align: 'center', minWidth: '160', fixed: 'right',
show: true, // component: {
render: (h, data, column, index) => { // show: true,
return (<el-input-number size='small' v-model={data.reqAmount} // render: (h, data, column, index) => {
on-change={(e) => { // return (<el-input-number size='small' v-model={data.reqAmount}
this.tableData = this.tableData.map(item => { // on-change={(e) => {
if (item.extMaterialId === data.extMaterialId) { // this.tableData = this.tableData.map(item => {
item.reqAmount = e // if (item.extMaterialId === data.extMaterialId) {
} // item.reqAmount = e
return item // }
}) // return item
}} />) // })
} // }} />)
} // }
}, // }
// },
{ title: '技术条件', key: 'extMaterial.techSpec', align: 'center' }, { title: '技术条件', key: 'extMaterial.techSpec', align: 'center' },
{ title: '供应状态', key: 'extMaterial.supplyStatus', align: 'center' }, { title: '供应状态', key: 'extMaterial.supplyStatus', align: 'center' },
{ title: '物料类型', key: 'extMaterial.resType2.typeName', align: 'center' }, { title: '物料类型', key: 'extMaterial.resType2.typeName', align: 'center' },
...@@ -75,7 +76,7 @@ export default { ...@@ -75,7 +76,7 @@ export default {
], ],
tableData: [], tableData: [],
tools: [{ tools: [{
name: '添加入库明细', name: '添加出库物料',
icon: '/icons/c-add.png', icon: '/icons/c-add.png',
handler: { handler: {
click: () => { click: () => {
......
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