|
@@ -62,9 +62,6 @@
|
|
|
</template>
|
|
|
<template #orderSkuList>
|
|
|
<div style="width: 100%; padding: 0 20px">
|
|
|
- <div style="margin-bottom: 10px" v-if="!(route.query && route.query.detailId)">
|
|
|
- <el-button type="primary" size="small" @click="clickAddProduct()">选择产品</el-button>
|
|
|
- </div>
|
|
|
<el-collapse v-model="activeNames">
|
|
|
<div v-for="(item, index) in formData.data.orderSkuList" :key="index" style="margin-bottom: 20px">
|
|
|
<div style="border: 1px solid #edf0f5">
|
|
@@ -209,9 +206,6 @@
|
|
|
<el-table-column label="包材配件/单品" min-width="400">
|
|
|
<template #default="{ row }">
|
|
|
<div style="width: 100%">
|
|
|
- <div style="margin-bottom: 10px" v-if="!(route.query && route.query.detailId)">
|
|
|
- <el-button type="primary" @click="clickPackingFittings(index)">选择包材配件</el-button>
|
|
|
- </div>
|
|
|
<el-table :data="row.orderSkuBomList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
|
|
|
<el-table-column label="单价¥" width="120">
|
|
|
<template #default="props">
|
|
@@ -253,20 +247,10 @@
|
|
|
{{ moneyFormat(props.row.allUnitPrice, 2) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" fixed="right" width="60" v-if="!(route.query && route.query.detailId)">
|
|
|
- <template #default="props">
|
|
|
- <el-button type="danger" @click="clickDeletePackingFittings(index, props.$index)" text>删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" fixed="right" width="60" v-if="!(route.query && route.query.detailId)">
|
|
|
- <template #default="{}">
|
|
|
- <el-button type="primary" @click="clickDelete(index)" text>删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
</el-table>
|
|
|
<el-collapse-item :name="index">
|
|
|
<template #title>
|
|
@@ -275,18 +259,7 @@
|
|
|
<div style="display: flex; padding: 8px 10px 0px">
|
|
|
<div style="flex: 1; padding: 0px 10px">
|
|
|
<div>包装要求:</div>
|
|
|
- <div v-if="route.query && route.query.detailId">
|
|
|
- <div v-html="getStyle(item.packageRemark)"></div>
|
|
|
- </div>
|
|
|
- <Editor
|
|
|
- v-else
|
|
|
- :value="item.packageRemark"
|
|
|
- @updateValue="
|
|
|
- (val) => {
|
|
|
- return updatePackageRemark(val, index);
|
|
|
- }
|
|
|
- "
|
|
|
- :ref="'editor_' + index" />
|
|
|
+ <div v-html="getStyle(item.packageRemark)"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-collapse-item>
|
|
@@ -336,35 +309,15 @@
|
|
|
</template>
|
|
|
<template #remark>
|
|
|
<div style="width: 100%">
|
|
|
- <div v-if="route.query && route.query.detailId">
|
|
|
- <div v-html="getStyle(formData.data.remark)"></div>
|
|
|
- </div>
|
|
|
- <Editor v-else :value="formData.data.remark" @updateValue="updateValue" ref="editor" />
|
|
|
+ <div v-html="getStyle(formData.data.remark)"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
<div style="width: 100%; text-align: center; margin: 10px">
|
|
|
- <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 type="primary" @click="submitForm('10')" v-if="!(route.query && route.query.detailId)" size="large" v-preReClick>确 定</el-button>
|
|
|
+ <el-button @click="clickCancel()" size="large">关 闭</el-button>
|
|
|
</div>
|
|
|
</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="'修改' + textPrice" v-if="openChangePrice" v-model="openChangePrice" width="500">
|
|
|
<el-form :model="changePrice.data" label-width="120px" ref="price">
|
|
|
<el-form-item :label="textPrice" :prop="labelPrice" :rules="[{ required: true, message: '请输入' + textPrice, trigger: 'blur' }]">
|
|
@@ -389,10 +342,7 @@
|
|
|
<script setup>
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
-import Editor from "@/components/Editor/index.vue";
|
|
|
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";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
@@ -559,52 +509,6 @@ const handleSuccess = (any, UploadFile) => {
|
|
|
const onPreviewFile = (file) => {
|
|
|
window.open(file.raw.fileUrl, "_blank");
|
|
|
};
|
|
|
-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) => {
|
|
|
- submit.value.handleSubmit(() => {
|
|
|
- if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
|
|
|
- if (fileList.value && fileList.value.length > 0) {
|
|
|
- for (let i = 0; i < fileList.value.length; i++) {
|
|
|
- if (fileList.value[i].raw.uploadState) {
|
|
|
- return ElMessage("文件上传中,请稍后提交");
|
|
|
- }
|
|
|
- }
|
|
|
- formData.data.fileList = fileList.value.map((item) => {
|
|
|
- return {
|
|
|
- id: item.raw.id,
|
|
|
- fileName: item.raw.fileName,
|
|
|
- fileUrl: item.raw.fileUrl,
|
|
|
- };
|
|
|
- });
|
|
|
- } else {
|
|
|
- formData.data.fileList = [];
|
|
|
- }
|
|
|
- let type = "add";
|
|
|
- if (formData.data.id) {
|
|
|
- type = "edit";
|
|
|
- }
|
|
|
- formData.data.status = status;
|
|
|
- proxy.post("/orderInfo/" + type, formData.data).then(() => {
|
|
|
- ElMessage({
|
|
|
- message: type == "add" ? "添加成功" : "编辑成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- clickCancel();
|
|
|
- });
|
|
|
- } else {
|
|
|
- return ElMessage("请添加产品");
|
|
|
- }
|
|
|
- });
|
|
|
-};
|
|
|
const clickCancel = () => {
|
|
|
const useTagsStore = useTagsViewStore();
|
|
|
useTagsStore.delVisitedView(router.currentRoute.value);
|
|
@@ -734,10 +638,6 @@ const getStyle = (text) => {
|
|
|
return "";
|
|
|
}
|
|
|
};
|
|
|
-const openProduct = ref(false);
|
|
|
-const clickAddProduct = () => {
|
|
|
- openProduct.value = true;
|
|
|
-};
|
|
|
const printType = ref([
|
|
|
{
|
|
|
dictKey: "1",
|
|
@@ -748,74 +648,6 @@ const printType = ref([
|
|
|
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,
|
|
|
- name: data.name,
|
|
|
- allQuantity: 0,
|
|
|
- allUnitPrice: 0,
|
|
|
- });
|
|
|
- } else {
|
|
|
- formData.data.orderSkuList[rowIndex.value].orderSkuBomList = [
|
|
|
- {
|
|
|
- bomSpecId: data.id,
|
|
|
- unitPrice: data.costPrice,
|
|
|
- quantity: undefined,
|
|
|
- name: data.name,
|
|
|
- allQuantity: 0,
|
|
|
- allUnitPrice: 0,
|
|
|
- },
|
|
|
- ];
|
|
|
- }
|
|
|
- ElMessage({ message: "添加成功", type: "success" });
|
|
|
-};
|
|
|
const changeQuantity = (index) => {
|
|
|
if (formData.data.orderSkuList[index].quantity) {
|
|
|
proxy
|