rev:维修单备件出库新增个添加物料,从物料列表中选物料,

This commit is contained in:
2023-10-23 16:06:00 +08:00
parent 0fc2178dd9
commit 4e8c1c6a88

View File

@@ -255,6 +255,16 @@
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
@click="insertMater"
>
添加物料
</el-button>
<el-button
slot="right"
class="filter-item"
@@ -292,6 +302,7 @@
controls-position="right"
precision="3"
:min="0"
@change="changeQty"
/>
</template>
</el-table-column>
@@ -316,6 +327,11 @@
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1" />
<StructIvt :dialog-show.sync="ivtShow" @setMaterValue="tableChanged" />
<MaterDtl
:dialog-show.sync="materShow"
:is-single="false"
@setMaterValue="tableChanged2"
/>
</el-dialog>
</template>
<script>
@@ -325,11 +341,12 @@ import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/d
import ItemDialog from '@/views/wms/device_manage/repair/devicerepairplan/ItemDialog'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import StructIvt from '@/views/wms/device_manage/ios/embiout/StructIvt'
import MaterDtl from '@/views/wms/pub/MaterDialog'
export default {
name: 'ExecuteDialog',
dicts: ['EM_DEVICE_WX_INVTYPE', 'IS_OR_NOT', 'EM_BI_OUT_TYPE', 'product_area'],
components: { ItemDialog, StructIvt },
components: { ItemDialog, StructIvt, MaterDtl },
mixins: [crud()],
props: {
dialogShow: {
@@ -350,12 +367,13 @@ export default {
bill_type: '',
stor_id: '',
workshop_id: '',
total_qty: '0',
total_qty: 0,
tableDataDtl: []
},
storlist: [],
itemDialog: false,
ivtShow: false,
materShow: false,
dialogVisible: false
}
},
@@ -483,6 +501,37 @@ export default {
}
})
this.form2.detail_count = this.form2.tableDataDtl.length
},
insertMater(row) {
this.materShow = true
},
tableChanged2(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form2.tableDataDtl.forEach((row) => {
if (row.material_code === item.material_code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = 1
item.qty_unit_name = item.unit_name
item.qty_unit_id = item.base_unit_id
this.form2.total_qty = parseFloat(this.form2.total_qty) + parseFloat(item.plan_qty)
this.form2.tableDataDtl.splice(-1, 0, item)
}
})
this.form2.detail_count = this.form2.tableDataDtl.length
},
changeQty() {
this.form2.total_qty = 0
this.form2.tableDataDtl.forEach((item) => {
this.form2.total_qty = parseFloat(this.form2.total_qty) + parseFloat(item.plan_qty)
})
}
}
}