|
@@ -1,15 +1,11 @@
|
|
|
<template>
|
|
|
- <el-drawer
|
|
|
- title="外协单信息"
|
|
|
- :with-header="false"
|
|
|
- v-model="visible"
|
|
|
- direction="rtl"
|
|
|
- size="100%"
|
|
|
- >
|
|
|
+ <el-drawer title="外协单信息" :with-header="false" v-model="visible" direction="rtl" size="100%">
|
|
|
<div class="form-container column-container">
|
|
|
<div class="form-btns-container">
|
|
|
<span class="title-label">
|
|
|
- <el-icon><Document /></el-icon>
|
|
|
+ <el-icon>
|
|
|
+ <Document />
|
|
|
+ </el-icon>
|
|
|
<span>收回单信息</span>
|
|
|
</span>
|
|
|
<el-button-group>
|
|
@@ -23,13 +19,7 @@
|
|
|
<!-- <span>关闭</span> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-form
|
|
|
- ref="formRef"
|
|
|
- class="master-container"
|
|
|
- :model="form"
|
|
|
- v-loading="loading"
|
|
|
- label-width="120px"
|
|
|
- >
|
|
|
+ <el-form ref="formRef" class="master-container" :model="form" v-loading="loading" label-width="120px">
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="单据号" prop="formCode">
|
|
@@ -38,25 +28,15 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="表单日期" prop="formDate">
|
|
|
- <el-date-picker
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.formDate"
|
|
|
- type="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
+ <el-date-picker v-if="editStatus" v-model="form.formDate" type="date" value-format="YYYY-MM-DD"
|
|
|
+ style="width: 100%">
|
|
|
</el-date-picker>
|
|
|
<el-input v-model="form.formDate" v-else readonly />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="外协商名称" prop="supplierName">
|
|
|
- <el-input
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.supplierName"
|
|
|
- readonly
|
|
|
- placeholder="请输入外协商名称"
|
|
|
- >
|
|
|
+ <el-input v-if="editStatus" v-model="form.supplierName" readonly placeholder="请输入外协商名称">
|
|
|
<template #append>
|
|
|
<el-button icon="Search" @click="handleShowDialogSuppliers" />
|
|
|
</template>
|
|
@@ -74,87 +54,31 @@
|
|
|
</el-form>
|
|
|
<!-- 渲染数据区 -->
|
|
|
<div class="form-details-btns-container">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="Plus"
|
|
|
- v-if="form.supplierName != ''"
|
|
|
- :disabled="!editStatus"
|
|
|
- @click="handleShowDialogOutSourceDetails"
|
|
|
- >
|
|
|
+ <el-button type="primary" icon="Plus" v-if="form.supplierName != ''" :disabled="!editStatus"
|
|
|
+ @click="handleShowDialogOutSourceDetails">
|
|
|
添加收回明细
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- :data="form.details"
|
|
|
- size="small"
|
|
|
- border
|
|
|
- height="100%"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- label="行号"
|
|
|
- type="index"
|
|
|
- align="center"
|
|
|
- width="48"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="批次号"
|
|
|
- align="center"
|
|
|
- prop="lotCode"
|
|
|
- width="104"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="产品描述"
|
|
|
- align="center"
|
|
|
- prop="productDescription"
|
|
|
- width="320"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="产品数量"
|
|
|
- align="center"
|
|
|
- prop="productNum"
|
|
|
- width="96"
|
|
|
- />
|
|
|
+ <el-table v-loading="loading" :data="form.details" size="small" border height="100%">
|
|
|
+ <el-table-column label="行号" type="index" align="center" width="48" />
|
|
|
+ <el-table-column label="批次号" align="center" prop="lotCode" width="104" />
|
|
|
+ <el-table-column label="产品描述" align="center" prop="productDescription" width="320" />
|
|
|
+ <el-table-column label="产品数量" align="center" prop="productNum" width="96" />
|
|
|
<!-- <el-table-column
|
|
|
label="原箱号"
|
|
|
align="center"
|
|
|
prop="originalCarrier"
|
|
|
width="320"
|
|
|
/> -->
|
|
|
- <el-table-column
|
|
|
- label="箱号"
|
|
|
- align="center"
|
|
|
- prop="newCarrier"
|
|
|
- width="320"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="外协工序"
|
|
|
- align="center"
|
|
|
- prop="processAlias"
|
|
|
- width="200"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="收回数量"
|
|
|
- align="center"
|
|
|
- prop="receiptNum"
|
|
|
- width="104"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="确定数量"
|
|
|
- align="center"
|
|
|
- prop="auditNum"
|
|
|
- width="104"
|
|
|
- >
|
|
|
+ <el-table-column label="箱号" align="center" prop="newCarrier" width="320" />
|
|
|
+ <el-table-column label="外协工序" align="center" prop="processAlias" width="200" />
|
|
|
+ <el-table-column label="收回数量" align="center" prop="receiptNum" width="104" />
|
|
|
+ <el-table-column label="确定数量" align="center" prop="auditNum" width="104">
|
|
|
<template #default="scope">
|
|
|
- <el-input-number
|
|
|
- v-if=" scope.row.productionDeptId == 0"
|
|
|
- v-model="scope.row.auditNum"
|
|
|
- :min="0"
|
|
|
- controls-position="right"
|
|
|
- style="text-align: center"
|
|
|
- />
|
|
|
+ <el-input-number v-if="scope.row.productionDeptId == 0" v-model="scope.row.auditNum" :min="0"
|
|
|
+ controls-position="right" style="text-align: center" />
|
|
|
<el-input v-model="scope.row.auditNum" v-else readonly />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -164,36 +88,19 @@
|
|
|
<el-input v-model="scope.row.remark" v-else readonly />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="审核状态"
|
|
|
- align="center"
|
|
|
- prop="status"
|
|
|
- width="200"
|
|
|
- >
|
|
|
+ <el-table-column label="审核状态" align="center" prop="status" width="200">
|
|
|
<template #default="scope">
|
|
|
- <el-switch
|
|
|
- v-model="scope.row.status"
|
|
|
- style="
|
|
|
+ <el-switch v-model="scope.row.status" style="
|
|
|
--el-switch-on-color: #13ce66;
|
|
|
--el-switch-off-color: #ff4949;
|
|
|
- "
|
|
|
- :active-value="1"
|
|
|
- :inactive-value="0"
|
|
|
- active-text="已审核"
|
|
|
- inactive-text="未审核"
|
|
|
- :disabled = "scope.row.productionDeptId !=0 || (scope.row.processInspecionList&&scope.row.processInspecionList.length>0)"
|
|
|
- @change="handleChangeAuditStatus(scope.row)"
|
|
|
- />
|
|
|
+ " :active-value="1" :inactive-value="0" active-text="已审核" inactive-text="未审核"
|
|
|
+ :disabled="scope.row.productionDeptId != 0 || (scope.row.processInspecionList && scope.row.processInspecionList.length > 0)"
|
|
|
+ @change="handleChangeAuditStatus(scope.row)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="反选" align="center" width="100">
|
|
|
<template #default="scope">
|
|
|
- <el-button
|
|
|
- icon="delete"
|
|
|
- link
|
|
|
- type="danger"
|
|
|
- @click="handleDelReturnReceiveDetail(scope.row)"
|
|
|
- >删除
|
|
|
+ <el-button icon="delete" link type="danger" @click="handleDelReturnReceiveDetail(scope.row)">删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -202,15 +109,10 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 收回明细选择 -->
|
|
|
- <dialog-outsource-details
|
|
|
- ref="dialogOutsourceDetailsRef"
|
|
|
- :multiple-selected="handleMultipleSelectedOutsourceDetails"
|
|
|
- />
|
|
|
+ <dialog-outsource-details ref="dialogOutsourceDetailsRef"
|
|
|
+ :multiple-selected="handleMultipleSelectedOutsourceDetails" />
|
|
|
<!-- 外协商选择 -->
|
|
|
- <dialog-suppliers
|
|
|
- ref="dialogSuppliersRef"
|
|
|
- :single-selected="handleSingleSelectedSuppliers"
|
|
|
- />
|
|
|
+ <dialog-suppliers ref="dialogSuppliersRef" :single-selected="handleSingleSelectedSuppliers" />
|
|
|
</el-drawer>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -263,7 +165,7 @@ const reset = () => {
|
|
|
supplierName: "",
|
|
|
remark: "",
|
|
|
details: [],
|
|
|
- detailInfo:[]
|
|
|
+ detailInfo: []
|
|
|
};
|
|
|
proxy.resetForm("formRef");
|
|
|
};
|
|
@@ -336,7 +238,7 @@ const handleMultipleSelectedOutsourceDetails = (selection) => {
|
|
|
lotCode: selection[i].lotCode,
|
|
|
productNum: selection[i].productNum,
|
|
|
receiptNum:
|
|
|
- selection[i].processes[selection[i].processes.length - 1].qualifiedNum
|
|
|
+ selection[i].processes[selection[i].processes.length - 1].qualifiedNum
|
|
|
? selection[i].processes[selection[i].processes.length - 1].qualifiedNum
|
|
|
: 0,
|
|
|
newCarrier: selection[i].newCarrier,
|
|
@@ -393,6 +295,11 @@ function submitForm() {
|
|
|
flag = false;
|
|
|
proxy.$modal.msgError("收回明细不能为空");
|
|
|
}
|
|
|
+
|
|
|
+ if (form.value.details.findIndex(v => v.newCarrier == null || v.newCarrier == '') >= 0) {
|
|
|
+ flag = false
|
|
|
+ proxy.$modal.msgError("收回明细中载具箱号不能为空")
|
|
|
+ }
|
|
|
if (flag) {
|
|
|
//赋值(因为收回明细是一个批次一条,所以后端传回来两个集合,一个页面显示,一个后端保存)
|
|
|
handleSetAuditStatus();
|
|
@@ -467,16 +374,16 @@ function handleDelReturnReceiveDetail(row) {
|
|
|
}
|
|
|
} else {
|
|
|
form.value.details.splice(form.value.details.indexOf(row), 1);
|
|
|
- //修改存进数据库的数据
|
|
|
- let index = [];
|
|
|
- for (let i = 0; i < form.value.detailInfo.length; i++) {
|
|
|
- if (form.value.detailInfo[i].lotCode == row.lotCode) {
|
|
|
- index.push(i);
|
|
|
- }
|
|
|
- }
|
|
|
- for (let i = index.length - 1; i >= 0; i--) {
|
|
|
- form.value.detailInfo.splice(index[i], 1);
|
|
|
- }
|
|
|
+ //修改存进数据库的数据
|
|
|
+ let index = [];
|
|
|
+ for (let i = 0; i < form.value.detailInfo.length; i++) {
|
|
|
+ if (form.value.detailInfo[i].lotCode == row.lotCode) {
|
|
|
+ index.push(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let i = index.length - 1; i >= 0; i--) {
|
|
|
+ form.value.detailInfo.splice(index[i], 1);
|
|
|
+ }
|
|
|
}
|
|
|
console.log(form.value)
|
|
|
}
|