|
@@ -57,7 +57,7 @@
|
|
|
<el-row style="margin-top: 20px; width: 100%">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="地址" prop="countryId">
|
|
|
- <el-select v-model="formData.data.countryId" placeholder="国家" filterable allow-create @change="(val) => changeSellAddress(val, '20')">
|
|
|
+ <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => changeSellAddress(val, '20')">
|
|
|
<el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -166,7 +166,7 @@
|
|
|
:style="index !== formData.data.purchaseProductList.length - 1 ? 'margin-bottom: 20px' : ''"
|
|
|
v-for="(item, index) in formData.data.purchaseProductList"
|
|
|
:key="item.dataResourceId">
|
|
|
- <div style="border: 1px solid #ccc; padding: 20px 10px; width: 100%">
|
|
|
+ <div style="border: 1px solid #ccc; padding: 20px 10px 0 10px; width: 100%">
|
|
|
<el-row style="width: 100%" :gutter="5" type="flex" align="middle">
|
|
|
<el-col :span="2" style="text-align: center">
|
|
|
<img v-if="item.fileUrl" :src="item.fileUrl" class="pic" @click="onPicture(item.fileUrl)" />
|
|
@@ -187,93 +187,86 @@
|
|
|
<el-button type="primary" text @click="handleHandover(item, index)">编辑备注</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
- <el-button type="primary" text @click="handleHandover(item, index)">添加配件</el-button>
|
|
|
+ <el-button type="primary" text @click="handleMaterial(index)">添加配件</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
<span>金额小计: {{ item.amount }}</span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <!-- <div style="width: 80px">
|
|
|
- <div v-if="item.fileUrl">
|
|
|
- </div>
|
|
|
+ <el-collapse v-model="item.activeName" class="hideCollapse" accordion>
|
|
|
+ <el-collapse-item title="" :name="true">
|
|
|
+ <div style="padding: 0 40px">
|
|
|
+ <el-table :data="item.purchaseProductMountingsList" style="width: 100%">
|
|
|
+ <el-table-column label="图片" align="center" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <img v-if="row.fileUrl" :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="类型" align="center" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div>{{ dictValueLabel(row.productType, productType) }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="产品名称" prop="productName" min-width="180" />
|
|
|
+ <el-table-column label="尺寸" prop="productModel" min-width="140" />
|
|
|
+ <el-table-column label="单价" width="140">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%" class="removePadding">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'purchaseProductList.' + index + '.purchaseProductMountingsList.' + $index + '.price'"
|
|
|
+ :rules="rules.price"
|
|
|
+ :inline-message="true"
|
|
|
+ @change="
|
|
|
+ () => {
|
|
|
+ return changeProductMaterial(index, $index);
|
|
|
+ }
|
|
|
+ ">
|
|
|
+ <el-input-number v-model="row.price" placeholder="请输入单价" :precision="2" :controls="false" :min="0" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="数量" width="140">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%" class="removePadding">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'purchaseProductList.' + index + '.purchaseProductMountingsList.' + $index + '.quantity'"
|
|
|
+ :rules="rules.quantity"
|
|
|
+ :inline-message="true"
|
|
|
+ @change="
|
|
|
+ () => {
|
|
|
+ return changeProductMaterial(index, $index);
|
|
|
+ }
|
|
|
+ ">
|
|
|
+ <el-input-number v-model="row.quantity" placeholder="请输入数量" :precision="0" :controls="false" :min="0" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="金额" prop="amount" width="100" />
|
|
|
+ <el-table-column label="操作" align="center" width="80" fixed="right">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" v-if="$index !== 0" link @click="handleRemove(index, $index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ <div style="text-align: center; margin-top: -18px">
|
|
|
+ <el-button type="primary" @click="item.activeName = !item.activeName" style="margin-bottom: -28px" text>
|
|
|
+ <span v-if="item.activeName">
|
|
|
+ <span style="vertical-align: middle">收起明细</span>
|
|
|
+ <el-icon style="margin-left: 8px; transform: rotate(-90deg); vertical-align: middle"><DArrowRight /></el-icon>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <span style="vertical-align: middle">查看明细</span>
|
|
|
+ <el-icon style="margin-left: 8px; transform: rotate(90deg); vertical-align: middle"><DArrowRight /></el-icon>
|
|
|
+ </span>
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
- <div ></div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!--<el-table :data="formData.data.purchaseProductList" style="width: 100%; margin-top: 16px">
|
|
|
- <el-table-column label="商品图片" width="80">
|
|
|
- <template #default="{ row }">
|
|
|
- <div v-if="row.productId">
|
|
|
- <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
|
- </div>
|
|
|
- <div v-else></div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="商品名称" min-width="180">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- <!~~ <el-form-item
|
|
|
- :prop="'purchaseProductList.' + $index + '.productName'"
|
|
|
- :rules="rules.productName"
|
|
|
- :inline-message="true"
|
|
|
- class="shrinkPadding">
|
|
|
- <el-input v-model="row.productName" placeholder="请输入商品名称" />
|
|
|
- </el-form-item> ~~>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="尺寸 cm*cm*cm" width="140">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- <!~~ <el-form-item
|
|
|
- :prop="'purchaseProductList.' + $index + '.productModel'"
|
|
|
- :rules="rules.productModel"
|
|
|
- :inline-message="true"
|
|
|
- class="shrinkPadding">
|
|
|
- <el-input v-model="row.productModel" placeholder="请输入" />
|
|
|
- </el-form-item> ~~>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="数量" width="130">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- <el-form-item :prop="'purchaseProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" class="shrinkPadding">
|
|
|
- <el-input-number
|
|
|
- v-model="row.quantity"
|
|
|
- placeholder="请输入"
|
|
|
- style="width: 100%"
|
|
|
- :precision="0"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- @change="calculationAmount()" />
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="单价" width="140">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true" class="shrinkPadding">
|
|
|
- <el-input-number
|
|
|
- v-model="row.price"
|
|
|
- placeholder="请输入"
|
|
|
- style="width: 100%"
|
|
|
- :precision="2"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- @change="calculationAmount()" />
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="amount" label="金额" width="130" />
|
|
|
- <el-table-column label="操作" width="60" align="center" fixed="right">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <el-button type="primary" link @click="handleRemove($index, row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>-->
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #otherCharge>
|
|
@@ -301,15 +294,13 @@
|
|
|
<el-table-column label="金额" width="130">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item :prop="'purchaseProjectList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true" class="shrinkPadding">
|
|
|
- <el-input-number
|
|
|
- v-model="row.amount"
|
|
|
- placeholder="请输入金额"
|
|
|
- style="width: 100%"
|
|
|
- :precision="2"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- @change="totalAmount()" />
|
|
|
+ <el-form-item
|
|
|
+ :prop="'purchaseProjectList.' + $index + '.amount'"
|
|
|
+ :rules="rules.amount"
|
|
|
+ :inline-message="true"
|
|
|
+ class="shrinkPadding"
|
|
|
+ @change="changeProject">
|
|
|
+ <el-input-number v-model="row.amount" placeholder="请输入金额" style="width: 100%" :precision="2" :controls="false" :min="0" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -355,27 +346,20 @@
|
|
|
<el-table :data="formData.data.purchaseArrivalList" style="width: 100%; margin-top: 16px">
|
|
|
<el-table-column prop="code" label="商品编码" width="120" />
|
|
|
<el-table-column prop="productName" label="商品名称" />
|
|
|
- <el-table-column label="出货日期" width="220">
|
|
|
+ <el-table-column label="到货日期" width="220">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'purchaseArrivalList.' + $index + '.arrivalTime'" :rules="rules.arrivalTime" :inline-message="true">
|
|
|
- <el-date-picker v-model="row.arrivalTime" type="date" placeholder="请选择出货日期" value-format="YYYY-MM-DD" />
|
|
|
+ <el-date-picker v-model="row.arrivalTime" type="date" placeholder="请选择到货日期" value-format="YYYY-MM-DD" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="数量" width="160">
|
|
|
+ <el-table-column label="到货数量" width="160">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'purchaseArrivalList.' + $index + '.quantity'" :inline-message="true">
|
|
|
- <el-input-number
|
|
|
- v-model="row.quantity"
|
|
|
- placeholder="请输入数量"
|
|
|
- style="width: 100%"
|
|
|
- :precision="0"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- @change="calculationAmount()" />
|
|
|
+ <el-input-number v-model="row.quantity" placeholder="请输入到货数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -391,8 +375,8 @@
|
|
|
</template>
|
|
|
</byForm>
|
|
|
|
|
|
- <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="公司产品库" width="90%" append-to-body>
|
|
|
- <CompanyProduct :selectStatus="true"></CompanyProduct>
|
|
|
+ <el-dialog v-if="openMaterialCompany" v-model="openMaterialCompany" title="公司产品库" width="90%" append-to-body>
|
|
|
+ <ProductMaterial :selectStatus="true" @selectMaterial="selectMaterial"></ProductMaterial>
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog title="备注" v-if="openHandover" v-model="openHandover" width="800">
|
|
@@ -427,7 +411,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
-import CompanyProduct from "@/views/EHSD/productLibrary/companyProduct/index";
|
|
|
+import ProductMaterial from "@/views/product/material/index";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import selectCity from "@/components/selectCity/index.vue";
|
|
|
import Editor from "@/components/Editor/index.vue";
|
|
@@ -441,7 +425,7 @@ const supplierList = ref([]);
|
|
|
const countryData = ref([]);
|
|
|
const provinceData = ref([]);
|
|
|
const cityData = ref([]);
|
|
|
-const openProductCompany = ref(false);
|
|
|
+const openMaterialCompany = ref(false);
|
|
|
const formData = reactive({
|
|
|
data: {
|
|
|
deliveryType: 1,
|
|
@@ -467,6 +451,16 @@ const deliveryType = ref([
|
|
|
value: 3,
|
|
|
},
|
|
|
]);
|
|
|
+const productType = ref([
|
|
|
+ {
|
|
|
+ label: "产品",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "物料",
|
|
|
+ value: 2,
|
|
|
+ },
|
|
|
+]);
|
|
|
const formOption = reactive({
|
|
|
inline: true,
|
|
|
labelWidth: 100,
|
|
@@ -622,8 +616,23 @@ const changeBuyCorporation = (val) => {
|
|
|
};
|
|
|
const changeAddress = () => {
|
|
|
if (formData.data.deliveryType === 1) {
|
|
|
- formData.data.address =
|
|
|
- formData.data.buyCountryName + ", " + formData.data.buyProvinceName + ", " + formData.data.buyCityName + "," + formData.data.buyAddress;
|
|
|
+ let buyCountryName = "";
|
|
|
+ if (formData.data.buyCountryName) {
|
|
|
+ buyCountryName = formData.data.buyCountryName;
|
|
|
+ }
|
|
|
+ let buyProvinceName = "";
|
|
|
+ if (formData.data.buyProvinceName) {
|
|
|
+ buyProvinceName = formData.data.buyProvinceName;
|
|
|
+ }
|
|
|
+ let buyCityName = "";
|
|
|
+ if (formData.data.buyCityName) {
|
|
|
+ buyCityName = formData.data.buyCityName;
|
|
|
+ }
|
|
|
+ let buyAddress = "";
|
|
|
+ if (formData.data.buyAddress) {
|
|
|
+ buyAddress = formData.data.buyAddress;
|
|
|
+ }
|
|
|
+ formData.data.address = buyCountryName + ", " + buyProvinceName + ", " + buyCityName + "," + buyAddress;
|
|
|
} else if (formData.data.deliveryType === 2) {
|
|
|
let countryName = "";
|
|
|
if (formData.data.countryId) {
|
|
@@ -634,11 +643,19 @@ const changeAddress = () => {
|
|
|
if (formData.data.provinceId) {
|
|
|
let data = provinceData.value.filter((item) => item.id === formData.data.provinceId);
|
|
|
if (data && data.length > 0) provinceName = data[0].name;
|
|
|
+ } else {
|
|
|
+ if (formData.data.provinceName) {
|
|
|
+ provinceName = formData.data.provinceName;
|
|
|
+ }
|
|
|
}
|
|
|
let cityName = "";
|
|
|
if (formData.data.cityId) {
|
|
|
let data = cityData.value.filter((item) => item.id === formData.data.cityId);
|
|
|
if (data && data.length > 0) cityName = data[0].name;
|
|
|
+ } else {
|
|
|
+ if (formData.data.cityName) {
|
|
|
+ cityName = formData.data.cityName;
|
|
|
+ }
|
|
|
}
|
|
|
let sellAddress = "";
|
|
|
if (formData.data.sellAddress) {
|
|
@@ -718,44 +735,88 @@ const changeSupplier = (val) => {
|
|
|
const onPicture = (path) => {
|
|
|
window.open(path, "_blank");
|
|
|
};
|
|
|
-const handleRemove = async (index, row) => {
|
|
|
- formData.data.purchaseArrivalList = formData.data.purchaseArrivalList.filter((item) => item.productId !== row.productId);
|
|
|
- await formData.data.purchaseProductList.splice(index, 1);
|
|
|
- totalAmount();
|
|
|
-};
|
|
|
-const calculationAmount = () => {
|
|
|
+const changeProject = () => {
|
|
|
nextTick(() => {
|
|
|
- if (formData.data.purchaseProductList && formData.data.purchaseProductList.length > 0) {
|
|
|
- for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
- let money = 0;
|
|
|
- if (formData.data.purchaseProductList[i].quantity && formData.data.purchaseProductList[i].price) {
|
|
|
- money = parseFloat(Number(formData.data.purchaseProductList[i].quantity) * Number(formData.data.purchaseProductList[i].price)).toFixed(2);
|
|
|
- }
|
|
|
- formData.data.purchaseProductList[i].amount = money;
|
|
|
- }
|
|
|
- }
|
|
|
- nextTick(() => {
|
|
|
- totalAmount();
|
|
|
- });
|
|
|
+ calculationAllAmount();
|
|
|
});
|
|
|
};
|
|
|
-const totalAmount = () => {
|
|
|
- let money = 0;
|
|
|
+const calculationAllAmount = () => {
|
|
|
+ let amount = 0;
|
|
|
if (formData.data.purchaseProductList && formData.data.purchaseProductList.length > 0) {
|
|
|
for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
if (formData.data.purchaseProductList[i].amount) {
|
|
|
- money = parseFloat(Number(money) + Number(formData.data.purchaseProductList[i].amount)).toFixed(2);
|
|
|
+ amount = Number(parseFloat(Number(amount) + Number(formData.data.purchaseProductList[i].amount)).toFixed(2));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (formData.data.purchaseProjectList && formData.data.purchaseProjectList.length > 0) {
|
|
|
for (let i = 0; i < formData.data.purchaseProjectList.length; i++) {
|
|
|
if (formData.data.purchaseProjectList[i].amount) {
|
|
|
- money = parseFloat(Number(money) + Number(formData.data.purchaseProjectList[i].amount)).toFixed(2);
|
|
|
+ amount = Number(parseFloat(Number(amount) + Number(formData.data.purchaseProjectList[i].amount)).toFixed(2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.data.amount = amount;
|
|
|
+};
|
|
|
+const calculationProductAmount = (index) => {
|
|
|
+ if (
|
|
|
+ formData.data.purchaseProductList &&
|
|
|
+ formData.data.purchaseProductList.length > 0 &&
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList &&
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList.length > 0
|
|
|
+ ) {
|
|
|
+ let amount = 0;
|
|
|
+ for (let i = 0; i < formData.data.purchaseProductList[index].purchaseProductMountingsList.length; i++) {
|
|
|
+ if (formData.data.purchaseProductList[index].purchaseProductMountingsList[i].amount) {
|
|
|
+ amount = Number(parseFloat(Number(amount) + Number(formData.data.purchaseProductList[index].purchaseProductMountingsList[i].amount)).toFixed(2));
|
|
|
}
|
|
|
}
|
|
|
+ formData.data.purchaseProductList[index].amount = amount;
|
|
|
+ let price = 0;
|
|
|
+ if (formData.data.purchaseProductList[index].quantity && amount) {
|
|
|
+ price = Number(parseFloat(Number(amount) / Number(formData.data.purchaseProductList[index].quantity)).toFixed(4));
|
|
|
+ }
|
|
|
+ formData.data.purchaseProductList[index].price = price;
|
|
|
}
|
|
|
- formData.data.amount = money;
|
|
|
+ nextTick(() => {
|
|
|
+ calculationAllAmount();
|
|
|
+ });
|
|
|
+};
|
|
|
+const changeProductMaterial = (index, indexTwo) => {
|
|
|
+ nextTick(() => {
|
|
|
+ if (
|
|
|
+ formData.data.purchaseProductList &&
|
|
|
+ formData.data.purchaseProductList.length > 0 &&
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList &&
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList.length > 0
|
|
|
+ ) {
|
|
|
+ if (indexTwo === 0 && formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].quantity) {
|
|
|
+ formData.data.purchaseProductList[index].quantity = formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].quantity;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].quantity &&
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].price
|
|
|
+ ) {
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].amount = Number(
|
|
|
+ parseFloat(
|
|
|
+ Number(formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].quantity) *
|
|
|
+ Number(formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].price)
|
|
|
+ ).toFixed(2)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ formData.data.purchaseProductList[index].purchaseProductMountingsList[indexTwo].amount = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ nextTick(() => {
|
|
|
+ calculationProductAmount(index);
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+const handleRemove = async (index, indexTwo) => {
|
|
|
+ await formData.data.purchaseProductList[index].purchaseProductMountingsList.splice(indexTwo, 1);
|
|
|
+ nextTick(() => {
|
|
|
+ calculationProductAmount(index);
|
|
|
+ });
|
|
|
};
|
|
|
const clickAdd = () => {
|
|
|
if (formData.data.purchaseProjectList && formData.data.purchaseProjectList.length > 0) {
|
|
@@ -770,7 +831,9 @@ const clickAdd = () => {
|
|
|
};
|
|
|
const handleDelete = async (index) => {
|
|
|
await formData.data.purchaseProjectList.splice(index, 1);
|
|
|
- totalAmount();
|
|
|
+ nextTick(() => {
|
|
|
+ calculationAllAmount();
|
|
|
+ });
|
|
|
};
|
|
|
const querySearch = (queryString, callback) => {
|
|
|
proxy.post("/quotationPay/page", { payName: queryString }).then((res) => {
|
|
@@ -799,7 +862,7 @@ const handleSubmit = async () => {
|
|
|
quantity = parseFloat(Number(quantity) + Number(data[j].quantity));
|
|
|
}
|
|
|
if (quantity > formData.data.purchaseProductList[i].quantity) {
|
|
|
- ElMessage("出货数量不能大于商品数量");
|
|
|
+ ElMessage("到货数量不能大于采购数量");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -832,22 +895,47 @@ onMounted(() => {
|
|
|
productId: item.productId,
|
|
|
productName: item.productName,
|
|
|
productModel: item.productModel,
|
|
|
- quantity: "",
|
|
|
+ quantity: item.expendQuantity,
|
|
|
price: "",
|
|
|
amount: "",
|
|
|
remark: "",
|
|
|
json: "",
|
|
|
+ fileUrl: "",
|
|
|
dataResource: props.queryData.type,
|
|
|
dataResourceId: item.id,
|
|
|
- purchaseProductMountingsList: [],
|
|
|
+ purchaseProductMountingsList: [
|
|
|
+ {
|
|
|
+ productId: item.productId,
|
|
|
+ productType: 1,
|
|
|
+ productName: item.productName,
|
|
|
+ productModel: item.productModel,
|
|
|
+ quantity: item.expendQuantity,
|
|
|
+ price: undefined,
|
|
|
+ amount: "",
|
|
|
+ remark: "",
|
|
|
+ json: "",
|
|
|
+ fileUrl: "",
|
|
|
+ activeName: false,
|
|
|
+ },
|
|
|
+ ],
|
|
|
fileList: [],
|
|
|
};
|
|
|
});
|
|
|
+ formData.data.purchaseArrivalList = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ code: item.productCode,
|
|
|
+ productId: item.productId,
|
|
|
+ productName: item.productName,
|
|
|
+ arrivalTime: "",
|
|
|
+ quantity: undefined,
|
|
|
+ };
|
|
|
+ });
|
|
|
let fileIds = formData.data.purchaseProductList.map((item) => item.productId);
|
|
|
proxy.post("/fileInfo/getList", { businessIdList: fileIds }).then((resFile) => {
|
|
|
for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
if (resFile[formData.data.purchaseProductList[i].productId] && resFile[formData.data.purchaseProductList[i].productId].length > 0) {
|
|
|
formData.data.purchaseProductList[i].fileUrl = resFile[formData.data.purchaseProductList[i].productId][0].fileUrl;
|
|
|
+ formData.data.purchaseProductList[i].purchaseProductMountingsList[0].fileUrl = resFile[formData.data.purchaseProductList[i].productId][0].fileUrl;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -942,6 +1030,10 @@ const handleHandover = (row, index) => {
|
|
|
productIndex.value = index;
|
|
|
openHandover.value = true;
|
|
|
};
|
|
|
+const handleMaterial = (index) => {
|
|
|
+ productIndex.value = index;
|
|
|
+ openMaterialCompany.value = true;
|
|
|
+};
|
|
|
const uploadFile = async (file) => {
|
|
|
const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
uploadData.value = res.uploadBody;
|
|
@@ -982,6 +1074,37 @@ const submitHandoverForm = () => {
|
|
|
formData.data.purchaseProductList[productIndex.value].remark = productRow.data.remark;
|
|
|
openHandover.value = false;
|
|
|
};
|
|
|
+const selectMaterial = (goods) => {
|
|
|
+ if (goods && goods.id) {
|
|
|
+ let data = formData.data.purchaseProductList[productIndex.value].purchaseProductMountingsList.filter((item) => item.productId === goods.id);
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ return ElMessage("该物料已添加");
|
|
|
+ }
|
|
|
+ let fileUrl = "";
|
|
|
+ if (goods.fileList && goods.fileList.length > 0) {
|
|
|
+ fileUrl = goods.fileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ formData.data.purchaseProductList[productIndex.value].purchaseProductMountingsList.push({
|
|
|
+ productId: goods.id,
|
|
|
+ productType: 2,
|
|
|
+ productName: goods.name,
|
|
|
+ productModel: goods.spec,
|
|
|
+ quantity: undefined,
|
|
|
+ price: undefined,
|
|
|
+ amount: "",
|
|
|
+ remark: "",
|
|
|
+ json: "",
|
|
|
+ fileUrl: fileUrl,
|
|
|
+ activeName: false,
|
|
|
+ });
|
|
|
+ ElMessage({
|
|
|
+ message: "添加成功!",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return ElMessage("选择错误");
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -999,7 +1122,7 @@ const submitHandoverForm = () => {
|
|
|
padding-right: 0 !important;
|
|
|
}
|
|
|
.hideCollapse {
|
|
|
- margin-top: -62px;
|
|
|
+ margin-top: -28px;
|
|
|
border: 0 !important;
|
|
|
}
|
|
|
::v-deep(.el-collapse-item__arrow) {
|
|
@@ -1011,6 +1134,9 @@ const submitHandoverForm = () => {
|
|
|
::v-deep(.el-collapse-item__header) {
|
|
|
border: 0 !important;
|
|
|
}
|
|
|
+::v-deep(.el-collapse-item__content) {
|
|
|
+ padding-bottom: 8px !important;
|
|
|
+}
|
|
|
.pic {
|
|
|
object-fit: contain;
|
|
|
width: 50px;
|
|
@@ -1018,4 +1144,9 @@ const submitHandoverForm = () => {
|
|
|
cursor: pointer;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
+::v-deep(.removePadding) {
|
|
|
+ .el-form-item {
|
|
|
+ padding-right: 0 !important;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|