|
@@ -110,7 +110,7 @@
|
|
:controls="false"
|
|
:controls="false"
|
|
:min="0"
|
|
:min="0"
|
|
:precision="0"
|
|
:precision="0"
|
|
- @change="changeQuantity(index)" />
|
|
|
|
|
|
+ @change="changeQuantity(index, true)" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
<div style="line-height: 35px">
|
|
<div style="line-height: 35px">
|
|
@@ -345,13 +345,10 @@
|
|
定制加工费: ¥{{ moneyFormat(calculatedAmount("customProcessingFee"), 2) }}
|
|
定制加工费: ¥{{ moneyFormat(calculatedAmount("customProcessingFee"), 2) }}
|
|
</span>
|
|
</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("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(computeDeliveryMaterialsFee(), 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(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(calculatedPackagingMaterialCost(), 2) }}</span>
|
|
<span style="font-weight: 700; color: #6c88f1; margin-left: 40px">管理费: ¥{{ moneyFormat(calculatedAmount("managementFee"), 2) }}</span>
|
|
<span style="font-weight: 700; color: #6c88f1; margin-left: 40px">管理费: ¥{{ moneyFormat(calculatedAmount("managementFee"), 2) }}</span>
|
|
- <!-- <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">外箱包装费: ¥{{ moneyFormat(calculatedOuterBoxPackingFee(), 2) }}</span> -->
|
|
|
|
</div>
|
|
</div>
|
|
<div style="padding: 8px 0 0 0">
|
|
<div style="padding: 8px 0 0 0">
|
|
<span style="font-weight: 700; color: red">订单总金额(含税): ¥{{ moneyFormat(calculatedTotalAmount(), 2) }}</span>
|
|
<span style="font-weight: 700; color: red">订单总金额(含税): ¥{{ moneyFormat(calculatedTotalAmount(), 2) }}</span>
|
|
@@ -385,7 +382,7 @@
|
|
<el-button @click="clickCancel()" v-if="route.query && route.query.detailId" size="large">关 闭</el-button>
|
|
<el-button @click="clickCancel()" v-if="route.query && route.query.detailId" size="large">关 闭</el-button>
|
|
<el-button @click="clickCancel()" v-if="!(route.query && route.query.detailId)" size="large">取 消</el-button>
|
|
<el-button @click="clickCancel()" v-if="!(route.query && route.query.detailId)" size="large">取 消</el-button>
|
|
<el-button @click="submitForm('0')" v-if="!(route.query && route.query.detailId)" size="large" v-preReClick>暂 存</el-button>
|
|
<el-button @click="submitForm('0')" v-if="!(route.query && route.query.detailId)" size="large" v-preReClick>暂 存</el-button>
|
|
- <el-button type="primary" @click="submitForm('20')" v-if="!(route.query && route.query.detailId)" size="large" v-preReClick>提 交</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="submitForm('20')" v-if="!(route.query && route.query.detailId)" size="large" v-preReClick>确认包装配置</el-button>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
@@ -409,12 +406,117 @@
|
|
<el-button @click="openDrawingFile = false" size="large">关 闭</el-button>
|
|
<el-button @click="openDrawingFile = false" size="large">关 闭</el-button>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="产品包装配置" v-if="openShippingPackage" v-model="openShippingPackage" width="80%" :close-on-press-escape="false" :show-close="false">
|
|
|
|
+ <div style="height: calc(100vh - 184px); overflow-y: auto; overflow-x: hidden">
|
|
|
|
+ <el-form :model="formData.data" :rules="rulesShippingPackage" ref="shippingPackage">
|
|
|
|
+ <div style="font-weight: 700; margin: 20px 0 10px 0">发货包装</div>
|
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
|
+ <el-button type="primary" size="small" @click="clickSelectAssembly()">选择常用组合</el-button>
|
|
|
|
+ <el-button type="primary" size="small" @click="clickExpressPacking()">选择快递物流包材</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <el-table :data="formData.data.orderPackageBomList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
|
|
|
|
+ <el-table-column label="品号" prop="code" width="160" />
|
|
|
|
+ <el-table-column label="品名" prop="name" min-width="220" />
|
|
|
|
+ <el-table-column label="销售单价" prop="internalSellingPrice" width="100" />
|
|
|
|
+ <el-table-column label="数量" width="120">
|
|
|
|
+ <template #default="{ row, $index }">
|
|
|
|
+ <div class="shippingPackage">
|
|
|
|
+ <el-form-item
|
|
|
|
+ :prop="'orderPackageBomList.' + $index + '.quantity'"
|
|
|
|
+ :rules="rulesShippingPackage.quantity"
|
|
|
|
+ :inline-message="true"
|
|
|
|
+ style="width: 100%">
|
|
|
|
+ <el-input-number
|
|
|
|
+ onmousewheel="return false;"
|
|
|
|
+ v-model="row.quantity"
|
|
|
|
+ placeholder="修正数量"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :controls="false"
|
|
|
|
+ :min="0"
|
|
|
|
+ :precision="0" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="销售小计" width="120">
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ {{ moneyFormat(computePackagingMoney(row, "internalSellingPrice"), 2) }}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" width="80">
|
|
|
|
+ <template #default="{ $index }">
|
|
|
|
+ <el-button type="danger" @click="clickPackagingDelete($index)" text>删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <div style="font-weight: 700; margin: 20px 0 10px 0">外箱不干胶图稿</div>
|
|
|
|
+ <div style="display: flex; width: 100%">
|
|
|
|
+ <div style="width: 80px; line-height: 32px">不干胶图片:</div>
|
|
|
|
+ <div style="width: calc(100% - 80px)">
|
|
|
|
+ <el-image
|
|
|
|
+ fit="scale-down"
|
|
|
|
+ style="width: 148px; height: 148px; margin-right: 10px; cursor: pointer"
|
|
|
|
+ v-if="formData.data.outerBoxSelfAdhesiveStickerFile && formData.data.outerBoxSelfAdhesiveStickerFile.fileUrl"
|
|
|
|
+ :src="formData.data.outerBoxSelfAdhesiveStickerFile.fileUrl"
|
|
|
|
+ @click="openFile(formData.data.outerBoxSelfAdhesiveStickerFile.fileUrl)" />
|
|
|
|
+ <div style="display: flex" v-if="route.query.processType != 10">
|
|
|
|
+ <el-upload
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
|
+ :data="uploadAdhesiveData"
|
|
|
|
+ :before-upload="uploadAdhesiveFile"
|
|
|
|
+ :on-success="
|
|
|
|
+ (response, uploadFile) => {
|
|
|
|
+ return handleAdhesivePackagingSuccess(uploadFile);
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ style="width: 100%">
|
|
|
|
+ <el-button type="primary" text>上传文件</el-button>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <el-button type="primary" @click="clickSaveAssembly" v-preReClick>保存常用组合</el-button>
|
|
|
|
+ <el-button @click="openShippingPackage = false" v-preReClick>关 闭</el-button>
|
|
|
|
+ <el-button type="primary" @click="clickSaveShippingPackage" v-preReClick>提交订单</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="保存常用组合" v-if="openAssembly" v-model="openAssembly" width="500">
|
|
|
|
+ <el-form :model="formShippingPackage.data" :rules="rulesAssembly" ref="assembly">
|
|
|
|
+ <el-form-item label="组合名称" prop="assemblyName">
|
|
|
|
+ <el-input v-model="formShippingPackage.data.assemblyName" placeholder="请输入组合名称" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <el-button @click="openAssembly = false">关 闭</el-button>
|
|
|
|
+ <el-button type="primary" @click="submitAssembly" v-preReClick>保 存</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="选择常用组合" v-if="openSelectAssembly" v-model="openSelectAssembly" width="700">
|
|
|
|
+ <SelectAssembly @selectAssembly="selectAssembly"></SelectAssembly>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <el-button @click="openSelectAssembly = false">关 闭</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="选择快递包装" v-if="openExpressPacking" v-model="openExpressPacking" width="90%">
|
|
|
|
+ <SelectBOM :selectStatus="true" :expressStatus="true" @selectBOM="selectExpressPacking"></SelectBOM>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <el-button @click="openExpressPacking = false">关 闭</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import byForm from "/src/components/byForm/index";
|
|
import byForm from "/src/components/byForm/index";
|
|
-import { ElMessage } from "element-plus";
|
|
|
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
import Editor from "/src/components/Editor/index.vue";
|
|
import Editor from "/src/components/Editor/index.vue";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import SelectProduct from "/src/views/group/product/management/index";
|
|
import SelectProduct from "/src/views/group/product/management/index";
|
|
@@ -422,6 +524,7 @@ import SelectBOM from "/src/views/group/BOM/management/index";
|
|
import useTagsViewStore from "/src/store/modules/tagsView";
|
|
import useTagsViewStore from "/src/store/modules/tagsView";
|
|
import SelectPicture from "/src/components/select-picture/index.vue";
|
|
import SelectPicture from "/src/components/select-picture/index.vue";
|
|
import refreshStore from "/src/store/modules/refresh";
|
|
import refreshStore from "/src/store/modules/refresh";
|
|
|
|
+import SelectAssembly from "/src/components/selectAssembly/index";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -443,6 +546,8 @@ const formData = reactive({
|
|
type: 1,
|
|
type: 1,
|
|
orderSkuList: [],
|
|
orderSkuList: [],
|
|
fileList: [],
|
|
fileList: [],
|
|
|
|
+ orderPackageBomList: [],
|
|
|
|
+ outerBoxSelfAdhesiveStickerFile: {},
|
|
},
|
|
},
|
|
});
|
|
});
|
|
const formConfig = computed(() => {
|
|
const formConfig = computed(() => {
|
|
@@ -628,10 +733,12 @@ const updatePackageRemark = (val, index) => {
|
|
};
|
|
};
|
|
const clickDelete = (index) => {
|
|
const clickDelete = (index) => {
|
|
formData.data.orderSkuList.splice(index, 1);
|
|
formData.data.orderSkuList.splice(index, 1);
|
|
|
|
+ getShippingPackage();
|
|
};
|
|
};
|
|
const updateValue = (val) => {
|
|
const updateValue = (val) => {
|
|
formData.data.remark = val;
|
|
formData.data.remark = val;
|
|
};
|
|
};
|
|
|
|
+const openShippingPackage = ref(false);
|
|
const submitForm = (status) => {
|
|
const submitForm = (status) => {
|
|
submit.value.handleSubmit(() => {
|
|
submit.value.handleSubmit(() => {
|
|
if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
|
|
if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
|
|
@@ -663,10 +770,9 @@ const submitForm = (status) => {
|
|
formData.data.productTotalAmount = calculatedAmount("unitPrice");
|
|
formData.data.productTotalAmount = calculatedAmount("unitPrice");
|
|
formData.data.customProcessingFee = calculatedAmount("customProcessingFee");
|
|
formData.data.customProcessingFee = calculatedAmount("customProcessingFee");
|
|
formData.data.lssueFee = calculatedAmount("lssueFee");
|
|
formData.data.lssueFee = calculatedAmount("lssueFee");
|
|
- formData.data.deliveryMaterialsFee = calculatedAmount("deliveryMaterialsFee");
|
|
|
|
|
|
+ formData.data.deliveryMaterialsFee = computeDeliveryMaterialsFee();
|
|
formData.data.packingLabor = calculatedAmount("packingLabor");
|
|
formData.data.packingLabor = calculatedAmount("packingLabor");
|
|
formData.data.managementFee = calculatedAmount("managementFee");
|
|
formData.data.managementFee = calculatedAmount("managementFee");
|
|
- // formData.data.outerBoxPackingFee = calculatedOuterBoxPackingFee();
|
|
|
|
formData.data.packagingMaterialCost = calculatedPackagingMaterialCost();
|
|
formData.data.packagingMaterialCost = calculatedPackagingMaterialCost();
|
|
formData.data.totalAmount = calculatedTotalAmount();
|
|
formData.data.totalAmount = calculatedTotalAmount();
|
|
if (fileList.value && fileList.value.length > 0) {
|
|
if (fileList.value && fileList.value.length > 0) {
|
|
@@ -686,18 +792,22 @@ const submitForm = (status) => {
|
|
formData.data.fileList = [];
|
|
formData.data.fileList = [];
|
|
}
|
|
}
|
|
formData.data.status = status;
|
|
formData.data.status = status;
|
|
- let type = "add";
|
|
|
|
- if (formData.data.id) {
|
|
|
|
- type = "edit";
|
|
|
|
- }
|
|
|
|
- proxy.post("/orderInfo/" + type, formData.data).then(() => {
|
|
|
|
- ElMessage({
|
|
|
|
- message: type == "add" ? "添加成功" : "编辑成功",
|
|
|
|
- type: "success",
|
|
|
|
|
|
+ if (status == "20") {
|
|
|
|
+ openShippingPackage.value = true;
|
|
|
|
+ } else {
|
|
|
|
+ let type = "add";
|
|
|
|
+ if (formData.data.id) {
|
|
|
|
+ type = "edit";
|
|
|
|
+ }
|
|
|
|
+ proxy.post("/orderInfo/" + type, formData.data).then(() => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: type == "add" ? "添加成功" : "编辑成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ refreshStore().setRefresh("order");
|
|
|
|
+ clickCancel();
|
|
});
|
|
});
|
|
- refreshStore().setRefresh("order");
|
|
|
|
- clickCancel();
|
|
|
|
- });
|
|
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
return ElMessage("请添加产品");
|
|
return ElMessage("请添加产品");
|
|
}
|
|
}
|
|
@@ -902,7 +1012,7 @@ const selectPackingFittings = (data) => {
|
|
}
|
|
}
|
|
ElMessage({ message: "添加成功", type: "success" });
|
|
ElMessage({ message: "添加成功", type: "success" });
|
|
};
|
|
};
|
|
-const changeQuantity = (index) => {
|
|
|
|
|
|
+const changeQuantity = (index, status) => {
|
|
if (formData.data.orderSkuList[index].quantity) {
|
|
if (formData.data.orderSkuList[index].quantity) {
|
|
proxy
|
|
proxy
|
|
.post("/orderInfo/getSkuSpecPrice", { skuSpecId: formData.data.orderSkuList[index].skuSpecId, quantity: formData.data.orderSkuList[index].quantity })
|
|
.post("/orderInfo/getSkuSpecPrice", { skuSpecId: formData.data.orderSkuList[index].skuSpecId, quantity: formData.data.orderSkuList[index].quantity })
|
|
@@ -919,6 +1029,9 @@ const changeQuantity = (index) => {
|
|
formData.data.orderSkuList[index].managementFee = res.managementFee;
|
|
formData.data.orderSkuList[index].managementFee = res.managementFee;
|
|
formData.data.orderSkuList[index].unitPrice = res.unitPrice;
|
|
formData.data.orderSkuList[index].unitPrice = res.unitPrice;
|
|
});
|
|
});
|
|
|
|
+ if (status) {
|
|
|
|
+ getShippingPackage();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const cellStyleName = ({ column, columnIndex }) => {
|
|
const cellStyleName = ({ column, columnIndex }) => {
|
|
@@ -1031,10 +1144,9 @@ const calculatedTotalAmount = () => {
|
|
(calculatedAmount("unitPrice") +
|
|
(calculatedAmount("unitPrice") +
|
|
calculatedAmount("customProcessingFee") +
|
|
calculatedAmount("customProcessingFee") +
|
|
calculatedAmount("lssueFee") +
|
|
calculatedAmount("lssueFee") +
|
|
- calculatedAmount("deliveryMaterialsFee") +
|
|
|
|
|
|
+ computeDeliveryMaterialsFee() +
|
|
calculatedAmount("packingLabor") +
|
|
calculatedAmount("packingLabor") +
|
|
calculatedAmount("managementFee") +
|
|
calculatedAmount("managementFee") +
|
|
- // calculatedOuterBoxPackingFee() +
|
|
|
|
calculatedPackagingMaterialCost()) *
|
|
calculatedPackagingMaterialCost()) *
|
|
100
|
|
100
|
|
) / 100
|
|
) / 100
|
|
@@ -1074,12 +1186,191 @@ const handleAdhesiveSuccess = (UploadFile, index) => {
|
|
fileUrl: UploadFile.raw.fileUrl,
|
|
fileUrl: UploadFile.raw.fileUrl,
|
|
};
|
|
};
|
|
};
|
|
};
|
|
-const calculatedOuterBoxPackingFee = () => {
|
|
|
|
|
|
+const formShippingPackage = reactive({
|
|
|
|
+ data: {
|
|
|
|
+ assemblyName: "",
|
|
|
|
+ },
|
|
|
|
+});
|
|
|
|
+const rulesShippingPackage = ref({
|
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
|
+});
|
|
|
|
+const computePackagingMoney = (item, label) => {
|
|
let money = 0;
|
|
let money = 0;
|
|
|
|
+ if (item.quantity && item[label]) {
|
|
|
|
+ money = Number(Math.round(item.quantity * item[label] * 100) / 100);
|
|
|
|
+ }
|
|
|
|
+ return money;
|
|
|
|
+};
|
|
|
|
+const clickPackagingDelete = (index) => {
|
|
|
|
+ formData.data.orderPackageBomList.splice(index, 1);
|
|
|
|
+};
|
|
|
|
+const handleAdhesivePackagingSuccess = (UploadFile) => {
|
|
|
|
+ formData.data.outerBoxSelfAdhesiveStickerFile = {
|
|
|
|
+ id: UploadFile.raw.id,
|
|
|
|
+ fileName: UploadFile.raw.fileName,
|
|
|
|
+ fileUrl: UploadFile.raw.fileUrl,
|
|
|
|
+ };
|
|
|
|
+};
|
|
|
|
+const clickSaveShippingPackage = () => {
|
|
|
|
+ proxy.$refs.shippingPackage.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
|
|
|
|
+ formData.data.deliveryMaterialsFee = computeDeliveryMaterialsFee();
|
|
|
|
+ formData.data.totalAmount = calculatedTotalAmount();
|
|
|
|
+ let type = "add";
|
|
|
|
+ if (formData.data.id) {
|
|
|
|
+ type = "edit";
|
|
|
|
+ }
|
|
|
|
+ proxy.post("/orderInfo/" + type, formData.data).then(() => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: type == "add" ? "添加成功" : "编辑成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ refreshStore().setRefresh("order");
|
|
|
|
+ clickCancel();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ ElMessageBox.confirm("是否确认无产品发货包装", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ formData.data.deliveryMaterialsFee = computeDeliveryMaterialsFee();
|
|
|
|
+ formData.data.totalAmount = calculatedTotalAmount();
|
|
|
|
+ let type = "add";
|
|
|
|
+ if (formData.data.id) {
|
|
|
|
+ type = "edit";
|
|
|
|
+ }
|
|
|
|
+ proxy.post("/orderInfo/" + type, formData.data).then(() => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: type == "add" ? "添加成功" : "编辑成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ refreshStore().setRefresh("order");
|
|
|
|
+ clickCancel();
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+const openAssembly = ref(false);
|
|
|
|
+const rulesAssembly = ref({
|
|
|
|
+ assemblyName: [{ required: true, message: "请输入组合名称", trigger: "blur" }],
|
|
|
|
+});
|
|
|
|
+const clickSaveAssembly = () => {
|
|
|
|
+ if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
|
|
|
|
+ formData.data.assemblyName = "";
|
|
|
|
+ openAssembly.value = true;
|
|
|
|
+ } else {
|
|
|
|
+ return ElMessage("请添加快递物流包材");
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+const submitAssembly = () => {
|
|
|
|
+ proxy.$refs.assembly.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ proxy
|
|
|
|
+ .post("/packagingAssembly/add", { name: formShippingPackage.data.assemblyName, packagingAssemblyBomList: formData.data.orderPackageBomList })
|
|
|
|
+ .then(() => {
|
|
|
|
+ ElMessage({ message: "保存成功!", type: "success" });
|
|
|
|
+ openAssembly.value = false;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+const openSelectAssembly = ref(false);
|
|
|
|
+const clickSelectAssembly = () => {
|
|
|
|
+ openSelectAssembly.value = true;
|
|
|
|
+};
|
|
|
|
+const selectAssembly = (item) => {
|
|
|
|
+ if (item.id) {
|
|
|
|
+ proxy.post("/packagingAssembly/getPackagingBomList", { id: item.id }).then((res) => {
|
|
|
|
+ if (res && res.length > 0) {
|
|
|
|
+ formData.data.orderPackageBomList = res.map((resItem) => {
|
|
|
|
+ return {
|
|
|
|
+ bomSpecId: resItem.id,
|
|
|
|
+ code: resItem.code,
|
|
|
|
+ name: resItem.name,
|
|
|
|
+ internalSellingPrice: resItem.internalSellingPrice,
|
|
|
|
+ quantity: undefined,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ ElMessage({ message: "选择完成", type: "success" });
|
|
|
|
+ openSelectAssembly.value = false;
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ return ElMessage("选择失败,请重新选择");
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+const openExpressPacking = ref(false);
|
|
|
|
+const clickExpressPacking = () => {
|
|
|
|
+ openExpressPacking.value = true;
|
|
|
|
+};
|
|
|
|
+const selectExpressPacking = (data) => {
|
|
|
|
+ if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
|
|
|
|
+ let list = formData.data.orderPackageBomList.filter((item) => item.bomSpecId === data.id);
|
|
|
|
+ if (list && list.length > 0) {
|
|
|
|
+ return ElMessage("快递物流包材已添加");
|
|
|
|
+ }
|
|
|
|
+ formData.data.orderPackageBomList.push({
|
|
|
|
+ bomSpecId: data.id,
|
|
|
|
+ code: data.code,
|
|
|
|
+ name: data.name,
|
|
|
|
+ internalSellingPrice: data.internalSellingPrice,
|
|
|
|
+ quantity: undefined,
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ formData.data.orderPackageBomList = [
|
|
|
|
+ {
|
|
|
|
+ bomSpecId: data.id,
|
|
|
|
+ code: data.code,
|
|
|
|
+ name: data.name,
|
|
|
|
+ internalSellingPrice: data.internalSellingPrice,
|
|
|
|
+ quantity: undefined,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ ElMessage({ message: "添加成功", type: "success" });
|
|
|
|
+};
|
|
|
|
+const getShippingPackage = () => {
|
|
|
|
+ let skuSpecList = formData.data.orderSkuList.filter((item) => item.quantity && item.quantity > 0);
|
|
|
|
+ if (skuSpecList && skuSpecList.length > 0) {
|
|
|
|
+ skuSpecList = skuSpecList.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ skuSpecId: item.skuSpecId,
|
|
|
|
+ quantity: item.quantity,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ proxy.post("/orderInfo/getSkuSpecPackageBomList", { skuSpecList: skuSpecList }).then((res) => {
|
|
|
|
+ if (res && res.length > 0) {
|
|
|
|
+ formData.data.orderPackageBomList = res.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ bomSpecId: item.bomSpecId,
|
|
|
|
+ code: item.bomSpecCode,
|
|
|
|
+ name: item.bomSpecName,
|
|
|
|
+ internalSellingPrice: item.internalSellingPrice,
|
|
|
|
+ quantity: item.quantity,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ formData.data.orderPackageBomList = [];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ formData.data.orderPackageBomList = [];
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+const computeDeliveryMaterialsFee = () => {
|
|
|
|
+ let money = calculatedAmount("deliveryMaterialsFee");
|
|
if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
|
|
if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
|
|
for (let i = 0; i < formData.data.orderPackageBomList.length; i++) {
|
|
for (let i = 0; i < formData.data.orderPackageBomList.length; i++) {
|
|
- if (formData.data.orderPackageBomList[i].costPrice && formData.data.orderPackageBomList[i].quantity) {
|
|
|
|
- money = Number(Math.round((money + formData.data.orderPackageBomList[i].costPrice * formData.data.orderPackageBomList[i].quantity) * 100) / 100);
|
|
|
|
|
|
+ if (formData.data.orderPackageBomList[i].internalSellingPrice && formData.data.orderPackageBomList[i].quantity) {
|
|
|
|
+ money = Number(
|
|
|
|
+ Math.round((money + formData.data.orderPackageBomList[i].internalSellingPrice * formData.data.orderPackageBomList[i].quantity) * 100) / 100
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|