From 2bee81442387717d425ffde1dea3d2e9c4b7a00e Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 11 五月 2026 16:47:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro' into dev_NEW_pro
---
src/views/productionManagement/processRoute/processRouteItem/index.vue | 97 +++++++++++++++++++++++++++++++++++++++---------
1 files changed, 78 insertions(+), 19 deletions(-)
diff --git a/src/views/productionManagement/processRoute/processRouteItem/index.vue b/src/views/productionManagement/processRoute/processRouteItem/index.vue
index 44fef19..99d4ab1 100644
--- a/src/views/productionManagement/processRoute/processRouteItem/index.vue
+++ b/src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -38,6 +38,15 @@
<span class="info-value">{{ routeInfo.bomNo || '-' }}</span>
</div>
</div>
+ <div class="info-item"
+ v-if="routeInfo.quantity && routeInfo.quantity !== 0">
+ <div class="info-label-wrapper">
+ <span class="info-label">闇�姹傛暟閲�</span>
+ </div>
+ <div class="info-value-wrapper">
+ <span class="info-value">{{ routeInfo.quantity || '-' }}</span>
+ </div>
+ </div>
<div class="info-item full-width"
v-if="routeInfo.description">
<div class="info-label-wrapper">
@@ -59,7 +68,8 @@
style="margin-right: 10px;">
鍗$墖瑙嗗浘
</el-button>
- <el-button type="primary"
+ <el-button v-if="editable"
+ type="primary"
@click="handleAdd">鏂板</el-button>
</div>
</div>
@@ -101,6 +111,13 @@
<el-table-column label="鍗曚綅"
prop="unit"
width="100" />
+ <el-table-column label="璁¤垂绫诲瀷"
+ prop="type"
+ width="100">
+ <template #default="scope">
+ {{scope.row.type==0 ? "璁℃椂" : "璁′欢"}}
+ </template>
+ </el-table-column>
<el-table-column label="鏄惁璐ㄦ"
prop="isQuality"
width="100">
@@ -124,12 +141,12 @@
link
size="small"
@click="handleEdit(scope.row)"
- :disabled="scope.row.isComplete">缂栬緫</el-button>
+ :disabled="scope.row.isComplete || !editable">缂栬緫</el-button>
<el-button type="danger"
link
size="small"
@click="handleDelete(scope.row)"
- :disabled="scope.row.isComplete">鍒犻櫎</el-button>
+ :disabled="scope.row.isComplete || !editable">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -143,7 +160,8 @@
style="margin-right: 10px;">
琛ㄦ牸瑙嗗浘
</el-button>
- <el-button type="primary"
+ <el-button v-if="editable"
+ type="primary"
@click="handleAdd">鏂板</el-button>
</div>
</div>
@@ -170,12 +188,16 @@
{{ item.model }}
<!-- <span v-if="item.unit" class="product-unit">{{ item.unit }}</span> -->
</div>
+ <el-tag class="product-tag"
+ :type="item.type == 1 ? 'primary' : 'success'"
+ style="margin-left: 8px;">{{ item.type==0?'璁℃椂':'璁′欢' }}</el-tag>
<el-tag type="primary"
class="product-tag"
+ style="margin-left: 8px;"
v-if="item.isQuality">璐ㄦ</el-tag>
<el-tag type="primary"
class="product-tag"
- :style="item.isQuality?'margin-left:8px':''"
+ style="margin-left: 8px;"
v-if="item.isProduction">鐢熶骇</el-tag>
</div>
<div v-else
@@ -187,7 +209,7 @@
link
size="small"
@click="handleEdit(item)"
- :disabled="item.isComplete">缂栬緫</el-button>
+ :disabled="item.isComplete || !editable">缂栬緫</el-button>
<el-button type="info"
link
size="small"
@@ -196,7 +218,7 @@
link
size="small"
@click="handleDelete(item)"
- :disabled="item.isComplete">鍒犻櫎</el-button>
+ :disabled="item.isComplete || !editable">鍒犻櫎</el-button>
</div>
</div>
</div>
@@ -206,8 +228,8 @@
<div class="section-header"
style="margin-top: 20px;">
<div class="section-title">BOM 缁撴瀯</div>
- <!-- <div class="section-actions"
- v-if="pageType === 'order'">
+ <div class="section-actions"
+ v-if="pageType === 'order' && editable">
<el-button v-if="!bomDataValue.isEdit"
type="primary"
@click="bomDataValue.isEdit = true">
@@ -223,7 +245,7 @@
:loading="bomDataValue.loading">
淇濆瓨BOM
</el-button>
- </div> -->
+ </div>
</div>
<el-table :data="bomTableData"
border
@@ -293,6 +315,7 @@
:step="1"
controls-position="right"
style="width: 100%"
+ @change="handleUnitQuantityChange(row)"
:disabled="!bomDataValue.isEdit || bomDataValue.dataList.some(item => (item).tempId === row.tempId)" />
</el-form-item>
</template>
@@ -412,6 +435,13 @@
v-else>
<span>{{ form.unit }}</span>
</el-form-item>
+ <el-form-item label="璁¤垂绫诲瀷"
+ prop="type">
+ <el-radio-group v-model="form.type">
+ <el-radio :label="0">璁℃椂</el-radio>
+ <el-radio :label="1">璁′欢</el-radio>
+ </el-radio-group>
+ </el-form-item>
<el-form-item label="鏄惁璐ㄦ"
prop="isQuality">
<el-switch v-model="form.isQuality"
@@ -437,7 +467,6 @@
@confirm="handleProductSelect"
single />
<!-- 鍙傛暟鍒楄〃瀵硅瘽妗� -->
- <!-- :editable="!routeInfo.status" -->
<ProcessParamListDialog v-model="showParamListDialog"
:title="`${currentProcess ? (currentProcess.processName || currentProcess.technologyOperationName || currentProcess.operationName) : ''} - 鍙傛暟鍒楄〃`"
:route-id="routeId"
@@ -445,6 +474,7 @@
:process="currentProcess"
:page-type="pageType"
:param-list="paramList"
+ :editable="editable"
@getsyncProcessParamItem="getsyncProcessParamItem"
@refresh="refreshParamList" />
</div>
@@ -486,7 +516,7 @@
import {
queryList,
queryList2,
- addBomDetail,
+ add2,
} from "@/api/productionManagement/productStructure.js";
import { useRoute } from "vue-router";
@@ -499,6 +529,7 @@
const routeId = computed(() => route.query.id);
const orderId = computed(() => route.query.orderId);
const pageType = computed(() => route.query.type);
+ const editable = computed(() => route.query.editable !== "false");
const tableLoading = ref(false);
const tableData = ref([]);
@@ -516,6 +547,7 @@
model: "",
bomNo: "",
description: "",
+ quantity: 0,
});
const processOptions = ref([]);
@@ -544,6 +576,7 @@
model: "",
unit: "",
isQuality: false,
+ type: 0,
isProduction: false,
});
@@ -646,6 +679,7 @@
bomNo: route.query.bomNo || "",
bomId: route.query.bomId || "",
description: route.query.description || "",
+ quantity: route.query.quantity || 0,
status: !(route.query.status == 1 || route.query.status === "false"),
};
bomTableData.value[0].productName = routeInfo.value.productName;
@@ -672,6 +706,7 @@
model: row.model || "",
unit: row.unit || "",
isQuality: row.isQuality,
+ type: row.type || 0,
isProduction: row.isProduction,
};
dialogVisible.value = true;
@@ -743,6 +778,7 @@
operationName: getProcessName(form.value.technologyOperationId),
productModelId: form.value.productModelId,
isQuality: form.value.isQuality,
+ type: form.value.type,
isProduction: form.value.isProduction,
dragSort,
})
@@ -751,6 +787,7 @@
technologyOperationId: form.value.technologyOperationId,
productModelId: form.value.productModelId,
isQuality: form.value.isQuality,
+ type: form.value.type,
isProduction: form.value.isProduction,
dragSort,
});
@@ -778,6 +815,7 @@
operationName: getProcessName(form.value.technologyOperationId),
productModelId: form.value.productModelId,
isQuality: form.value.isQuality,
+ type: form.value.type,
isProduction: form.value.isProduction,
})
: addOrUpdateProcessRouteItem1({
@@ -786,6 +824,7 @@
productModelId: form.value.productModelId,
id: form.value.id,
isQuality: form.value.isQuality,
+ type: form.value.type,
isProduction: form.value.isProduction,
});
@@ -817,6 +856,7 @@
model: "",
unit: "",
isQuality: false,
+ type: 0,
isProduction: false,
};
formRef.value?.resetFields();
@@ -831,15 +871,19 @@
// 鏌ョ湅鍙傛暟鍒楄〃
const handleViewParams = row => {
currentProcess.value = row;
- const query = {
+ const param = {
+ productionOrderRoutingOperationId: row.id,
+ productionOrderId: orderId.value,
+ };
+ const param1 = {
technologyRoutingOperationId: row.id,
productionOrderId: orderId.value,
};
const apiPromise =
pageType.value === "order"
- ? findProcessParamListOrder(query)
- : getProcessParamList(query);
+ ? findProcessParamListOrder(param)
+ : getProcessParamList(param1);
apiPromise
.then(res => {
@@ -862,6 +906,7 @@
// 鍒濆鍖栨嫋鎷芥帓搴�
const initSortable = () => {
destroySortable();
+ if (!editable.value) return;
if (viewMode.value === "table") {
// 琛ㄦ牸瑙嗗浘鐨勬嫋鎷芥帓搴�
@@ -1048,6 +1093,7 @@
processOptions.value.forEach(item => {
if (item.id == value) {
form.value.isQuality = item.isQuality;
+ form.value.type = item.type || 0;
form.value.isProduction = item.isProduction;
}
});
@@ -1166,6 +1212,12 @@
});
};
+ const handleUnitQuantityChange = row => {
+ if (routeInfo.value.quantity && routeInfo.value.quantity !== 0) {
+ row.demandedQuantity = (row.unitQuantity || 0) * routeInfo.value.quantity;
+ }
+ };
+
const addchildItem = (item, tempId) => {
if (item.tempId === tempId) {
if (!item.children) {
@@ -1184,7 +1236,10 @@
"",
operationName: "",
unitQuantity: 1,
- demandedQuantity: 0,
+ demandedQuantity:
+ routeInfo.value.quantity && routeInfo.value.quantity !== 0
+ ? 1 * routeInfo.value.quantity
+ : 0,
children: [],
unit: "",
tempId: new Date().getTime(),
@@ -1220,7 +1275,10 @@
"",
operationName: "",
unitQuantity: 1,
- demandedQuantity: 0,
+ demandedQuantity:
+ routeInfo.value.quantity && routeInfo.value.quantity !== 0
+ ? 1 * routeInfo.value.quantity
+ : 0,
unit: "",
children: [],
tempId: new Date().getTime(),
@@ -1295,8 +1353,9 @@
const valid = validateAllBom();
if (valid) {
- addBomDetail({
- bomId: Number(routeInfo.value.bomId),
+ add2({
+ // bomId: Number(routeInfo.value.bomId),
+ productionOrderBomId: Number(routeInfo.value.bomId) || null,
children: buildSubmitTree(bomDataValue.value.dataList || []),
})
.then(() => {
--
Gitblit v1.9.3