|
@@ -234,6 +234,15 @@
|
|
|
>
|
|
|
一键包装签票
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ v-show="editStatus"
|
|
|
+ :disabled="selections.length === 0"
|
|
|
+ type="primary"
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleShowMultiDialogProcesses"
|
|
|
+ >
|
|
|
+ 批量选择工序
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
@@ -241,9 +250,16 @@
|
|
|
v-loading="loading"
|
|
|
:data="form.details"
|
|
|
size="small"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
border
|
|
|
height="100%"
|
|
|
>
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ :selectable="checkSelectable"
|
|
|
+ width="50"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
<el-table-column
|
|
|
label="行号"
|
|
|
type="index"
|
|
@@ -262,6 +278,7 @@
|
|
|
prop="productDescription"
|
|
|
width="300"
|
|
|
/>
|
|
|
+ <el-table-column label="图纸版本" width="80" prop="technologyVersion" align="center" />
|
|
|
<el-table-column
|
|
|
label="产品数"
|
|
|
align="center"
|
|
@@ -335,6 +352,14 @@
|
|
|
<span v-if="!editStatus">{{ scope.row.newCarrier }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="标识" width="300" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tag v-if="scope.row.isWaste == 1" class="spacing" type="danger">{{ "批废" }}</el-tag>
|
|
|
+ <el-tag v-if="scope.row.isAmend == 1" class="spacing" type="danger">{{ "工艺修改" }}</el-tag>
|
|
|
+ <el-tag v-if="scope.row.isWasteRecycling == 1" class="spacing" type="primary">{{ "废品回用" }}</el-tag>
|
|
|
+ <el-tag v-if="scope.row.isSuperaddition == 1" class="spacing" type="warning">{{ "追增" }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="外协工序"
|
|
|
align="center"
|
|
@@ -358,7 +383,7 @@
|
|
|
<span v-else>{{ scope.row.processNames }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="是否包装签票" align="center" prop="isPackage" >
|
|
|
+ <el-table-column label="是否包装签票" align="center" prop="isPackage" width="150">
|
|
|
<template #default="scope">
|
|
|
<el-switch :disabled="!editStatus || scope.row.hasNextInfo" v-model="scope.row.isPackage" style="
|
|
|
--el-switch-on-color: #13ce66;
|
|
@@ -366,7 +391,7 @@
|
|
|
" :active-value="1" :inactive-value="0" active-text="是" inactive-text="否" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="备注" align="center" prop="remark">
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" width="300">
|
|
|
<template #default="scope">
|
|
|
<el-input
|
|
|
v-if="editStatus && !scope.row.hasNextInfo"
|
|
@@ -378,6 +403,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
v-if="editStatus"
|
|
|
+ fixed="right"
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
class-name="small-padding fixed-width"
|
|
@@ -414,6 +440,8 @@
|
|
|
ref="dialogProcessesRef"
|
|
|
:multiple-selected="handleMultipleSelectedProcesses"
|
|
|
/>
|
|
|
+ <!-- 批量工序选择 -->
|
|
|
+ <dialog-multiProcess ref="dialogMultiProcessRef" :multiple-selected="handleMultipleSetProcesses" />
|
|
|
<!-- 新箱号选择 -->
|
|
|
<dialog-carrier
|
|
|
ref="dialogCarrierRef"
|
|
@@ -440,6 +468,7 @@ import dialogCarrier from "./DialogCarrier";
|
|
|
import dialogSuppliers from "./DialogSuppliers";
|
|
|
import dialogProducts from "./DialogProducts";
|
|
|
import dialogProcesses from "./DialogProcesses";
|
|
|
+import dialogMultiProcess from "./multiSingleChangeDialog";
|
|
|
import dialogOutsourcedRecords from "./DialogOutsourcedRecords";
|
|
|
// import FormDetailsRecycling from "./detailsRecyclingForm";
|
|
|
const { proxy } = getCurrentInstance();
|
|
@@ -480,6 +509,7 @@ const details = ref([]);
|
|
|
const form = ref({});
|
|
|
const outsourceDeptList = ref([])
|
|
|
const deptList = ref([])
|
|
|
+const selections = ref([])
|
|
|
// const formatDetails = ref([])
|
|
|
const currentDetail = ref({});
|
|
|
const rules = {
|
|
@@ -630,6 +660,10 @@ function handleChangeDeliveryMethod() {
|
|
|
form.value.freightAmount = 0.0;
|
|
|
}
|
|
|
}
|
|
|
+/** 是否可选 */
|
|
|
+function checkSelectable(row) {
|
|
|
+return row.hasReturnReceiptDetailFlag? true : false
|
|
|
+}
|
|
|
//外协工段
|
|
|
function getOutsorceDeptList() {
|
|
|
listOutsourceDeptList({}).then((response) => {
|
|
@@ -930,6 +964,10 @@ const handleMultipleSelectedProducts = (selection) => {
|
|
|
originalCarrierList: item.originalCarrierList,
|
|
|
productNum: item.productNum,
|
|
|
productCode: item.productCode,
|
|
|
+ isAmend: item.isAmend,
|
|
|
+ isWasteRecycling: item.isWasteRecycling,
|
|
|
+ isSuperaddition:item.isSuperaddition,
|
|
|
+ isWaste:item.isWaste,
|
|
|
newCarrier: "",
|
|
|
carriers: [],
|
|
|
newCarrierCount: 0,
|
|
@@ -1099,6 +1137,45 @@ const handleShowDialogProcesses = (row) => {
|
|
|
currentDetail.value = row;
|
|
|
proxy.$refs.dialogProcessesRef.open(row);
|
|
|
};
|
|
|
+/** 多选框选中数据 */
|
|
|
+function handleSelectionChange(selection) {
|
|
|
+selections.value = selection
|
|
|
+}
|
|
|
+function handleShowMultiDialogProcesses (){
|
|
|
+ if (selections.value.every((item) => item.isWaste == 1)) {
|
|
|
+ proxy.$message.error("批废不能再进行操作");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //判断是否同产品、同计划、同工艺版本
|
|
|
+ let isConsistent =
|
|
|
+ selections.value.every(
|
|
|
+ (item) => item.productionPlanDetailId === selections.value[0].productionPlanDetailId
|
|
|
+ ) &&
|
|
|
+ selections.value.every(
|
|
|
+ (item) => item.technologyVersion === selections.value[0].technologyVersion
|
|
|
+ )&&
|
|
|
+ selections.value.every(
|
|
|
+ (item) => item.productId === selections.value[0].productId
|
|
|
+ );
|
|
|
+
|
|
|
+ if (!isConsistent) {
|
|
|
+ proxy.$modal.msgError("请选择同产品、同计划、同工艺版本的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //判断是否未修改过的批次
|
|
|
+ isConsistent =
|
|
|
+ selections.value.every((item) => item.isAmend == 0) &&
|
|
|
+ selections.value.every((item) => item.isWaste == 0) &&
|
|
|
+ selections.value.every((item) => item.isWasteRecycling == 0);
|
|
|
+
|
|
|
+ if (!isConsistent) {
|
|
|
+ proxy.$modal.msgError("只能选择标准工艺的数据进行批量操作");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log(selections.value)
|
|
|
+ proxy.$refs.dialogMultiProcessRef.open(selections.value)
|
|
|
+}
|
|
|
|
|
|
// 工序选择带回
|
|
|
const handleMultipleSelectedProcesses = (selection) => {
|
|
@@ -1142,6 +1219,59 @@ const handleMultipleSelectedProcesses = (selection) => {
|
|
|
proxy.$modal.msgError("外协厂/德迈仕已收回,不可添加新工序");
|
|
|
}
|
|
|
};
|
|
|
+const handleMultipleSetProcesses = (selection) => {
|
|
|
+ console.log(selections.value)
|
|
|
+ console.log(form.value.details)
|
|
|
+ for(let i = 0; i < selections.value.length; i++){
|
|
|
+ console.log(selections.value[i])
|
|
|
+ let currentOriginal = form.value.details.filter(
|
|
|
+ (item) => (item.lotId == selections.value[i].lotId)
|
|
|
+ );
|
|
|
+ console.log(currentOriginal)
|
|
|
+ let flag = true;
|
|
|
+ if (
|
|
|
+ currentOriginal[0].returnReceiptDetailList &&
|
|
|
+ currentOriginal[0].returnReceiptDetailList.length > 0
|
|
|
+ ) {
|
|
|
+ selection.forEach((item) => {
|
|
|
+ if (
|
|
|
+ currentOriginal[0].processes.findIndex(
|
|
|
+ (info) => info.processStepNumber == item.processStepNumber
|
|
|
+ ) < 0
|
|
|
+ ) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ const processNames = selection
|
|
|
+ .sort((a, b) => a.processStepNumber - b.processStepNumber)
|
|
|
+ .map((item) => item.processAlias);
|
|
|
+ // 使用join方法将数组转换为以逗号分隔的字符串
|
|
|
+ let commaSeparatedString = processNames.join(",");
|
|
|
+ currentOriginal.processes = [];
|
|
|
+ form.value.details.filter(
|
|
|
+ (item) => (item.lotId == selections.value[i].lotId)
|
|
|
+ )[0] .processNames = commaSeparatedString;
|
|
|
+ selection.forEach((item) => {
|
|
|
+ const newProcess = {
|
|
|
+ processId: item.processId,
|
|
|
+ processCode: item.processCode,
|
|
|
+ processAlias: item.processAlias,
|
|
|
+ processStepNumber: item.processStepNumber,
|
|
|
+ technologicalProcessDetailId: item.id,
|
|
|
+ };
|
|
|
+ currentOriginal.processes.push(newProcess);
|
|
|
+ });
|
|
|
+ form.value.details.filter(
|
|
|
+ (item) => (item.lotId == selections.value[i].lotId)
|
|
|
+ )[0] .processes = currentOriginal.processes;
|
|
|
+ console.log(form.value.details)
|
|
|
+ } else {
|
|
|
+ proxy.$modal.msgError("外协厂/德迈仕已收回,不可添加新工序");
|
|
|
+ }
|
|
|
+}
|
|
|
+}
|
|
|
|
|
|
/** 暴露给父组件的方法 */
|
|
|
defineExpose({
|