|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
|
<div class="tenant">
|
|
|
- <!-- <Banner /> -->
|
|
|
<div class="content">
|
|
|
<byTable
|
|
|
:source="sourceList.data"
|
|
@@ -10,7 +9,6 @@
|
|
|
highlight-current-row
|
|
|
:selectConfig="selectConfig"
|
|
|
:table-events="{
|
|
|
- //element talbe事件都能传
|
|
|
select: selectRow,
|
|
|
'select-all': selectRow,
|
|
|
}"
|
|
@@ -25,38 +23,25 @@
|
|
|
action: () => openModal(),
|
|
|
},
|
|
|
]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ @get-list="getList">
|
|
|
<template #code="{ item }">
|
|
|
<div>
|
|
|
- <div
|
|
|
- v-for="(item, index) in getData(item.codeAPName, 'code')"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- {{ item }}
|
|
|
+ <div v-for="(row, index) in getData(item.codeAPName, 'code')" :key="index">
|
|
|
+ {{ row }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #productName="{ item }">
|
|
|
<div>
|
|
|
- <div
|
|
|
- v-for="(item, index) in getData(item.codeAPName, 'productName')"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <el-tooltip
|
|
|
- class="box-item"
|
|
|
- effect="dark"
|
|
|
- :content="item"
|
|
|
- placement="top-start"
|
|
|
- >
|
|
|
+ <div v-for="(row, index) in getData(item.codeAPName, 'productName')" :key="index">
|
|
|
+ <el-tooltip class="box-item" effect="dark" :content="item" placement="top-start">
|
|
|
<div class="hidden-text">
|
|
|
- {{ item }}
|
|
|
+ {{ row }}
|
|
|
</div>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<template #cases="{ item }">
|
|
|
<div>
|
|
|
<div v-for="(i, index) in item.dataJsonListCopy" :key="index">
|
|
@@ -67,18 +52,14 @@
|
|
|
<template #netWeight="{ item }">
|
|
|
<div>
|
|
|
<div v-for="(i, index) in item.dataJsonListCopy" :key="index">
|
|
|
- <span v-if="i.netWeight && Number(i.netWeight) > 0">
|
|
|
- {{ i.netWeight + " kg" }}</span
|
|
|
- >
|
|
|
+ <span v-if="i.netWeight && Number(i.netWeight) > 0"> {{ i.netWeight + " kg" }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #roughWeight="{ item }">
|
|
|
<div>
|
|
|
<div v-for="(i, index) in item.dataJsonListCopy" :key="index">
|
|
|
- <span v-if="i.roughWeight && Number(i.roughWeight) > 0">
|
|
|
- {{ i.roughWeight + " kg" }}</span
|
|
|
- >
|
|
|
+ <span v-if="i.roughWeight && Number(i.roughWeight) > 0"> {{ i.roughWeight + " kg" }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -120,62 +101,25 @@
|
|
|
</template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- title="产品装箱"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="800"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- :model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="formDom"
|
|
|
- label-position="top"
|
|
|
- >
|
|
|
+
|
|
|
+ <el-dialog title="产品装箱" v-model="dialogVisible" width="800" v-loading="loading">
|
|
|
+ <el-form :model="formData.data" :rules="rules" ref="formDom" label-position="top">
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="客户名称" prop="customerId">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.customerId"
|
|
|
- placeholder="请选择"
|
|
|
- @change="handleChangeCustomer"
|
|
|
- filterable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in customerList"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="formData.data.customerId" placeholder="请选择" @change="handleChangeCustomer" filterable style="width: 100%">
|
|
|
+ <el-option v-for="item in customerList" :label="item.name" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item label="选择合同" prop="contractIds">
|
|
|
- <el-select
|
|
|
- v-model="formData.data.contractIds"
|
|
|
- placeholder="请选择"
|
|
|
- @change="handleChangeContract"
|
|
|
- filterable
|
|
|
- style="width: 100%"
|
|
|
- multiple
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in contractData"
|
|
|
- :label="item.code"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="formData.data.contractIds" placeholder="请选择" @change="handleChangeContract" filterable style="width: 100%" multiple>
|
|
|
+ <el-option v-for="item in contractData" :label="item.code" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="合同明细" prop="contractProductData">
|
|
|
- <el-table
|
|
|
- :data="formData.data.contractProductData"
|
|
|
- @select="handleSelectProduct"
|
|
|
- @select-all="handleSelectProduct"
|
|
|
- ref="tableDom"
|
|
|
- >
|
|
|
+ <el-table :data="formData.data.contractProductData" @select="handleSelectProduct" @select-all="handleSelectProduct" ref="tableDom">
|
|
|
<el-table-column type="selection" label="" width="50" />
|
|
|
<el-table-column prop="contractCode" label="合同编码" />
|
|
|
<el-table-column prop="productName" label="产品名称" />
|
|
@@ -183,44 +127,20 @@
|
|
|
<el-table-column prop="waitQuantity" label="待装箱数量" />
|
|
|
<el-table-column prop="quantity" label="装箱数量" min-width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'contractProductData.' + $index + '.quantity'"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.quantity"
|
|
|
- :precision="4"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'contractProductData.' + $index + '.quantity'" :inline-message="true">
|
|
|
+ <el-input-number v-model="row.quantity" :precision="4" :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- style="margin-top: 10px; width: 100%"
|
|
|
- @click="handleClickPacking"
|
|
|
- >
|
|
|
- 装箱
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" style="margin-top: 10px; width: 100%" @click="handleClickPacking"> 装箱 </el-button>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
<el-form-item label="装箱明细" prop="packDetailList">
|
|
|
- <div
|
|
|
- class="box"
|
|
|
- v-for="(item, index) in formData.data.packDetailList"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
+ <div class="box" v-for="(item, index) in formData.data.packDetailList" :key="index">
|
|
|
<div ref="">箱规</div>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="5">
|
|
|
- <el-form-item
|
|
|
- label="箱数"
|
|
|
- :prop="'packDetailList.' + index + '.packQuantity'"
|
|
|
- :rules="rules.packQuantity"
|
|
|
- >
|
|
|
+ <el-form-item label="箱数" :prop="'packDetailList.' + index + '.packQuantity'" :rules="rules.packQuantity">
|
|
|
<el-input-number
|
|
|
v-model="item.packQuantity"
|
|
|
:precision="0"
|
|
@@ -228,41 +148,17 @@
|
|
|
:min="1"
|
|
|
placeholder="请输入"
|
|
|
onmousewheel="return false;"
|
|
|
- @change="(val) => handleChangePackQuantity(val, index)"
|
|
|
- />
|
|
|
+ @change="(val) => handleChangePackQuantity(val, index)" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="5">
|
|
|
- <el-form-item
|
|
|
- label="净重(kg)"
|
|
|
- :prop="'packDetailList.' + index + '.netWeight'"
|
|
|
- :rules="rules.netWeight"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="item.netWeight"
|
|
|
- :precision="2"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- placeholder="请输入"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ <el-form-item label="净重(kg)" :prop="'packDetailList.' + index + '.netWeight'" :rules="rules.netWeight">
|
|
|
+ <el-input-number v-model="item.netWeight" :precision="2" :controls="false" :min="0" placeholder="请输入" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
<el-col :span="5">
|
|
|
- <el-form-item
|
|
|
- label="毛重(kg)"
|
|
|
- :prop="'packDetailList.' + index + '.roughWeight'"
|
|
|
- :rules="rules.roughWeight"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="item.roughWeight"
|
|
|
- :precision="2"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- placeholder="请输入"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ <el-form-item label="毛重(kg)" :prop="'packDetailList.' + index + '.roughWeight'" :rules="rules.roughWeight">
|
|
|
+ <el-input-number v-model="item.roughWeight" :precision="2" :controls="false" :min="0" placeholder="请输入" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
@@ -270,53 +166,38 @@
|
|
|
<el-form-item label="尺寸(cm³)" required>
|
|
|
<el-col :span="1"></el-col>
|
|
|
<el-col :span="7">
|
|
|
- <el-form-item
|
|
|
- label=""
|
|
|
- :prop="'packDetailList.' + index + '.boxLong'"
|
|
|
- :rules="rules.boxLong"
|
|
|
- >
|
|
|
+ <el-form-item label="" :prop="'packDetailList.' + index + '.boxLong'" :rules="rules.boxLong">
|
|
|
<el-input-number
|
|
|
v-model="item.boxLong"
|
|
|
placeholder="长"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="1" style="text-align: center"> * </el-col>
|
|
|
<el-col :span="7">
|
|
|
- <el-form-item
|
|
|
- label=""
|
|
|
- :prop="'packDetailList.' + index + '.boxWide'"
|
|
|
- :rules="rules.boxWide"
|
|
|
- >
|
|
|
+ <el-form-item label="" :prop="'packDetailList.' + index + '.boxWide'" :rules="rules.boxWide">
|
|
|
<el-input-number
|
|
|
v-model="item.boxWide"
|
|
|
placeholder="宽"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="1" style="text-align: center"> * </el-col>
|
|
|
<el-col :span="7">
|
|
|
- <el-form-item
|
|
|
- label=""
|
|
|
- :prop="'packDetailList.' + index + '.boxHigh'"
|
|
|
- :rules="rules.boxHigh"
|
|
|
- >
|
|
|
+ <el-form-item label="" :prop="'packDetailList.' + index + '.boxHigh'" :rules="rules.boxHigh">
|
|
|
<el-input-number
|
|
|
v-model="item.boxHigh"
|
|
|
placeholder="高"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- ></el-input-number>
|
|
|
+ onmousewheel="return false;"></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
@@ -326,72 +207,34 @@
|
|
|
<div class="line"></div>
|
|
|
<el-form-item label="关联合同产品">
|
|
|
<div class="flex-box">
|
|
|
- <div
|
|
|
- class="item"
|
|
|
- v-for="(product, j) in item.packDetailProductList"
|
|
|
- :key="j"
|
|
|
- >
|
|
|
+ <div class="item" v-for="(product, j) in item.packDetailProductList" :key="j">
|
|
|
<div>合同编码:{{ product.contractCode }}</div>
|
|
|
<div>产品名称:{{ product.productName }}</div>
|
|
|
<div>每箱数量:{{ product.quantity }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <div
|
|
|
- class="bottom-arrow"
|
|
|
- v-show="!item.isShow"
|
|
|
- @click="item.isShow = !item.isShow"
|
|
|
- >
|
|
|
+ <div class="bottom-arrow" v-show="!item.isShow" @click="item.isShow = !item.isShow">
|
|
|
<span style="margin-right: 5px"> 自定义装箱明细</span>
|
|
|
<el-icon><ArrowDownBold /></el-icon>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="bottom-arrow"
|
|
|
- v-show="item.isShow"
|
|
|
- @click="item.isShow = !item.isShow"
|
|
|
- >
|
|
|
+ <div class="bottom-arrow" v-show="item.isShow" @click="item.isShow = !item.isShow">
|
|
|
<span style="margin-right: 5px"> 收起</span>
|
|
|
<el-icon><ArrowUpBold /></el-icon>
|
|
|
</div>
|
|
|
<el-form-item prop="packDetailGoodsList" v-show="item.isShow">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- style="margin-bottom: 10px"
|
|
|
- @click="handleCustomPush(index)"
|
|
|
- >
|
|
|
- 添加行
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" style="margin-bottom: 10px" @click="handleCustomPush(index)"> 添加行 </el-button>
|
|
|
<el-table :data="item.packDetailGoodsList">
|
|
|
<el-table-column label="货物描述">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="[
|
|
|
- 'packDetailList',
|
|
|
- index,
|
|
|
- 'packDetailGoodsList',
|
|
|
- $index,
|
|
|
- 'remark',
|
|
|
- ]"
|
|
|
- :rules="rules.remark"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
+ <el-form-item :prop="['packDetailList', index, 'packDetailGoodsList', $index, 'remark']" :rules="rules.remark" :inline-message="true">
|
|
|
<el-input v-model="row.remark" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="单位" width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="[
|
|
|
- 'packDetailList',
|
|
|
- index,
|
|
|
- 'packDetailGoodsList',
|
|
|
- $index,
|
|
|
- 'unit',
|
|
|
- ]"
|
|
|
- :rules="rules.unit"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
+ <el-form-item :prop="['packDetailList', index, 'packDetailGoodsList', $index, 'unit']" :rules="rules.unit" :inline-message="true">
|
|
|
<el-input v-model="row.unit" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
@@ -399,34 +242,16 @@
|
|
|
<el-table-column label="数量" width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="[
|
|
|
- 'packDetailList',
|
|
|
- index,
|
|
|
- 'packDetailGoodsList',
|
|
|
- $index,
|
|
|
- 'quantity',
|
|
|
- ]"
|
|
|
+ :prop="['packDetailList', index, 'packDetailGoodsList', $index, 'quantity']"
|
|
|
:rules="rules.quantityOne"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.quantity"
|
|
|
- :precision="4"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- />
|
|
|
+ :inline-message="true">
|
|
|
+ <el-input-number v-model="row.quantity" :precision="4" :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="zip" label="操作" width="100">
|
|
|
<template #default="{ $index }">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- @click="handleCustomRemove(index, $index)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" link @click="handleCustomRemove(index, $index)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -436,61 +261,27 @@
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="handleClose" size="large">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
- 确 定
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
- title="合并出货"
|
|
|
- v-model="dialogVisibleOne"
|
|
|
- width="400"
|
|
|
- v-loading="loadingOne"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.dataOne"
|
|
|
- :rules="rules"
|
|
|
- ref="byform"
|
|
|
- >
|
|
|
- </byForm>
|
|
|
+
|
|
|
+ <el-dialog title="合并出货" v-model="dialogVisibleOne" width="400" v-loading="loadingOne">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.dataOne" :rules="rules" ref="byform"> </byForm>
|
|
|
<template #footer>
|
|
|
- <el-button @click="dialogVisibleOne = false" size="large"
|
|
|
- >取 消</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitFormOne()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
- 确 定
|
|
|
- </el-button>
|
|
|
+ <el-button @click="dialogVisibleOne = false" size="large">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitFormOne()" size="large" :loading="submitLoading"> 确 定 </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
+
|
|
|
<script setup>
|
|
|
-/* eslint-disable vue/no-unused-components */
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
-import { computed, defineComponent, ref } from "vue";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
|
|
|
-const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
|
|
|
-const headers = ref({ Authorization: "Bearer " + getToken() });
|
|
|
-const uploadData = ref({});
|
|
|
const loading = ref(false);
|
|
|
const loadingOne = ref(false);
|
|
|
-
|
|
|
const submitLoading = ref(false);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
@@ -503,9 +294,7 @@ const sourceList = ref({
|
|
|
});
|
|
|
let dialogVisible = ref(false);
|
|
|
let dialogVisibleOne = ref(false);
|
|
|
-
|
|
|
let modalType = ref("add");
|
|
|
-let fileList = ref([]);
|
|
|
let rules = ref({
|
|
|
contractIds: [{ required: true, message: "请选择合同", trigger: "change" }],
|
|
|
packQuantity: [{ required: true, message: "请输入箱数", trigger: "blur" }],
|
|
@@ -696,15 +485,11 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- ElMessageBox.confirm(
|
|
|
- "此操作将永久作废该数据, 是否继续?",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ ElMessageBox.confirm("此操作将永久作废该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
// 删除
|
|
|
proxy
|
|
|
.post("/pack/delete", {
|
|
@@ -737,7 +522,6 @@ const formOption = reactive({
|
|
|
rules: [],
|
|
|
});
|
|
|
const byform = ref(null);
|
|
|
-const treeData = ref([]);
|
|
|
const formConfig = reactive([
|
|
|
{
|
|
|
type: "select",
|
|
@@ -747,7 +531,6 @@ const formConfig = reactive([
|
|
|
data: [],
|
|
|
},
|
|
|
]);
|
|
|
-
|
|
|
const getList = async (req) => {
|
|
|
selectData.value = [];
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -780,7 +563,6 @@ const getList = async (req) => {
|
|
|
loading.value = false;
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
const openModal = () => {
|
|
|
modalType.value = "add";
|
|
|
formData.data = {
|
|
@@ -790,7 +572,6 @@ const openModal = () => {
|
|
|
dialogVisible.value = true;
|
|
|
handleChangeCustomer("");
|
|
|
};
|
|
|
-
|
|
|
const openModalOne = () => {
|
|
|
formData.dataOne = {
|
|
|
ids: [],
|
|
@@ -813,7 +594,6 @@ const openModalOne = () => {
|
|
|
dialogVisibleOne.value = true;
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
const submitForm = () => {
|
|
|
formDom.value.validate((vaild) => {
|
|
|
if (vaild) {
|
|
@@ -917,9 +697,7 @@ const handleClickPacking = () => {
|
|
|
index: x.index,
|
|
|
}));
|
|
|
const customerId = formData.data.customerId ? formData.data.customerId : "";
|
|
|
- const contractIds = formData.data.contractIds
|
|
|
- ? formData.data.contractIds.join(",")
|
|
|
- : "";
|
|
|
+ const contractIds = formData.data.contractIds ? formData.data.contractIds.join(",") : "";
|
|
|
let item = {
|
|
|
customerId: customerId,
|
|
|
contractIds: contractIds,
|
|
@@ -936,10 +714,7 @@ const handleClickPacking = () => {
|
|
|
isShow: false,
|
|
|
};
|
|
|
formData.data.packDetailList.push(item);
|
|
|
- handleChangePackQuantity(
|
|
|
- item.packQuantity,
|
|
|
- formData.data.packDetailList.length - 1
|
|
|
- );
|
|
|
+ handleChangePackQuantity(item.packQuantity, formData.data.packDetailList.length - 1);
|
|
|
tableDom.value.clearSelection();
|
|
|
selectProductData.value = [];
|
|
|
table.value.clearSelection();
|
|
@@ -950,23 +725,20 @@ const handleClickPacking = () => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
const handleChangePackQuantity = (val, index) => {
|
|
|
const obj = {};
|
|
|
for (let i = 0; i < formData.data.contractProductData.length; i++) {
|
|
|
const e = formData.data.contractProductData[i];
|
|
|
e.index = i;
|
|
|
// 唯一:合同id+产品id+产品索引
|
|
|
- obj[e.contractId + "_" + e.productId + "_" + i] =
|
|
|
- Number(e.cpQuantity) - Number(e.sumPackQuantity);
|
|
|
+ obj[e.contractId + "_" + e.productId + "_" + i] = Number(e.cpQuantity) - Number(e.sumPackQuantity);
|
|
|
}
|
|
|
// 计算数量 即装箱数量 * 箱数 新增字段放在最外层
|
|
|
for (let i = 0; i < formData.data.packDetailList.length; i++) {
|
|
|
const ele = formData.data.packDetailList[i];
|
|
|
for (let j = 0; j < ele.packDetailProductList.length; j++) {
|
|
|
const jele = ele.packDetailProductList[j];
|
|
|
- ele[jele.contractId + "_" + jele.productId + "_" + jele.index] =
|
|
|
- Number(ele.packQuantity) * jele.quantity;
|
|
|
+ ele[jele.contractId + "_" + jele.productId + "_" + jele.index] = Number(ele.packQuantity) * jele.quantity;
|
|
|
}
|
|
|
}
|
|
|
// 计算新的待装箱数量
|
|
@@ -996,7 +768,6 @@ const handleChangePackQuantity = (val, index) => {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
const handleCustomPush = (index) => {
|
|
|
formData.data.packDetailList[index].packDetailGoodsList.push({
|
|
|
unit: "",
|
|
@@ -1004,7 +775,6 @@ const handleCustomPush = (index) => {
|
|
|
remark: "",
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
const handleCustomRemove = (index, sonIndex) => {
|
|
|
formData.data.packDetailList[index].packDetailGoodsList.splice(sonIndex, 1);
|
|
|
};
|
|
@@ -1022,29 +792,22 @@ const getSelectData = () => {
|
|
|
};
|
|
|
const contractData = ref([]);
|
|
|
const handleChangeCustomer = (val) => {
|
|
|
- proxy
|
|
|
- .get(`/contract/getNoPackContractByCustomerId?customerId=${val}`)
|
|
|
- .then((res) => {
|
|
|
- contractData.value = res.data;
|
|
|
- formData.data.contractIds = [];
|
|
|
- });
|
|
|
+ proxy.get(`/contract/getNoPackContractByCustomerId?customerId=${val}`).then((res) => {
|
|
|
+ contractData.value = res.data;
|
|
|
+ formData.data.contractIds = [];
|
|
|
+ });
|
|
|
};
|
|
|
const handleChangeContract = (val) => {
|
|
|
const customerId = formData.data.customerId ? formData.data.customerId : "";
|
|
|
- proxy
|
|
|
- .get(
|
|
|
- `/contractProduct/getNoPackContractProductById?customerId=${customerId}&contractIds=${val}`
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
- formData.data.contractProductData = res.data.map((x) => ({
|
|
|
- ...x,
|
|
|
- waitQuantity: Number(x.cpQuantity) - Number(x.sumPackQuantity),
|
|
|
- quantity: null,
|
|
|
- }));
|
|
|
- handleChangePackQuantity();
|
|
|
- });
|
|
|
+ proxy.get(`/contractProduct/getNoPackContractProductById?customerId=${customerId}&contractIds=${val}`).then((res) => {
|
|
|
+ formData.data.contractProductData = res.data.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ waitQuantity: Number(x.cpQuantity) - Number(x.sumPackQuantity),
|
|
|
+ quantity: null,
|
|
|
+ }));
|
|
|
+ handleChangePackQuantity();
|
|
|
+ });
|
|
|
};
|
|
|
-
|
|
|
const getData = (data, type) => {
|
|
|
if (!data) return [];
|
|
|
const arr = data.split(",");
|
|
@@ -1061,7 +824,6 @@ const getData = (data, type) => {
|
|
|
return arrOne;
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
const handleClose = () => {
|
|
|
dialogVisible.value = false;
|
|
|
selectProductData.value = [];
|
|
@@ -1069,7 +831,7 @@ const handleClose = () => {
|
|
|
getSelectData();
|
|
|
getList();
|
|
|
</script>
|
|
|
-
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
|
.tenant {
|
|
|
padding: 20px;
|
|
@@ -1091,7 +853,6 @@ getList();
|
|
|
background-color: #fde6c8;
|
|
|
border: none;
|
|
|
}
|
|
|
-
|
|
|
.box {
|
|
|
padding: 15px;
|
|
|
background: #fde6c8;
|
|
@@ -1121,4 +882,4 @@ getList();
|
|
|
color: #0084ff;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|