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"> <span class="crud-opts-right2">
<!--左侧插槽--> <!--左侧插槽-->
<slot name="left" /> <slot name="left" />
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
@click="insertMater"
>
添加物料
</el-button>
<el-button <el-button
slot="right" slot="right"
class="filter-item" class="filter-item"
@@ -292,6 +302,7 @@
controls-position="right" controls-position="right"
precision="3" precision="3"
:min="0" :min="0"
@change="changeQty"
/> />
</template> </template>
</el-table-column> </el-table-column>
@@ -316,6 +327,11 @@
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1" /> <ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1" />
<StructIvt :dialog-show.sync="ivtShow" @setMaterValue="tableChanged" /> <StructIvt :dialog-show.sync="ivtShow" @setMaterValue="tableChanged" />
<MaterDtl
:dialog-show.sync="materShow"
:is-single="false"
@setMaterValue="tableChanged2"
/>
</el-dialog> </el-dialog>
</template> </template>
<script> <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 ItemDialog from '@/views/wms/device_manage/repair/devicerepairplan/ItemDialog'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata' import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import StructIvt from '@/views/wms/device_manage/ios/embiout/StructIvt' import StructIvt from '@/views/wms/device_manage/ios/embiout/StructIvt'
import MaterDtl from '@/views/wms/pub/MaterDialog'
export default { export default {
name: 'ExecuteDialog', name: 'ExecuteDialog',
dicts: ['EM_DEVICE_WX_INVTYPE', 'IS_OR_NOT', 'EM_BI_OUT_TYPE', 'product_area'], dicts: ['EM_DEVICE_WX_INVTYPE', 'IS_OR_NOT', 'EM_BI_OUT_TYPE', 'product_area'],
components: { ItemDialog, StructIvt }, components: { ItemDialog, StructIvt, MaterDtl },
mixins: [crud()], mixins: [crud()],
props: { props: {
dialogShow: { dialogShow: {
@@ -350,12 +367,13 @@ export default {
bill_type: '', bill_type: '',
stor_id: '', stor_id: '',
workshop_id: '', workshop_id: '',
total_qty: '0', total_qty: 0,
tableDataDtl: [] tableDataDtl: []
}, },
storlist: [], storlist: [],
itemDialog: false, itemDialog: false,
ivtShow: false, ivtShow: false,
materShow: false,
dialogVisible: false dialogVisible: false
} }
}, },
@@ -483,6 +501,37 @@ export default {
} }
}) })
this.form2.detail_count = this.form2.tableDataDtl.length 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)
})
} }
} }
} }