|
@@ -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>
|
|
|
|
|
@@ -22,85 +18,41 @@
|
|
|
暂存
|
|
|
</el-button> -->
|
|
|
|
|
|
- <el-button
|
|
|
- v-show="editStatus && form.isSubmit==1"
|
|
|
- type="primary"
|
|
|
- icon="Download"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['business:outsource:export']"
|
|
|
- >导出</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- v-show="editStatus && form.isSubmit==1"
|
|
|
- type="warning"
|
|
|
- icon="Download"
|
|
|
- @click="handlePrint"
|
|
|
- v-hasPermi="['business:outsource:export']"
|
|
|
- >
|
|
|
+ <el-button v-show="editStatus && form.isSubmit == 1" type="primary" icon="Download" @click="handleExport"
|
|
|
+ v-hasPermi="['business:outsource:export']">导出</el-button>
|
|
|
+ <el-button v-show="editStatus && form.isSubmit == 1" type="warning" icon="Download" @click="handlePrint"
|
|
|
+ v-hasPermi="['business:outsource:export']">
|
|
|
打印
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- v-if="editStatus"
|
|
|
- type="primary"
|
|
|
- icon="Finished"
|
|
|
- @click="handleSubmit"
|
|
|
- >保存</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- v-if="editStatus && form.isSubmit==1"
|
|
|
- type="info"
|
|
|
- icon="Calendar"
|
|
|
- @click="handleViewRecords"
|
|
|
- >历史记录</el-button
|
|
|
- >
|
|
|
+ <el-button v-if="editStatus" type="primary" icon="Finished" @click="handleSubmit">保存</el-button>
|
|
|
+ <el-button v-if="editStatus && form.isSubmit == 1" type="info" icon="Calendar"
|
|
|
+ @click="handleViewRecords">历史记录</el-button>
|
|
|
<div class="close-btn" @click="cancel">
|
|
|
<i class="fa fa-times" aria-hidden="true" />
|
|
|
<!-- <span>关闭</span> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-form
|
|
|
- ref="formRef"
|
|
|
- class="master-container"
|
|
|
- :model="form"
|
|
|
- v-loading="loading"
|
|
|
- :rules="rules"
|
|
|
- label-width="120px"
|
|
|
- >
|
|
|
+ <el-form ref="formRef" class="master-container" :model="form" v-loading="loading" :rules="rules"
|
|
|
+ label-width="120px">
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="单据号" prop="formCode">
|
|
|
- <el-input
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.formCode"
|
|
|
- disabled
|
|
|
- placeholder="系统自动生成"
|
|
|
- />
|
|
|
+ <el-input v-if="editStatus" v-model="form.formCode" disabled placeholder="系统自动生成" />
|
|
|
<span v-else>{{ form.formCode }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="表单日期" prop="formDate">
|
|
|
- <el-date-picker
|
|
|
- v-if="editStatus"
|
|
|
- clearable
|
|
|
- v-model="form.formDate"
|
|
|
- type="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- placeholder="请选择表单日期"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
+ <el-date-picker v-if="editStatus" clearable v-model="form.formDate" type="date" value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择表单日期" style="width: 100%">
|
|
|
</el-date-picker>
|
|
|
<span v-else>{{ parseTime(form.formDate, "{y}-{m}-{d}") }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="外协商名称" prop="supplierName">
|
|
|
- <el-input
|
|
|
- v-if="editStatus && form.isSubmit == 0"
|
|
|
- v-model="form.supplierName"
|
|
|
- readonly
|
|
|
- placeholder="请输入外协商名称"
|
|
|
- >
|
|
|
+ <el-input v-if="editStatus && form.isSubmit == 0" v-model="form.supplierName" readonly
|
|
|
+ placeholder="请输入外协商名称">
|
|
|
<template #append>
|
|
|
<el-button icon="Search" @click="handleShowDialogSuppliers" />
|
|
|
</template>
|
|
@@ -108,96 +60,58 @@
|
|
|
<span v-else>{{ form.supplierName }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="6" v-if="false">
|
|
|
<el-form-item label="运费单价" prop="freightPrice">
|
|
|
- <el-input-number
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.freightPrice"
|
|
|
- :min="0"
|
|
|
- :precision="2"
|
|
|
- controls-position="right"
|
|
|
- />
|
|
|
+ <el-input-number v-if="editStatus" v-model="form.freightPrice" :min="0" :precision="2"
|
|
|
+ controls-position="right" />
|
|
|
<span v-else>{{ form.freightPrice }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="6" v-if="false">
|
|
|
<el-form-item label="运费总价" prop="freightAmount">
|
|
|
- <el-input-number
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.freightAmount"
|
|
|
- :min="0"
|
|
|
- :precision="2"
|
|
|
- controls-position="right"
|
|
|
- />
|
|
|
+ <el-input-number v-if="editStatus" v-model="form.freightAmount" :min="0" :precision="2"
|
|
|
+ controls-position="right" />
|
|
|
<span v-else>{{ form.freightAmount }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="送货方式" prop="deliveryMethod">
|
|
|
- <el-select
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.deliveryMethod"
|
|
|
- placeholder="请选择"
|
|
|
- @change="handleChangeDeliveryMethod"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in deliveryMethod"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
+ <el-select v-if="editStatus" v-model="form.deliveryMethod" placeholder="请选择"
|
|
|
+ @change="handleChangeDeliveryMethod">
|
|
|
+ <el-option v-for=" dict in deliveryMethod " :key="dict.value" :label="dict.label"
|
|
|
+ :value="dict.value" />
|
|
|
</el-select>
|
|
|
<span v-else>{{
|
|
|
- selectText(form.deliveryMethod, deliveryMethod)
|
|
|
- }}</span>
|
|
|
+ selectText(form.deliveryMethod, deliveryMethod)
|
|
|
+ }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="带箱方式" prop="packagingMethod">
|
|
|
- <el-select
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.packagingMethod"
|
|
|
- placeholder="请选择"
|
|
|
- @change="handleChangePackagingMethod"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in packagingMethod"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
+ <el-select v-if="editStatus" v-model="form.packagingMethod" placeholder="请选择"
|
|
|
+ @change="handleChangePackagingMethod">
|
|
|
+ <el-option v-for=" dict in packagingMethod " :key="dict.value" :label="dict.label"
|
|
|
+ :value="dict.value" />
|
|
|
</el-select>
|
|
|
<span v-else>{{
|
|
|
- selectText(form.packagingMethod, packagingMethod)
|
|
|
- }}</span>
|
|
|
+ selectText(form.packagingMethod, packagingMethod)
|
|
|
+ }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="结算方式" prop="settlementType">
|
|
|
- <el-select
|
|
|
- v-if="editStatus"
|
|
|
- v-model="form.settlementType"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in settlementType"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
+ <el-select v-if="editStatus" v-model="form.settlementType" placeholder="请选择">
|
|
|
+ <el-option v-for=" dict in settlementType " :key="dict.value" :label="dict.label"
|
|
|
+ :value="dict.value" />
|
|
|
</el-select>
|
|
|
<span v-else>{{
|
|
|
- selectText(form.settlementType, settlementType)
|
|
|
- }}</span>
|
|
|
+ selectText(form.settlementType, settlementType)
|
|
|
+ }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input
|
|
|
- v-if="editStatus"
|
|
|
- v-model.trim="form.remark"
|
|
|
- placeholder="请输入备注"
|
|
|
- />
|
|
|
+ <el-input v-if="editStatus" v-model.trim="form.remark" placeholder="请输入备注" />
|
|
|
<span v-else>{{ form.remark }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -210,107 +124,37 @@
|
|
|
</el-form>
|
|
|
<!-- 渲染数据区 -->
|
|
|
<div class="form-details-btns-container">
|
|
|
- <el-button
|
|
|
- v-show="editStatus"
|
|
|
- type="primary"
|
|
|
- icon="Plus"
|
|
|
- @click="handleShowDialogProducts"
|
|
|
- v-hasPermi="['business:outsource:add']"
|
|
|
- >
|
|
|
+ <el-button v-show="editStatus" type="primary" icon="Plus" @click="handleShowDialogProducts"
|
|
|
+ v-hasPermi="['business:outsource:add']">
|
|
|
添加外协产品明细
|
|
|
</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"
|
|
|
- width="160"
|
|
|
- prop="productNum"
|
|
|
- >
|
|
|
+ <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" width="160" prop="productNum">
|
|
|
<template #default="scope">
|
|
|
- <el-input-number
|
|
|
- v-if="editStatus"
|
|
|
- :min="0"
|
|
|
- v-model="scope.row.productNum"
|
|
|
- placeholder="产品数"
|
|
|
- />
|
|
|
+ <el-input-number v-if="editStatus" :min="0" v-model="scope.row.productNum" placeholder="产品数"
|
|
|
+ :controls="false" />
|
|
|
<span v-else>{{ scope.row.productNum }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="箱数"
|
|
|
- align="center"
|
|
|
- prop="carrierNum"
|
|
|
- width="70"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- :label="form.packagingMethod === '0' ? '箱号' : '原箱号'"
|
|
|
- align="center"
|
|
|
- prop="originalCarrier"
|
|
|
- width="320"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="新箱号"
|
|
|
- align="center"
|
|
|
- prop="newCarrier"
|
|
|
- width="320"
|
|
|
- >
|
|
|
+ <el-table-column label="箱数" align="center" prop="carrierNum" width="70" />
|
|
|
+ <el-table-column :label="form.packagingMethod === '0' ? '箱号' : '原箱号'" align="center" prop="originalCarrier"
|
|
|
+ width="320" />
|
|
|
+ <el-table-column label="新箱号" align="center" prop="newCarrier" width="320">
|
|
|
<template #default="scope">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- icon="Refresh"
|
|
|
- v-if="!scope.row.editStatus && editStatus"
|
|
|
- @click="handleChangeCarrier(scope.row)"
|
|
|
- >换箱</el-button
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-if="editStatus && scope.row.editStatus"
|
|
|
- v-model="scope.row.carrierIds"
|
|
|
- multiple
|
|
|
- filterable
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
- placeholder="请选择箱号"
|
|
|
- :remote-method="
|
|
|
- (arg) =>
|
|
|
- remoteCarriers(arg, scope.row.newCarriers, scope.row)
|
|
|
- "
|
|
|
- :loading="loadingCarrier"
|
|
|
- @change="(arg) => handleCarrierChange(arg, scope.row)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in scope.row.carriers"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
+ <el-button link type="primary" icon="Refresh" v-if="!scope.row.editStatus && editStatus"
|
|
|
+ @click="handleChangeCarrier(scope.row)">换箱</el-button>
|
|
|
+ <el-select v-if="editStatus && scope.row.editStatus" v-model="scope.row.carrierIds" multiple filterable
|
|
|
+ remote reserve-keyword placeholder="请选择箱号" :remote-method="(arg) =>
|
|
|
+ remoteCarriers(arg, scope.row.newCarriers, scope.row)
|
|
|
+ " :loading="loadingCarrier" @change="(arg) => handleCarrierChange(arg, scope.row)">
|
|
|
+ <el-option v-for=" item in scope.row.carriers " :key="item.value" :label="item.label"
|
|
|
+ :value="item.value" />
|
|
|
</el-select>
|
|
|
<span v-if="!editStatus">{{ scope.row.newCarrier }}</span>
|
|
|
<!-- <el-input
|
|
@@ -325,28 +169,15 @@
|
|
|
@click="handleShowDialogOutsourceCarriers(scope.row)"
|
|
|
/>
|
|
|
</template>
|
|
|
- </el-input>
|
|
|
- <span v-else>{{ scope.row.newCarrier }}</span>-->
|
|
|
+ </el-input>
|
|
|
+ <span v-else>{{ scope.row.newCarrier }}</span>-->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="外协工序"
|
|
|
- align="center"
|
|
|
- prop="processNames"
|
|
|
- width="320"
|
|
|
- >
|
|
|
+ <el-table-column label="外协工序" align="center" prop="processNames" width="320">
|
|
|
<template #default="scope">
|
|
|
- <el-input
|
|
|
- v-if="editStatus"
|
|
|
- v-model="scope.row.processNames"
|
|
|
- readonly
|
|
|
- placeholder="请选择工序"
|
|
|
- >
|
|
|
+ <el-input v-if="editStatus" v-model="scope.row.processNames" readonly placeholder="请选择工序">
|
|
|
<template #append>
|
|
|
- <el-button
|
|
|
- icon="Search"
|
|
|
- @click="handleShowDialogProcesses(scope.row)"
|
|
|
- />
|
|
|
+ <el-button icon="Search" @click="handleShowDialogProcesses(scope.row)" />
|
|
|
</template>
|
|
|
</el-input>
|
|
|
<span v-else>{{ scope.row.processNames }}</span>
|
|
@@ -354,29 +185,15 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="备注" align="center" prop="remark">
|
|
|
<template #default="scope">
|
|
|
- <el-input
|
|
|
- v-if="editStatus"
|
|
|
- v-model="scope.row.remark"
|
|
|
- placeholder="备注"
|
|
|
- />
|
|
|
+ <el-input v-if="editStatus" v-model="scope.row.remark" placeholder="备注" />
|
|
|
<span v-else>{{ scope.row.remark }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- v-if="editStatus"
|
|
|
- label="操作"
|
|
|
- align="center"
|
|
|
- class-name="small-padding fixed-width"
|
|
|
- width="64"
|
|
|
- >
|
|
|
+ <el-table-column v-if="editStatus" label="操作" align="center" class-name="small-padding fixed-width"
|
|
|
+ width="64">
|
|
|
<template #default="scope">
|
|
|
- <el-button
|
|
|
- circle
|
|
|
- type="danger"
|
|
|
- icon="Delete"
|
|
|
- @click="handleDelete(scope.$index)"
|
|
|
- v-hasPermi="['business:outsource:remove']"
|
|
|
- />
|
|
|
+ <el-button circle type="danger" icon="Delete" @click="handleDelete(scope.$index)"
|
|
|
+ v-hasPermi="['business:outsource:remove']" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -384,31 +201,19 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 外协商选择 -->
|
|
|
- <dialog-suppliers
|
|
|
- ref="dialogSuppliersRef"
|
|
|
- :single-selected="handleSingleSelectedSupplier"
|
|
|
- />
|
|
|
+ <dialog-suppliers ref="dialogSuppliersRef" :single-selected="handleSingleSelectedSupplier" />
|
|
|
<!-- 产品选择 -->
|
|
|
- <dialog-products
|
|
|
- ref="dialogProductsRef"
|
|
|
- :supplier-id="form.supplierId"
|
|
|
- :multiple-selected="handleMultipleSelectedProducts"
|
|
|
- />
|
|
|
+ <dialog-products ref="dialogProductsRef" :supplier-id="form.supplierId"
|
|
|
+ :multiple-selected="handleMultipleSelectedProducts" />
|
|
|
<!-- 工序选择 -->
|
|
|
- <dialog-processes
|
|
|
- ref="dialogProcessesRef"
|
|
|
- :multiple-selected="handleMultipleSelectedProcesses"
|
|
|
- />
|
|
|
+ <dialog-processes ref="dialogProcessesRef" :multiple-selected="handleMultipleSelectedProcesses" />
|
|
|
<!-- 新箱号选择 -->
|
|
|
- <dialog-carrier
|
|
|
- ref="dialogCarrierRef"
|
|
|
- :multiple-selected="handleMultipleSelectedOutsourceCarriers"
|
|
|
- />
|
|
|
+ <dialog-carrier ref="dialogCarrierRef" :multiple-selected="handleMultipleSelectedOutsourceCarriers" />
|
|
|
<!-- 历史记录弹窗 -->
|
|
|
- <dialog-outsourced-records ref="dialogOutsourcedRecordsRef"/>
|
|
|
- <!-- 收回明细带回 -->
|
|
|
- <!-- <form-details-recycling ref="formDetailsRecyclingRef" :singleSelected="handleSingleSelectedRecycling"/> -->
|
|
|
- </el-drawer>
|
|
|
+ <dialog-outsourced-records ref="dialogOutsourcedRecordsRef" />
|
|
|
+ <!-- 收回明细带回 -->
|
|
|
+ <!-- <form-details-recycling ref="formDetailsRecyclingRef" :singleSelected="handleSingleSelectedRecycling"/> -->
|
|
|
+ </el-drawer>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import {
|
|
@@ -431,7 +236,7 @@ const { proxy } = getCurrentInstance();
|
|
|
const props = defineProps({
|
|
|
getList: {
|
|
|
type: Function,
|
|
|
- default: () => {},
|
|
|
+ default: () => { },
|
|
|
},
|
|
|
deliveryMethod: {
|
|
|
type: Array,
|
|
@@ -517,7 +322,7 @@ function getForm() {
|
|
|
});
|
|
|
|
|
|
editStatus.value = form.value.isSubmit == 1;
|
|
|
- if(!detailInfo.value.flag) {
|
|
|
+ if (!detailInfo.value.flag) {
|
|
|
editStatus.value = false
|
|
|
console.log(editStatus.value)
|
|
|
}
|
|
@@ -528,35 +333,36 @@ function getForm() {
|
|
|
//改变带箱方式
|
|
|
function handleChangePackagingMethod() {
|
|
|
totalCarriersNum.value = 0
|
|
|
- if(!editStatus){
|
|
|
- if(form.value.packagingMethod == 1 && form.value.details.length>0) {
|
|
|
- form.value.details.forEach(item =>{item.newCarriers = [];item.carrierIds = [];item.carriers = carriers.value})
|
|
|
- }if(form.value.packagingMethod == 0 &&form.value.details.length>0) {
|
|
|
- form.value.details.forEach(item =>{
|
|
|
- item.carriers = carriers.value;
|
|
|
- item.newCarriers = [];
|
|
|
- item.carrierIds = [];
|
|
|
- item.newCarriers.push(...item.originalCarrierList.map(v => ({ id: v.carrierId, code: v.carrierCode })));
|
|
|
- item.carriers.push( ...item.originalCarrierList.map((v) => ({ value: v.carrierId, label: v.carrierCode })));
|
|
|
- item.carrierIds = item.originalCarrierList.map(info => { return info.carrierId })
|
|
|
+ if (!editStatus) {
|
|
|
+ if (form.value.packagingMethod == 1 && form.value.details.length > 0) {
|
|
|
+ form.value.details.forEach(item => { item.newCarriers = []; item.carrierIds = []; item.carriers = carriers.value })
|
|
|
+ } if (form.value.packagingMethod == 0 && form.value.details.length > 0) {
|
|
|
+ form.value.details.forEach(item => {
|
|
|
+ item.carriers = carriers.value;
|
|
|
+ item.newCarriers = [];
|
|
|
+ item.carrierIds = [];
|
|
|
+ item.newCarriers.push(...item.originalCarrierList.map(v => ({ id: v.carrierId, code: v.carrierCode })));
|
|
|
+ item.carriers.push(...item.originalCarrierList.map((v) => ({ value: v.carrierId, label: v.carrierCode })));
|
|
|
+ item.carrierIds = item.originalCarrierList.map(info => { return info.carrierId })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ form.value.details.forEach(item => {
|
|
|
+ console.log(item.editStatus)
|
|
|
+ if (item.editStatus) {
|
|
|
+ item.newCarriers = []; item.carrierIds = []; item.carriers = carriers.value
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
-}else{
|
|
|
- form.value.details.forEach(item =>{
|
|
|
- console.log(item.editStatus)
|
|
|
- if(item.editStatus){
|
|
|
- item.newCarriers = [];item.carrierIds = [];item.carriers = carriers.value}
|
|
|
-})
|
|
|
-}
|
|
|
console.log(form.value.details)
|
|
|
- for(let i = 0;i<form.value.details.length;i++) {
|
|
|
- if(form.value.packagingMethod == 1) {
|
|
|
- form.value.details[i].carrierNum =form.value.details[i].newCarriers? form.value.details[i].newCarriers.length:0
|
|
|
- }else {
|
|
|
- form.value.details[i].carrierNum = form.value.details[i].newCarriers && form.value.details[i].newCarriers.length>0? form.value.details[i].newCarriers.length:form.value.details[i].originalCarrier.split(",").length
|
|
|
- }
|
|
|
- console.log(form.value.details)
|
|
|
- totalCarriersNum.value += form.value.details[i].carrierNum
|
|
|
+ for (let i = 0; i < form.value.details.length; i++) {
|
|
|
+ if (form.value.packagingMethod == 1) {
|
|
|
+ form.value.details[i].carrierNum = form.value.details[i].newCarriers ? form.value.details[i].newCarriers.length : 0
|
|
|
+ } else {
|
|
|
+ form.value.details[i].carrierNum = form.value.details[i].newCarriers && form.value.details[i].newCarriers.length > 0 ? form.value.details[i].newCarriers.length : form.value.details[i].originalCarrier.split(",").length
|
|
|
+ }
|
|
|
+ console.log(form.value.details)
|
|
|
+ totalCarriersNum.value += form.value.details[i].carrierNum
|
|
|
}
|
|
|
}
|
|
|
//改变送货方式
|
|
@@ -566,7 +372,7 @@ function handleChangeDeliveryMethod() {
|
|
|
} else {
|
|
|
form.value.freightAmount = 0.0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
//打开历史记录弹窗
|
|
|
function handleViewRecords() {
|
|
@@ -611,7 +417,7 @@ function reset() {
|
|
|
packagingMethod: "0",
|
|
|
remark: null,
|
|
|
details: [],
|
|
|
- isSubmit:0
|
|
|
+ isSubmit: 0
|
|
|
};
|
|
|
proxy.resetForm("formRef");
|
|
|
}
|
|
@@ -691,79 +497,79 @@ function submitFrom() {
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => { });
|
|
|
}
|
|
|
//5.29保存
|
|
|
function handleSubmit() {
|
|
|
- if(form.value.isSubmit==0){
|
|
|
- proxy.$modal
|
|
|
- .confirm("是否确定保存,保存后外协商不可编辑!")
|
|
|
- .then(function () {
|
|
|
- return;
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- if (!form.value.details || form.value.details.length == 0) {
|
|
|
- proxy.$modal.msgError("请添加产品明细");
|
|
|
+ if (form.value.isSubmit == 0) {
|
|
|
+ proxy.$modal
|
|
|
+ .confirm("是否确定保存,保存后外协商不可编辑!")
|
|
|
+ .then(function () {
|
|
|
return;
|
|
|
- }
|
|
|
-
|
|
|
- proxy.$refs["formRef"].validate((valid) => {
|
|
|
- for (const item of form.value.details) {
|
|
|
- if (!item.processNames) {
|
|
|
- proxy.$modal.msgError("请选择" + item.lotCode + "批次的工序");
|
|
|
- return;
|
|
|
- }
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (!form.value.details || form.value.details.length == 0) {
|
|
|
+ proxy.$modal.msgError("请添加产品明细");
|
|
|
+ return;
|
|
|
}
|
|
|
- if (form.value.packagingMethod == 1) {
|
|
|
- console.log("form.value.details", form.value.details);
|
|
|
+
|
|
|
+ proxy.$refs["formRef"].validate((valid) => {
|
|
|
for (const item of form.value.details) {
|
|
|
- if (item.newCarriers.length == 0) {
|
|
|
- proxy.$modal.msgError("请选择" + item.lotCode + "批次的新箱号");
|
|
|
+ if (!item.processNames) {
|
|
|
+ proxy.$modal.msgError("请选择" + item.lotCode + "批次的工序");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (valid) {
|
|
|
- console.log(form.value)
|
|
|
- submitDetails(form.value).then((response) => {
|
|
|
- proxy.$modal.msgSuccess("提交成功");
|
|
|
- visible.value = false;
|
|
|
- getList.value();
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- }else{
|
|
|
+ if (form.value.packagingMethod == 1) {
|
|
|
+ console.log("form.value.details", form.value.details);
|
|
|
+ for (const item of form.value.details) {
|
|
|
+ if (item.newCarriers.length == 0) {
|
|
|
+ proxy.$modal.msgError("请选择" + item.lotCode + "批次的新箱号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (valid) {
|
|
|
+ console.log(form.value)
|
|
|
+ submitDetails(form.value).then((response) => {
|
|
|
+ proxy.$modal.msgSuccess("提交成功");
|
|
|
+ visible.value = false;
|
|
|
+ getList.value();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ } else {
|
|
|
if (!form.value.details || form.value.details.length == 0) {
|
|
|
- proxy.$modal.msgError("请添加产品明细");
|
|
|
- return;
|
|
|
- }
|
|
|
+ proxy.$modal.msgError("请添加产品明细");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- proxy.$refs["formRef"].validate((valid) => {
|
|
|
+ proxy.$refs["formRef"].validate((valid) => {
|
|
|
+ for (const item of form.value.details) {
|
|
|
+ if (!item.processNames) {
|
|
|
+ proxy.$modal.msgError("请选择" + item.lotCode + "批次的工序");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (form.value.packagingMethod == 1) {
|
|
|
+ console.log("form.value.details", form.value.details);
|
|
|
for (const item of form.value.details) {
|
|
|
- if (!item.processNames) {
|
|
|
- proxy.$modal.msgError("请选择" + item.lotCode + "批次的工序");
|
|
|
+ if (item.newCarriers.length == 0) {
|
|
|
+ proxy.$modal.msgError("请选择" + item.lotCode + "批次的新箱号");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- if (form.value.packagingMethod == 1) {
|
|
|
- console.log("form.value.details", form.value.details);
|
|
|
- for (const item of form.value.details) {
|
|
|
- if (item.newCarriers.length == 0) {
|
|
|
- proxy.$modal.msgError("请选择" + item.lotCode + "批次的新箱号");
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (valid) {
|
|
|
- console.log(form.value)
|
|
|
- submitDetails(form.value).then((response) => {
|
|
|
- proxy.$modal.msgSuccess("提交成功");
|
|
|
- visible.value = false;
|
|
|
- getList.value();
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ if (valid) {
|
|
|
+ console.log(form.value)
|
|
|
+ submitDetails(form.value).then((response) => {
|
|
|
+ proxy.$modal.msgSuccess("提交成功");
|
|
|
+ visible.value = false;
|
|
|
+ getList.value();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -792,7 +598,7 @@ const handleSingleSelectedSupplier = (data) => {
|
|
|
function handleDetailsRecycling() {
|
|
|
proxy.$refs.formDetailsRecyclingRef.open(row);
|
|
|
}
|
|
|
-function handleSingleSelectedRecycling() {}
|
|
|
+function handleSingleSelectedRecycling() { }
|
|
|
/***************************** 产品对话框相关 *****************************/
|
|
|
// 打开产品选择对话框
|
|
|
const handleShowDialogProducts = () => {
|
|
@@ -840,7 +646,7 @@ const handleMultipleSelectedProducts = (selection) => {
|
|
|
|
|
|
/***************************** 外协箱子对话框相关 *****************************/
|
|
|
// 打开外协箱子选择对话框
|
|
|
-const handleShowDialogOutsourceCarriers = (row) => {};
|
|
|
+const handleShowDialogOutsourceCarriers = (row) => { };
|
|
|
|
|
|
function remoteCarriers(code, newCarrier, row) {
|
|
|
loadingCarrier.value = true;
|
|
@@ -862,7 +668,7 @@ function remoteCarriers(code, newCarrier, row) {
|
|
|
carrierForOutsource({
|
|
|
categoryId: categoryId,
|
|
|
code: code,
|
|
|
- dayworkId:row.dayworkId
|
|
|
+ dayworkId: row.dayworkId
|
|
|
}).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
carriers.value = res.rows.map((v) => ({ value: v.id, label: v.code }));
|