|
@@ -6,58 +6,18 @@
|
|
|
<span style="font-size: 18px; font-weight: 700" v-if="formData.data.wlnCode"> ({{ formData.data.wlnCode }})</span>
|
|
|
</div>
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
- <template #deliveryAddress>
|
|
|
+ <template #type>
|
|
|
<div style="width: 100%">
|
|
|
- <el-row>
|
|
|
- <el-col :span="3">
|
|
|
- <el-form-item label-width="0" prop="province" style="width: 100%">
|
|
|
- <el-input v-model="formData.data.province" placeholder="请输入省" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="3">
|
|
|
- <el-form-item label-width="0" prop="city" style="width: 100%">
|
|
|
- <el-input v-model="formData.data.city" placeholder="请输入市" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="3">
|
|
|
- <el-form-item label-width="0" prop="county" style="width: 100%">
|
|
|
- <el-input v-model="formData.data.county" placeholder="请输入区/县" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="11">
|
|
|
- <el-form-item label-width="0" prop="detailedAddress" style="width: 100%">
|
|
|
- <el-input v-model="formData.data.detailedAddress" placeholder="请输入详细地址" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label-width="0" prop="postcode" style="width: 100%">
|
|
|
- <el-input v-model="formData.data.postcode" placeholder="请输入邮编" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-radio-group v-model="formData.data.type">
|
|
|
+ <el-radio v-for="(itemType, index) in typeList" :key="index" :label="itemType.dictKey">{{ itemType.dictValue }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #consignee>
|
|
|
+ <template #departmentId>
|
|
|
<div style="width: 100%">
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label-width="0" prop="consignee" style="width: 100%">
|
|
|
- <el-input v-model="formData.data.consignee" placeholder="请输入联系人" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label-width="0" prop="consigneeNumber" style="width: 100%">
|
|
|
- <el-input v-model="formData.data.consigneeNumber" placeholder="请输入联系电话" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label-width="0" prop="departmentId" style="width: 100%">
|
|
|
- <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable style="width: 100%">
|
|
|
- <el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable style="width: 100%">
|
|
|
+ <el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #orderSkuList>
|
|
@@ -95,8 +55,7 @@
|
|
|
style="width: 100%"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
- :precision="0"
|
|
|
- @change="changeQuantity(index)" />
|
|
|
+ :precision="0" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div style="line-height: 35px">
|
|
@@ -125,7 +84,7 @@
|
|
|
</div>
|
|
|
<div style="line-height: 35px">
|
|
|
<span style="color: black; font-weight: 700">小计: </span>
|
|
|
- <span>{{ item.subtotal }}</span>
|
|
|
+ <span>{{ getSubtotal(item) }}</span>
|
|
|
</div>
|
|
|
<div style="line-height: 35px">
|
|
|
<span style="width: 37px; color: black; font-weight: 700">打印: </span>
|
|
@@ -144,31 +103,39 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="产品图稿" width="400">
|
|
|
<template #default="{ row }">
|
|
|
- <el-form-item :prop="'orderSkuList.' + index + '.blueprint'">
|
|
|
- <div style="display: flex; width: 100%">
|
|
|
- <div style="width: 65px">设计图:</div>
|
|
|
- <div style="width: calc(100% - 65px)">
|
|
|
- <el-image
|
|
|
- fit="scale-down"
|
|
|
- style="width: 148px; height: 148px; margin-right: 10px"
|
|
|
- v-if="row.blueprint"
|
|
|
- :src="row.blueprint"
|
|
|
- @click="openFile(row.blueprint)" />
|
|
|
- </div>
|
|
|
+ <div style="display: flex; width: 100%">
|
|
|
+ <div style="width: 80px">设计图:</div>
|
|
|
+ <div style="width: calc(100% - 80px)">
|
|
|
+ <el-image
|
|
|
+ fit="scale-down"
|
|
|
+ style="width: 148px; height: 148px; margin-right: 10px"
|
|
|
+ v-if="row.blueprint"
|
|
|
+ :src="row.blueprint"
|
|
|
+ @click="openFile(row.blueprint)" />
|
|
|
</div>
|
|
|
- <div style="display: flex; margin-top: 20px; width: 100%">
|
|
|
- <div style="width: 65px">图稿文件:</div>
|
|
|
- <div style="width: calc(100% - 65px)">
|
|
|
- <a
|
|
|
- style="color: #409eff; cursor: pointer; word-break: break-all; margin-right: 10px"
|
|
|
- @click="openFile(row.productionDocument)"
|
|
|
- v-if="row.productionDocument">
|
|
|
- {{ row.productionDocument }}
|
|
|
- </a>
|
|
|
- <!-- <el-button type="primary" style="transform: translateY(-2px)" @click="clickDrawingFile(index)" text>选择文件</el-button> -->
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; margin-top: 20px; width: 100%">
|
|
|
+ <div style="width: 80px">图稿文件:</div>
|
|
|
+ <div style="width: calc(100% - 80px)">
|
|
|
+ <a
|
|
|
+ style="color: #409eff; cursor: pointer; word-break: break-all; margin-right: 10px"
|
|
|
+ @click="openFile(row.productionDocument)"
|
|
|
+ v-if="row.productionDocument">
|
|
|
+ {{ row.productionDocument }}
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; margin-top: 20px; width: 100%">
|
|
|
+ <div style="width: 80px">不干胶图片:</div>
|
|
|
+ <div style="width: calc(100% - 80px)">
|
|
|
+ <a
|
|
|
+ style="color: #409eff; cursor: pointer; word-break: break-all; margin-right: 10px"
|
|
|
+ @click="openFile(row.selfAdhesiveStickerFile.fileUrl)"
|
|
|
+ v-if="row.selfAdhesiveStickerFile && row.selfAdhesiveStickerFile.fileName">
|
|
|
+ {{ row.selfAdhesiveStickerFile.fileName }}
|
|
|
+ </a>
|
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="包材配件/单品" min-width="400">
|
|
@@ -195,16 +162,19 @@
|
|
|
placeholder="数量"
|
|
|
style="width: 100%"
|
|
|
:controls="false"
|
|
|
- :min="0"
|
|
|
- @change="changeBOMQuantity(index)" />
|
|
|
+ :min="0" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="名称" prop="bomSpecName" min-width="150" />
|
|
|
- <el-table-column label="总量" prop="allQuantity" width="80" />
|
|
|
+ <el-table-column label="总量" width="80">
|
|
|
+ <template #default="props">
|
|
|
+ {{ computeQuantity(index, props.$index) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="小计¥" width="100">
|
|
|
<template #default="props">
|
|
|
- {{ moneyFormat(props.row.allUnitPrice, 2) }}
|
|
|
+ {{ moneyFormat(computeMoney(index, props.$index), 2) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -241,21 +211,39 @@
|
|
|
<template #totalMonet>
|
|
|
<div style="width: 100%; margin-left: 30px">
|
|
|
<div>
|
|
|
- <span style="font-weight: 700; color: #6c88f1">产品总金额: ¥{{ moneyFormat(formData.data.productTotalAmount, 2) }}</span>
|
|
|
- <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">定制加工费: ¥{{ moneyFormat(formData.data.customProcessingFee, 2) }}</span>
|
|
|
- <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">代发费: ¥{{ moneyFormat(formData.data.lssueFee, 2) }}</span>
|
|
|
- <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">快递包材费: ¥{{ moneyFormat(formData.data.deliveryMaterialsFee, 2) }}</span>
|
|
|
- <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">包装人工费: ¥{{ moneyFormat(formData.data.packingLabor, 2) }}</span>
|
|
|
- <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">包材费: ¥{{ moneyFormat(formData.data.packagingMaterialCost, 2) }}</span>
|
|
|
- <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">管理费: ¥{{ moneyFormat(formData.data.managementFee, 2) }}</span>
|
|
|
+ <span style="font-weight: 700; color: #6c88f1">产品总金额: ¥{{ moneyFormat(calculatedAmount("unitPrice"), 2) }}</span>
|
|
|
+ <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">
|
|
|
+ 定制加工费: ¥{{ moneyFormat(calculatedAmount("customProcessingFee"), 2) }}
|
|
|
+ </span>
|
|
|
+ <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">代发费: ¥{{ moneyFormat(calculatedAmount("lssueFee"), 2) }}</span>
|
|
|
+ <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">
|
|
|
+ 快递包材费: ¥{{ moneyFormat(calculatedAmount("deliveryMaterialsFee"), 2) }}
|
|
|
+ </span>
|
|
|
+ <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">包装人工费: ¥{{ moneyFormat(calculatedAmount("packingLabor"), 2) }}</span>
|
|
|
+ <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">包材费: ¥{{ moneyFormat(calculatedPackagingMaterialCost(), 2) }}</span>
|
|
|
+ <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">管理费: ¥{{ moneyFormat(calculatedAmount("managementFee"), 2) }}</span>
|
|
|
</div>
|
|
|
<div style="padding: 8px 0 0 0">
|
|
|
- <span style="font-weight: 700; color: red">订单总金额(含税): ¥{{ moneyFormat(formData.data.totalAmount, 2) }}</span>
|
|
|
+ <span style="font-weight: 700; color: red">订单总金额(含税): ¥{{ moneyFormat(calculatedTotalAmount(), 2) }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #remark>
|
|
|
+ <template #attachments>
|
|
|
<div style="width: 100%">
|
|
|
+ <el-upload
|
|
|
+ v-model:fileList="fileList"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadFileData"
|
|
|
+ multiple
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ :on-success="onSuccessFile"
|
|
|
+ :on-preview="onPreviewFile">
|
|
|
+ <el-button style="background: #20b2aa; color: #fff; border: 1px solid #20b2aa">上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #remark>
|
|
|
+ <div style="margin: 0 2vw">
|
|
|
<div v-html="getStyle(formData.data.remark)"></div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -288,32 +276,37 @@ const formOption = reactive({
|
|
|
const formData = reactive({
|
|
|
data: {
|
|
|
remark: "",
|
|
|
+ type: 1,
|
|
|
orderSkuList: [],
|
|
|
+ fileList: [],
|
|
|
},
|
|
|
});
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
- route.query && route.query.detailId
|
|
|
- ? {}
|
|
|
- : {
|
|
|
+ formData.data.source !== 2
|
|
|
+ ? {
|
|
|
type: "title",
|
|
|
- title: "地址",
|
|
|
+ title: "类型",
|
|
|
label: "",
|
|
|
- },
|
|
|
- route.query && route.query.detailId
|
|
|
- ? {}
|
|
|
- : {
|
|
|
+ }
|
|
|
+ : {},
|
|
|
+ formData.data.source !== 2
|
|
|
+ ? {
|
|
|
type: "slot",
|
|
|
- slotName: "deliveryAddress",
|
|
|
- label: "收货地址",
|
|
|
- },
|
|
|
- route.query && route.query.detailId
|
|
|
- ? {}
|
|
|
- : {
|
|
|
+ prop: "type",
|
|
|
+ slotName: "type",
|
|
|
+ label: "订单类型",
|
|
|
+ }
|
|
|
+ : {},
|
|
|
+ formData.data.source !== 2
|
|
|
+ ? {
|
|
|
type: "slot",
|
|
|
- slotName: "consignee",
|
|
|
- label: "收货人",
|
|
|
- },
|
|
|
+ prop: "departmentId",
|
|
|
+ slotName: "departmentId",
|
|
|
+ label: "事业部",
|
|
|
+ itemWidth: 25,
|
|
|
+ }
|
|
|
+ : {},
|
|
|
{
|
|
|
type: "title",
|
|
|
title: "产品",
|
|
@@ -370,16 +363,16 @@ const formConfig = computed(() => {
|
|
|
prop: "totalMonet",
|
|
|
slotName: "totalMonet",
|
|
|
},
|
|
|
- // {
|
|
|
- // type: "title",
|
|
|
- // title: "附件",
|
|
|
- // label: "",
|
|
|
- // },
|
|
|
- // {
|
|
|
- // type: "slot",
|
|
|
- // slotName: "attachments",
|
|
|
- // label: "附件",
|
|
|
- // },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "附件",
|
|
|
+ label: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "attachments",
|
|
|
+ label: "附件",
|
|
|
+ },
|
|
|
{
|
|
|
type: "title",
|
|
|
title: "订单备注",
|
|
@@ -400,6 +393,8 @@ const rules = ref({
|
|
|
// expressDeliveryId: [{ required: true, message: "请选择快递", trigger: "change" }],
|
|
|
commercePlatform: [{ required: true, message: "请选择电商平台", trigger: "change" }],
|
|
|
quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+ type: [{ required: true, message: "请选择订单类型", trigger: "change" }],
|
|
|
+ departmentId: [{ required: true, message: "请选择事业部", trigger: "change" }],
|
|
|
});
|
|
|
const getDemandData = () => {
|
|
|
proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
@@ -456,61 +451,34 @@ const getOrderDetail = (parameter) => {
|
|
|
activeNames.value = allIndex;
|
|
|
formOption.disabled = true;
|
|
|
}
|
|
|
+ let list = [formData.data.id];
|
|
|
if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
|
|
|
- for (let i = 0; i < formData.data.orderSkuList.length; i++) {
|
|
|
- let subtotal = 0;
|
|
|
- let packagingMaterialCost = 0;
|
|
|
- if (formData.data.orderSkuList[i].quantity) {
|
|
|
- subtotal = Number(
|
|
|
- Math.round(
|
|
|
- (formData.data.orderSkuList[i].customProcessingFee +
|
|
|
- formData.data.orderSkuList[i].deliveryMaterialsFee +
|
|
|
- formData.data.orderSkuList[i].lssueFee +
|
|
|
- formData.data.orderSkuList[i].packingLabor +
|
|
|
- formData.data.orderSkuList[i].managementFee +
|
|
|
- formData.data.orderSkuList[i].unitPrice) *
|
|
|
- formData.data.orderSkuList[i].quantity *
|
|
|
- 100
|
|
|
- ) / 100
|
|
|
- );
|
|
|
- if (formData.data.orderSkuList[i].orderSkuBomList && formData.data.orderSkuList[i].orderSkuBomList.length > 0) {
|
|
|
- for (let j = 0; j < formData.data.orderSkuList[i].orderSkuBomList.length; j++) {
|
|
|
- let allQuantity = 0;
|
|
|
- let allUnitPrice = 0;
|
|
|
- if (formData.data.orderSkuList[i].orderSkuBomList[j].quantity) {
|
|
|
- allQuantity = Number(
|
|
|
- Math.round(formData.data.orderSkuList[i].orderSkuBomList[j].quantity * formData.data.orderSkuList[i].quantity * 100) / 100
|
|
|
- );
|
|
|
- if (formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice) {
|
|
|
- allUnitPrice = Number(
|
|
|
- Math.round(
|
|
|
- formData.data.orderSkuList[i].orderSkuBomList[j].quantity *
|
|
|
- formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice *
|
|
|
- formData.data.orderSkuList[i].quantity *
|
|
|
- 100
|
|
|
- ) / 100
|
|
|
- );
|
|
|
- packagingMaterialCost = Number(
|
|
|
- Math.round(
|
|
|
- (packagingMaterialCost +
|
|
|
- formData.data.orderSkuList[i].orderSkuBomList[j].quantity * formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice) *
|
|
|
- 100
|
|
|
- ) / 100
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- formData.data.orderSkuList[i].orderSkuBomList[j].allQuantity = allQuantity;
|
|
|
- formData.data.orderSkuList[i].orderSkuBomList[j].allUnitPrice = allUnitPrice;
|
|
|
- }
|
|
|
+ list = list.concat(formData.data.orderSkuList.map((item) => item.id));
|
|
|
+ proxy.post("/fileInfo/getList", { businessIdList: list }).then((fileObj) => {
|
|
|
+ if (fileObj[formData.data.id] && fileObj[formData.data.id].length > 0) {
|
|
|
+ let file = fileObj[formData.data.id].filter((item) => item.businessType == "0");
|
|
|
+ if (file && file.length > 0) {
|
|
|
+ fileList.value = file.map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ fileList.value = [];
|
|
|
}
|
|
|
}
|
|
|
- formData.data.orderSkuList[i].subtotal = subtotal;
|
|
|
- formData.data.orderSkuList[i].packagingMaterialCost = packagingMaterialCost;
|
|
|
- }
|
|
|
- }
|
|
|
- let list = [res.id];
|
|
|
- if (res.orderSkuList && res.orderSkuList.length > 0) {
|
|
|
- list = list.concat(res.orderSkuList.map((item) => item.id));
|
|
|
+ for (let i = 0; i < formData.data.orderSkuList.length; i++) {
|
|
|
+ if (fileObj[formData.data.orderSkuList[i].id] && fileObj[formData.data.orderSkuList[i].id].length > 0) {
|
|
|
+ formData.data.orderSkuList[i].selfAdhesiveStickerFile = {
|
|
|
+ id: fileObj[formData.data.orderSkuList[i].id][0].id,
|
|
|
+ fileName: fileObj[formData.data.orderSkuList[i].id][0].fileName,
|
|
|
+ fileUrl: fileObj[formData.data.orderSkuList[i].id][0].fileUrl,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -531,133 +499,123 @@ const printType = ref([
|
|
|
dictValue: "双面",
|
|
|
},
|
|
|
]);
|
|
|
-const changeQuantity = (index) => {
|
|
|
- if (formData.data.orderSkuList[index].quantity) {
|
|
|
- proxy
|
|
|
- .post("/orderInfo/getSkuSpecPrice", { skuSpecId: formData.data.orderSkuList[index].skuSpecId, quantity: formData.data.orderSkuList[index].quantity })
|
|
|
- .then((res) => {
|
|
|
- formData.data.orderSkuList[index].customProcessingFee = res.customProcessingFee;
|
|
|
- formData.data.orderSkuList[index].customProcessingType = res.customProcessingType;
|
|
|
- formData.data.orderSkuList[index].deliveryMaterialsFee = res.deliveryMaterialsFee;
|
|
|
- formData.data.orderSkuList[index].lssueFee = res.lssueFee;
|
|
|
- formData.data.orderSkuList[index].packingLabor = res.packingLabor;
|
|
|
- formData.data.orderSkuList[index].managementFee = res.managementFee;
|
|
|
- formData.data.orderSkuList[index].unitPrice = res.unitPrice;
|
|
|
- formData.data.orderSkuList[index].subtotal = Number(
|
|
|
- Math.round(
|
|
|
- (res.customProcessingFee + res.deliveryMaterialsFee + res.lssueFee + res.packingLabor + res.managementFee + res.unitPrice) *
|
|
|
- formData.data.orderSkuList[index].quantity *
|
|
|
- 100
|
|
|
- ) / 100
|
|
|
- );
|
|
|
- changeBOMQuantity(index);
|
|
|
- });
|
|
|
+const typeList = ref([
|
|
|
+ {
|
|
|
+ dictKey: 1,
|
|
|
+ dictValue: "自主订单",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 2,
|
|
|
+ dictValue: "委外订单",
|
|
|
+ },
|
|
|
+]);
|
|
|
+const changePrice = reactive({
|
|
|
+ data: {},
|
|
|
+});
|
|
|
+const computeQuantity = (index, indexSKU) => {
|
|
|
+ let quantity = 0;
|
|
|
+ if (formData.data.orderSkuList[index].quantity && formData.data.orderSkuList[index].orderSkuBomList[indexSKU].quantity) {
|
|
|
+ quantity = Number(
|
|
|
+ Math.round(formData.data.orderSkuList[index].orderSkuBomList[indexSKU].quantity * formData.data.orderSkuList[index].quantity * 100) / 100
|
|
|
+ );
|
|
|
}
|
|
|
+ return quantity;
|
|
|
};
|
|
|
-const changeBOMQuantity = (index) => {
|
|
|
- if (formData.data.orderSkuList[index].orderSkuBomList && formData.data.orderSkuList[index].orderSkuBomList.length > 0) {
|
|
|
- if (formData.data.orderSkuList[index].quantity) {
|
|
|
- formData.data.orderSkuList[index].orderSkuBomList = formData.data.orderSkuList[index].orderSkuBomList.map((item) => {
|
|
|
- let allQuantity = 0;
|
|
|
- let allUnitPrice = 0;
|
|
|
- if (item.quantity) {
|
|
|
- allQuantity = Number(Math.round(Number(item.quantity) * Number(formData.data.orderSkuList[index].quantity)));
|
|
|
- }
|
|
|
- if (item.unitPrice) {
|
|
|
- allUnitPrice = Number(Math.round(Number(item.unitPrice) * Number(allQuantity) * 100) / 100);
|
|
|
- }
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- allQuantity: allQuantity,
|
|
|
- allUnitPrice: allUnitPrice,
|
|
|
- };
|
|
|
- });
|
|
|
- } else {
|
|
|
- formData.data.orderSkuList[index].orderSkuBomList = formData.data.orderSkuList[index].orderSkuBomList.map((item) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- allQuantity: 0,
|
|
|
- allUnitPrice: 0,
|
|
|
- };
|
|
|
- });
|
|
|
+const computeMoney = (index, indexSKU) => {
|
|
|
+ let money = 0;
|
|
|
+ if (
|
|
|
+ formData.data.orderSkuList[index].quantity &&
|
|
|
+ formData.data.orderSkuList[index].orderSkuBomList[indexSKU].quantity &&
|
|
|
+ formData.data.orderSkuList[index].orderSkuBomList[indexSKU].unitPrice
|
|
|
+ ) {
|
|
|
+ money = Number(
|
|
|
+ Math.round(
|
|
|
+ formData.data.orderSkuList[index].orderSkuBomList[indexSKU].quantity *
|
|
|
+ formData.data.orderSkuList[index].orderSkuBomList[indexSKU].unitPrice *
|
|
|
+ formData.data.orderSkuList[index].quantity *
|
|
|
+ 100
|
|
|
+ ) / 100
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return money;
|
|
|
+};
|
|
|
+const getSubtotal = (item) => {
|
|
|
+ let money = 0;
|
|
|
+ if (item.quantity) {
|
|
|
+ money = Number(
|
|
|
+ Math.round(
|
|
|
+ (item.customProcessingFee + item.deliveryMaterialsFee + item.lssueFee + item.packingLabor + item.managementFee + item.unitPrice) * item.quantity * 100
|
|
|
+ ) / 100
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return money;
|
|
|
+};
|
|
|
+const calculatedAmount = (label) => {
|
|
|
+ let money = 0;
|
|
|
+ if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
|
|
|
+ for (let i = 0; i < formData.data.orderSkuList.length; i++) {
|
|
|
+ if (formData.data.orderSkuList[i].quantity && formData.data.orderSkuList[i][label]) {
|
|
|
+ money = Number(Math.round((money + formData.data.orderSkuList[i][label] * formData.data.orderSkuList[i].quantity) * 100) / 100);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- calculatedAmount();
|
|
|
+ return money;
|
|
|
};
|
|
|
-const calculatedAmount = () => {
|
|
|
- let productTotalAmount = 0;
|
|
|
- let customProcessingFee = 0;
|
|
|
- let lssueFee = 0;
|
|
|
- let deliveryMaterialsFee = 0;
|
|
|
- let packingLabor = 0;
|
|
|
- let managementFee = 0;
|
|
|
- let packagingMaterialCost = 0;
|
|
|
- let totalAmount = 0;
|
|
|
+const calculatedPackagingMaterialCost = () => {
|
|
|
+ let money = 0;
|
|
|
if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
|
|
|
for (let i = 0; i < formData.data.orderSkuList.length; i++) {
|
|
|
- if (formData.data.orderSkuList[i].quantity) {
|
|
|
- if (formData.data.orderSkuList[i].customProcessingFee) {
|
|
|
- customProcessingFee = Number(
|
|
|
- Math.round((customProcessingFee + formData.data.orderSkuList[i].customProcessingFee * formData.data.orderSkuList[i].quantity) * 100) / 100
|
|
|
- );
|
|
|
- }
|
|
|
- if (formData.data.orderSkuList[i].lssueFee) {
|
|
|
- lssueFee = Number(Math.round((lssueFee + formData.data.orderSkuList[i].lssueFee * formData.data.orderSkuList[i].quantity) * 100) / 100);
|
|
|
- }
|
|
|
- if (formData.data.orderSkuList[i].deliveryMaterialsFee) {
|
|
|
- deliveryMaterialsFee = Number(
|
|
|
- Math.round((deliveryMaterialsFee + formData.data.orderSkuList[i].deliveryMaterialsFee * formData.data.orderSkuList[i].quantity) * 100) / 100
|
|
|
- );
|
|
|
- }
|
|
|
- if (formData.data.orderSkuList[i].packingLabor) {
|
|
|
- packingLabor = Number(Math.round((packingLabor + formData.data.orderSkuList[i].packingLabor * formData.data.orderSkuList[i].quantity) * 100) / 100);
|
|
|
- }
|
|
|
- if (formData.data.orderSkuList[i].managementFee) {
|
|
|
- managementFee = Number(
|
|
|
- Math.round((managementFee + formData.data.orderSkuList[i].managementFee * formData.data.orderSkuList[i].quantity) * 100) / 100
|
|
|
- );
|
|
|
- }
|
|
|
- if (formData.data.orderSkuList[i].unitPrice) {
|
|
|
- productTotalAmount = Number(
|
|
|
- Math.round((productTotalAmount + formData.data.orderSkuList[i].unitPrice * formData.data.orderSkuList[i].quantity) * 100) / 100
|
|
|
- );
|
|
|
- }
|
|
|
- let money = 0;
|
|
|
- if (formData.data.orderSkuList[i].orderSkuBomList && formData.data.orderSkuList[i].orderSkuBomList.length > 0) {
|
|
|
- for (let j = 0; j < formData.data.orderSkuList[i].orderSkuBomList.length; j++) {
|
|
|
- if (formData.data.orderSkuList[i].orderSkuBomList[j].quantity && formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice) {
|
|
|
- packagingMaterialCost = Number(
|
|
|
- Math.round(
|
|
|
- (packagingMaterialCost +
|
|
|
- formData.data.orderSkuList[i].orderSkuBomList[j].quantity *
|
|
|
- formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice *
|
|
|
- formData.data.orderSkuList[i].quantity) *
|
|
|
- 100
|
|
|
- ) / 100
|
|
|
- );
|
|
|
- money = Number(
|
|
|
- Math.round(
|
|
|
- (money + formData.data.orderSkuList[i].orderSkuBomList[j].quantity * formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice) * 100
|
|
|
- ) / 100
|
|
|
- );
|
|
|
- }
|
|
|
+ if (formData.data.orderSkuList[i].orderSkuBomList && formData.data.orderSkuList[i].orderSkuBomList.length > 0) {
|
|
|
+ for (let j = 0; j < formData.data.orderSkuList[i].orderSkuBomList.length; j++) {
|
|
|
+ if (formData.data.orderSkuList[i].orderSkuBomList[j].quantity && formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice) {
|
|
|
+ money = Number(
|
|
|
+ Math.round(
|
|
|
+ (money +
|
|
|
+ formData.data.orderSkuList[i].orderSkuBomList[j].quantity *
|
|
|
+ formData.data.orderSkuList[i].orderSkuBomList[j].unitPrice *
|
|
|
+ formData.data.orderSkuList[i].quantity) *
|
|
|
+ 100
|
|
|
+ ) / 100
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
- formData.data.orderSkuList[i].packagingMaterialCost = money;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- formData.data.productTotalAmount = productTotalAmount;
|
|
|
- formData.data.customProcessingFee = customProcessingFee;
|
|
|
- formData.data.lssueFee = lssueFee;
|
|
|
- formData.data.deliveryMaterialsFee = deliveryMaterialsFee;
|
|
|
- formData.data.packingLabor = packingLabor;
|
|
|
- formData.data.managementFee = managementFee;
|
|
|
- formData.data.packagingMaterialCost = packagingMaterialCost;
|
|
|
- totalAmount = Number(
|
|
|
- Math.round((productTotalAmount + customProcessingFee + lssueFee + deliveryMaterialsFee + packingLabor + managementFee + packagingMaterialCost) * 100) / 100
|
|
|
+ return money;
|
|
|
+};
|
|
|
+const calculatedTotalAmount = () => {
|
|
|
+ let money = 0;
|
|
|
+ money = Number(
|
|
|
+ Math.round(
|
|
|
+ (calculatedAmount("unitPrice") +
|
|
|
+ calculatedAmount("customProcessingFee") +
|
|
|
+ calculatedAmount("lssueFee") +
|
|
|
+ calculatedAmount("deliveryMaterialsFee") +
|
|
|
+ calculatedAmount("packingLabor") +
|
|
|
+ calculatedAmount("managementFee") +
|
|
|
+ calculatedPackagingMaterialCost()) *
|
|
|
+ 100
|
|
|
+ ) / 100
|
|
|
);
|
|
|
- formData.data.totalAmount = totalAmount;
|
|
|
+ return money;
|
|
|
+};
|
|
|
+const fileList = ref([]);
|
|
|
+const uploadFileData = ref({});
|
|
|
+const beforeUpload = async (file) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ uploadFileData.value = res.uploadBody;
|
|
|
+ file.id = res.id;
|
|
|
+ file.fileName = res.fileName;
|
|
|
+ file.fileUrl = res.fileUrl;
|
|
|
+ file.uploadState = true;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+const onSuccessFile = (any, UploadFile) => {
|
|
|
+ UploadFile.raw.uploadState = false;
|
|
|
+};
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
};
|
|
|
</script>
|
|
|
|