Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
d6a3ff0abe
@ -146,4 +146,6 @@ public class ProcessBomDetailDO extends BaseDO {
|
||||
private String sortAttr;
|
||||
@TableField(exist = false)
|
||||
private String matType;
|
||||
@TableField(exist = false)
|
||||
private BigDecimal price;
|
||||
}
|
||||
|
@ -48,9 +48,10 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
|
||||
// .eq(ProcessBomDetailDO::getBomId,bomId);
|
||||
// return selectJoinList(ProcessBomDetailDO.class, query);
|
||||
// }
|
||||
@Select("SELECT p.*, IFNULL(SUM(s.storage_ok_qty), 0) AS storage_ok_qty " +
|
||||
@Select("SELECT p.*, IFNULL(SUM(s.storage_ok_qty), 0) AS storage_ok_qty,COALESCE(m.price, 0) as price " +
|
||||
"FROM pro_process_bom_detail p " +
|
||||
"LEFT JOIN v_storage_material_now s ON p.material_id = s.id " +
|
||||
"LEFT JOIN base_material m ON s.id=m.id "+
|
||||
"WHERE p.bom_id = #{bomId} and p.material_id is not null AND p.deleted IN (0, 1) " +
|
||||
"GROUP BY p.material_code")
|
||||
List<ProcessBomDetailDO> selectStandardListByBomId(@Param("bomId") Long bomId);
|
||||
|
@ -53,7 +53,7 @@ public interface StorageLogNowMapper extends BaseMapperX<StorageLogNowDO> {
|
||||
MPJLambdaWrapper<StorageLogNowDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
query.selectAll(StorageLogNowDO.class)
|
||||
.select("a.material_type as materialTypeId","a.unit as matUnitId")
|
||||
.select("a.material_type as materialTypeId","a.unit as matUnitId","COALESCE(a.price, 0) as price")
|
||||
|
||||
.leftJoin(MaterialDO.class,"a",MaterialDO::getId,StorageLogNowDO::getId)
|
||||
.orderByDesc(StorageLogNowDO::getId);
|
||||
|
@ -349,7 +349,6 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
||||
//去重查询,重复则不加
|
||||
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
|
||||
|
||||
System.out.println("生产任务单"+BdgzsomthingDO);
|
||||
if(selecteqint.size()>0){
|
||||
|
||||
}else{
|
||||
|
@ -35,7 +35,8 @@
|
||||
t.updater,
|
||||
t.deleted,
|
||||
g.material_type AS materialTypeId,
|
||||
g.unit AS matUnitId
|
||||
g.unit AS matUnitId,
|
||||
COALESCE(g.price, 0) AS price
|
||||
<!-- materialType unitId lyw加的,其他之前的人写的-->
|
||||
FROM
|
||||
v_storage_material_now t
|
||||
|
@ -144,7 +144,8 @@
|
||||
<el-col>
|
||||
<el-card class="hl-incard">
|
||||
<el-form ref="subFormRef" :model="formData.bomDetails" :rules="subFormRules" v-loading="formLoading" label-width="0" >
|
||||
<el-table :row-class-name="tableRowClassName" :data="formData.bomDetails" >
|
||||
<el-table :row-class-name="tableRowClassName" :data="formData.bomDetails" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="序号" type="index" min-width="50px" />
|
||||
<el-table-column label="变更次数" prop="bomEditStatus" max-width="60px" align="center">
|
||||
<template #default="{ row}">
|
||||
@ -206,7 +207,7 @@
|
||||
<el-table-column min-width="80px" align="center" fixed="right">
|
||||
<template #header><span class="hl-table_header">*</span>负责人</template>
|
||||
<template #default="{ row}">
|
||||
<el-select :disabled="getDisable(row.bomEditStatus)" clearable filterable v-model="row.owner" placeholder="请选择负责人" style="width: 170px">
|
||||
<el-select :disabled="getDisable(row.bomEditStatus)" clearable filterable v-model="row.owner" @change="change(row)" placeholder="请选择负责人" style="width: 170px">
|
||||
<el-option
|
||||
v-for="item in ownerList"
|
||||
:key="item.index"
|
||||
@ -267,7 +268,7 @@
|
||||
</el-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { inject } from 'vue'
|
||||
import {inject, ref} from 'vue'
|
||||
import { Search, Plus } from '@element-plus/icons-vue'
|
||||
import { getIntDictOptions, getStrDictOptions, getDictLabel, DICT_TYPE } from '@/utils/dict'
|
||||
import { betweenDay, formatDate, dateFormatter } from '@/utils/formatTime'
|
||||
@ -283,7 +284,7 @@ const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { query } = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const chkboxEnable = ref(0)
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formRef = ref() // 表单
|
||||
const subFormRef = ref() //子表单 Ref
|
||||
@ -337,6 +338,41 @@ const heliBomStatusOptions = ref<bomEditStatusEnum[]>([
|
||||
{ value: 3, label: '增补' },
|
||||
{ value: 4, label: '修改' },
|
||||
]);
|
||||
const change =(row:any)=>{
|
||||
var bomDetails = formData.value.bomDetails;
|
||||
if (row.chkboxEnable==1){
|
||||
for (let i = 0; i < bomDetails.length; i++) {
|
||||
if (bomDetails[i].chkboxEnable==1&&bomDetails[i].bomEditStatus!=1){
|
||||
bomDetails[i].owner=row.owner
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const handleSelectionChange = (row: any) => {
|
||||
var bomDetails = formData.value.bomDetails;
|
||||
if (row.length==0) {
|
||||
for (let i = 0; i < bomDetails.length; i++) {
|
||||
bomDetails[i].chkboxEnable=0
|
||||
}
|
||||
}else if (row.length==formData.value.bomDetails.length) {
|
||||
for (let i = 0; i < bomDetails.length; i++) {
|
||||
bomDetails[i].chkboxEnable=1
|
||||
}
|
||||
}else {
|
||||
for (let i = 0; i < bomDetails.length; i++) {
|
||||
for (let j = 0; j < row.length; j++) {
|
||||
if (row[j].id==bomDetails[i].id){
|
||||
bomDetails[i].chkboxEnable=1
|
||||
break
|
||||
}else {
|
||||
bomDetails[i].chkboxEnable=0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const submitForm = async (operate) => {
|
||||
// 校验表单
|
||||
await subFormRef.value.validate()
|
||||
@ -426,6 +462,7 @@ onMounted(async () => {
|
||||
formData.value.bomDetails.forEach((item) => {
|
||||
item.amount = formData.value.projectSubNum * item.amount;
|
||||
item.typeName = item.type == 1 ? '是' : '否'
|
||||
item.chkboxEnable=0
|
||||
if(item.owner){
|
||||
item.owner = Number(item.owner)
|
||||
}
|
||||
|
@ -235,6 +235,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="库存单价" min-width="120" align="center" />
|
||||
<el-table-column prop="lotNo" min-width="120" label="批次号" align="center" v-if="false" />
|
||||
<el-table-column prop="projectSubName" label="子项目名称" align="center" min-width="180">
|
||||
|
||||
@ -508,6 +509,7 @@ const openProjectForm = (scope) => {
|
||||
|
||||
|
||||
const getList = async (arrMat) => {
|
||||
console.log(JSON.stringify(arrMat))
|
||||
arrMat.forEach((row) => {
|
||||
if (
|
||||
formData.value.matItemDOList.filter(
|
||||
|
@ -223,6 +223,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="库存单价" min-width="120" align="center" />
|
||||
<el-table-column prop="lotNo" min-width="120" label="批次号" align="center" v-if="false" />
|
||||
<el-table-column prop="projectSubName" label="子项目名称" align="center" min-width="180">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user