|
@@ -243,20 +243,6 @@
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
- <el-dialog title="选择产品" v-if="openProduct" v-model="openProduct" width="90%">
|
|
|
|
- <SelectProduct :selectStatus="true" @selectProduct="selectProduct"></SelectProduct>
|
|
|
|
- <template #footer>
|
|
|
|
- <el-button @click="openProduct = false" size="large">关 闭</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-dialog>
|
|
|
|
-
|
|
|
|
- <el-dialog title="选择包材配件" v-if="openPackingFittings" v-model="openPackingFittings" width="90%">
|
|
|
|
- <SelectBOM :selectStatus="true" :bomClassifyIdList="[2, 3]" @selectBOM="selectPackingFittings"></SelectBOM>
|
|
|
|
- <template #footer>
|
|
|
|
- <el-button @click="openPackingFittings = false" size="large">关 闭</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-dialog>
|
|
|
|
-
|
|
|
|
<el-dialog title="选择图稿文件" v-if="openDrawingFile" v-model="openDrawingFile" width="70%">
|
|
<el-dialog title="选择图稿文件" v-if="openDrawingFile" v-model="openDrawingFile" width="70%">
|
|
<SelectPicture @selectPic="selectPic"></SelectPicture>
|
|
<SelectPicture @selectPic="selectPic"></SelectPicture>
|
|
<template #footer>
|
|
<template #footer>
|
|
@@ -270,8 +256,6 @@
|
|
import byForm from "@/components/byForm/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import { ElMessage } from "element-plus";
|
|
import { ElMessage } from "element-plus";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
-import SelectProduct from "@/views/group/product/management/index";
|
|
|
|
-import SelectBOM from "@/views/group/BOM/management/index";
|
|
|
|
import useTagsViewStore from "@/store/modules/tagsView";
|
|
import useTagsViewStore from "@/store/modules/tagsView";
|
|
import SelectPicture from "@/components/select-picture/index.vue";
|
|
import SelectPicture from "@/components/select-picture/index.vue";
|
|
|
|
|
|
@@ -410,16 +394,6 @@ const selectPic = (row) => {
|
|
const openFile = (path) => {
|
|
const openFile = (path) => {
|
|
window.open(path);
|
|
window.open(path);
|
|
};
|
|
};
|
|
-const updatePackageRemark = (val, index) => {
|
|
|
|
- formData.data.orderSkuList[index].packageRemark = val;
|
|
|
|
-};
|
|
|
|
-const clickDelete = (index) => {
|
|
|
|
- formData.data.orderSkuList.splice(index, 1);
|
|
|
|
- calculatedAmount();
|
|
|
|
-};
|
|
|
|
-const updateValue = (val) => {
|
|
|
|
- formData.data.remark = val;
|
|
|
|
-};
|
|
|
|
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) {
|
|
@@ -535,10 +509,6 @@ const getStyle = (text) => {
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|
|
};
|
|
};
|
|
-const openProduct = ref(false);
|
|
|
|
-const clickAddProduct = () => {
|
|
|
|
- openProduct.value = true;
|
|
|
|
-};
|
|
|
|
const printType = ref([
|
|
const printType = ref([
|
|
{
|
|
{
|
|
dictKey: 1,
|
|
dictKey: 1,
|
|
@@ -549,194 +519,6 @@ const printType = ref([
|
|
dictValue: "双面",
|
|
dictValue: "双面",
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
-const selectProduct = (row, bom) => {
|
|
|
|
- if (row.id) {
|
|
|
|
- let list = formData.data.orderSkuList.filter((item) => item.skuSpecId === row.id && item.bomSpecId === row.bomSpecId);
|
|
|
|
- if (list && list.length > 0) {
|
|
|
|
- return ElMessage("该产品已添加");
|
|
|
|
- }
|
|
|
|
- formData.data.orderSkuList.push({
|
|
|
|
- wlnSkuName: bom.name,
|
|
|
|
- skuId: row.skuId,
|
|
|
|
- code: row.code,
|
|
|
|
- name: row.name,
|
|
|
|
- skuSpecId: row.id,
|
|
|
|
- bomSpecId: row.bomSpecId,
|
|
|
|
- quantity: undefined,
|
|
|
|
- customProcessingFee: "",
|
|
|
|
- customProcessingType: "",
|
|
|
|
- lssueFee: "",
|
|
|
|
- deliveryMaterialsFee: "",
|
|
|
|
- packingLabor: "",
|
|
|
|
- unitPrice: "",
|
|
|
|
- printType: "1",
|
|
|
|
- packageRemark: "",
|
|
|
|
- subtotal: "",
|
|
|
|
- orderSkuBomList: [],
|
|
|
|
- });
|
|
|
|
- ElMessage({ message: "添加成功", type: "success" });
|
|
|
|
- } else {
|
|
|
|
- ElMessage("添加失败");
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-const rowIndex = ref(null);
|
|
|
|
-const openPackingFittings = ref(false);
|
|
|
|
-const clickPackingFittings = (index) => {
|
|
|
|
- rowIndex.value = index;
|
|
|
|
- openPackingFittings.value = true;
|
|
|
|
-};
|
|
|
|
-const clickDeletePackingFittings = (index, indexTwo) => {
|
|
|
|
- formData.data.orderSkuList[index].orderSkuBomList.splice(indexTwo, 1);
|
|
|
|
- calculatedAmount();
|
|
|
|
-};
|
|
|
|
-const selectPackingFittings = (data) => {
|
|
|
|
- if (formData.data.orderSkuList[rowIndex.value].orderSkuBomList && formData.data.orderSkuList[rowIndex.value].orderSkuBomList.length > 0) {
|
|
|
|
- let list = formData.data.orderSkuList[rowIndex.value].orderSkuBomList.filter((item) => item.bomSpecId === data.id);
|
|
|
|
- if (list && list.length > 0) {
|
|
|
|
- return ElMessage("包材配件已添加");
|
|
|
|
- }
|
|
|
|
- formData.data.orderSkuList[rowIndex.value].orderSkuBomList.push({
|
|
|
|
- bomSpecId: data.id,
|
|
|
|
- unitPrice: data.costPrice,
|
|
|
|
- quantity: undefined,
|
|
|
|
- bomSpecName: data.name,
|
|
|
|
- allQuantity: 0,
|
|
|
|
- allUnitPrice: 0,
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- formData.data.orderSkuList[rowIndex.value].orderSkuBomList = [
|
|
|
|
- {
|
|
|
|
- bomSpecId: data.id,
|
|
|
|
- unitPrice: data.costPrice,
|
|
|
|
- quantity: undefined,
|
|
|
|
- bomSpecName: data.name,
|
|
|
|
- allQuantity: 0,
|
|
|
|
- allUnitPrice: 0,
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- }
|
|
|
|
- ElMessage({ message: "添加成功", type: "success" });
|
|
|
|
-};
|
|
|
|
-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].unitPrice = res.unitPrice;
|
|
|
|
- formData.data.orderSkuList[index].subtotal = Number(
|
|
|
|
- Math.round(
|
|
|
|
- (res.customProcessingFee + res.deliveryMaterialsFee + res.lssueFee + res.packingLabor + res.unitPrice) *
|
|
|
|
- formData.data.orderSkuList[index].quantity *
|
|
|
|
- 100
|
|
|
|
- ) / 100
|
|
|
|
- );
|
|
|
|
- changeBOMQuantity(index);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-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,
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- calculatedAmount();
|
|
|
|
-};
|
|
|
|
-const calculatedAmount = () => {
|
|
|
|
- let productTotalAmount = 0;
|
|
|
|
- let customProcessingFee = 0;
|
|
|
|
- let lssueFee = 0;
|
|
|
|
- let deliveryMaterialsFee = 0;
|
|
|
|
- let packingLabor = 0;
|
|
|
|
- let packagingMaterialCost = 0;
|
|
|
|
- let totalAmount = 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].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
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- 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.packagingMaterialCost = packagingMaterialCost;
|
|
|
|
- totalAmount = Number(
|
|
|
|
- Math.round((productTotalAmount + customProcessingFee + lssueFee + deliveryMaterialsFee + packingLabor + packagingMaterialCost) * 100) / 100
|
|
|
|
- );
|
|
|
|
- formData.data.totalAmount = totalAmount;
|
|
|
|
-};
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|