|
@@ -67,6 +67,25 @@
|
|
|
<el-button type="primary" plain @click="handleClickUpload('prodImgPath',false)" v-else>点击查看</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #color>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item label="颜色" class="margin-b-0 wid100">
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="color" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.color" placeholder="颜色" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="colorCardCode" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.colorCardCode" placeholder="色卡号" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #size>
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item label="尺寸" class="margin-b-0 wid100" required>
|
|
@@ -74,19 +93,19 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="length" label-width="0px" class="margin-b-0 wid100">
|
|
|
<el-input-number v-model="formData.data['length']" placeholder="长 (cm)" style="width: 100%" :precision="2" :controls="false"
|
|
|
- :min="0" onmousewheel="return false;" @change="getPriceData" />
|
|
|
+ :min="0" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="width" label-width="0px" class="margin-b-0 wid100">
|
|
|
<el-input-number v-model="formData.data.width" placeholder="宽 (cm)" style="width: 100%" :precision="2" :controls="false"
|
|
|
- :min="0" onmousewheel="return false;" @change="getPriceData" />
|
|
|
+ :min="0" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="height" label-width="0px" class="margin-b-0 wid100">
|
|
|
<el-input-number v-model="formData.data.height" placeholder="高 (cm)" style="width: 100%" :precision="2" :controls="false"
|
|
|
- :min="0" onmousewheel="return false;" @change="getPriceData" />
|
|
|
+ :min="0" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -94,6 +113,161 @@
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #materialDetail>
|
|
|
+ <div style="width: 100%;padding-left:15px">
|
|
|
+ <el-button type="primary" @click="clickOpenSelectMaterial(1)" plain>选择包材/配件/辅材</el-button>
|
|
|
+ <el-table :data="formData.data.productBomDetailList" style="width: 100%; margin-top: 16px">
|
|
|
+ <el-table-column prop="materialName" label="物料名称" min-width="130" />
|
|
|
+ <el-table-column prop="materialCode" label="物料编码" width="150" />
|
|
|
+ <el-table-column label="数量" width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'productBomDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
|
|
|
+ :controls="false" :min="1" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="60" align="center" fixed="right">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" link @click="handleRemove($index,1)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #technology>
|
|
|
+ <div style="width:100%">
|
|
|
+ <div class="small-title">
|
|
|
+ ① 工艺线路
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="technologyId" label="工艺产线" class="wid100">
|
|
|
+ <el-select v-model="formData.data.technologyId" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option v-for="item in technologyData" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ② LOGO
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="LOGO尺寸" class="wid100">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="logoLength" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.logoLength" placeholder="长 (cm)" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="logoWidth" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.logoWidth" placeholder="宽 (cm)" style="width: 100%" :precision="2" :controls="false"
|
|
|
+ :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="logoHeight" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.logoHeight" placeholder="高 (cm)" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="colorCount" label="几色印刷" class="wid100">
|
|
|
+ <el-input-number v-model="formData.data.colorCount" placeholder="请输入" style="width: 100%" :precision="0" :controls="false"
|
|
|
+ :min="1" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ③ 折叠
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="isFold" label="是否折叠" class="wid100">
|
|
|
+ <el-select v-model="formData.data.isFold" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option :label="'否'" :value="0" />
|
|
|
+ <el-option :label="'是'" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="foldWay" label="折叠数" class="wid100" v-if="formData.data.isFold==1">
|
|
|
+ <el-select v-model="formData.data.foldWay" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option v-for="item in foldWayData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ④ 包装要求
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="packAsk" label="包装要求" class="wid100">
|
|
|
+ <el-select v-model="formData.data.packAsk" placeholder="请选择" style="width:100%" multiple>
|
|
|
+ <el-option v-for="item in packAskData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ⑤ 是否定制
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="isCustomized" label="是否定制" class="wid100">
|
|
|
+ <el-select v-model="formData.data.isCustomized" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option :label="'否'" :value="0" />
|
|
|
+ <el-option :label="'是'" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-form-item prop="technologyId" label="定制内容" class="wid100" v-if="formData.data.isCustomized==1">
|
|
|
+ <table style="width:100%" border class="table">
|
|
|
+ <tr>
|
|
|
+ <td style="width:20%">
|
|
|
+ </td>
|
|
|
+ <td style="width:40%">附件</td>
|
|
|
+ <td style="width:40%">备注</td>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(row,index) in formData.data.productCustomInfoList" :key="index">
|
|
|
+ <td>
|
|
|
+ <el-checkbox v-model="row.isCheckBox" label="" /> <span style="position:relative;top:-2px"> {{getLabel(row.type)}}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <el-upload :file-list="row.fileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
|
|
|
+ :before-upload="(file)=>handleBeforeUploadOne(file,index)" :on-success="()=>handleSuccessOne(index)"
|
|
|
+ :on-remove="(file)=>handleRemoveFile(file,index)" :on-preview="onPreviewFile"
|
|
|
+ :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
|
|
|
+ <el-button text type="primary">上传附件</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <el-form-item :prop="'productCustomInfoList.' + index + '.remark'" :rules="row.isCheckBox?rules.remark:''"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="row.remark" placeholder="请输入备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
</byForm>
|
|
|
</div>
|
|
|
<template #footer>
|
|
@@ -125,7 +299,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="60" align="center" fixed="right">
|
|
|
<template #default="{ $index }">
|
|
|
- <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
+ <el-button type="primary" link @click="handleRemove($index,1)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -159,10 +333,10 @@
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>
|
|
|
- 包材辅材
|
|
|
+ 包材/配件/辅材
|
|
|
</td>
|
|
|
<td style="padding:20px 20px 20px">
|
|
|
- <div style="text-align:left"><el-button type="primary" @click="openSelectMaterial = true" plain>选择</el-button></div>
|
|
|
+ <div style="text-align:left"><el-button type="primary" @click="clickOpenSelectMaterial(2)" plain>选择</el-button></div>
|
|
|
<el-table :data="formData.bomData.productBomDetailList" style="width: 100%;">
|
|
|
<el-table-column prop="materialName" label="物料名称" min-width="130" />
|
|
|
<el-table-column prop="materialCode" label="物料编码" width="150" />
|
|
@@ -179,7 +353,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="60" align="center" fixed="right">
|
|
|
<template #default="{ $index }">
|
|
|
- <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
+ <el-button type="primary" link @click="handleRemove($index,2)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -252,7 +426,11 @@ const companyData = ref([]);
|
|
|
const currencyData = computed(
|
|
|
() => proxy.useUserStore().allDict["account_currency"]
|
|
|
);
|
|
|
+const packAskData = computed(() => proxy.useUserStore().allDict["pack_ask"]);
|
|
|
+const foldWayData = computed(() => proxy.useUserStore().allDict["fold_way"]);
|
|
|
+
|
|
|
const headers = ref({ Authorization: "Bearer " + getToken() });
|
|
|
+const uploadData = ref({});
|
|
|
const tableHeight = ref(0);
|
|
|
const getTableHeight = () => {
|
|
|
tableHeight.value = window.innerHeight - 245;
|
|
@@ -294,6 +472,8 @@ const rules = ref({
|
|
|
rawMaterialId: [
|
|
|
{ required: true, message: "请选择原材料", trigger: "change" },
|
|
|
],
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+ remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
|
|
|
});
|
|
|
const props = defineProps({
|
|
|
selectStatus: Boolean,
|
|
@@ -561,6 +741,16 @@ const formConfig = computed(() => {
|
|
|
disabled: false,
|
|
|
},
|
|
|
{
|
|
|
+ type: "number",
|
|
|
+ prop: "price",
|
|
|
+ label: "销售价",
|
|
|
+ precision: 2,
|
|
|
+ min: 0.01,
|
|
|
+ controls: false,
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "uploadImg",
|
|
|
// listType: "picture-card",
|
|
|
// limit: 1,
|
|
@@ -568,6 +758,14 @@ const formConfig = computed(() => {
|
|
|
prop: "fileList",
|
|
|
imgProp: "imageUrl",
|
|
|
label: "产品缩略图",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "hsCode",
|
|
|
+ label: "海关编码",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
},
|
|
|
{
|
|
|
type: "slot",
|
|
@@ -591,7 +789,7 @@ const formConfig = computed(() => {
|
|
|
// },
|
|
|
{
|
|
|
type: "title1",
|
|
|
- title: "属性信息",
|
|
|
+ title: "主材",
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
@@ -610,19 +808,10 @@ const formConfig = computed(() => {
|
|
|
// ).toFixed(2)
|
|
|
// );
|
|
|
// }
|
|
|
- getPriceData();
|
|
|
+ // getPriceData();
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- type: "number",
|
|
|
- prop: "price",
|
|
|
- label: "销售价",
|
|
|
- precision: 2,
|
|
|
- min: 0.01,
|
|
|
- controls: false,
|
|
|
- itemWidth: 50,
|
|
|
- disabled: true,
|
|
|
- },
|
|
|
+
|
|
|
// {
|
|
|
// type: "selectInput",
|
|
|
// prop: "price",
|
|
@@ -633,18 +822,18 @@ const formConfig = computed(() => {
|
|
|
// data: currencyData.value,
|
|
|
// disabled: true,
|
|
|
// },
|
|
|
- {
|
|
|
- type: "select",
|
|
|
- prop: "technologyId",
|
|
|
- label: "生产工艺",
|
|
|
- itemWidth: 50,
|
|
|
- data: technologyData.value,
|
|
|
- filterable: true,
|
|
|
- disabled: false,
|
|
|
- fn: () => {
|
|
|
- getPriceData();
|
|
|
- },
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // type: "select",
|
|
|
+ // prop: "technologyId",
|
|
|
+ // label: "生产工艺",
|
|
|
+ // itemWidth: 50,
|
|
|
+ // data: technologyData.value,
|
|
|
+ // filterable: true,
|
|
|
+ // disabled: false,
|
|
|
+ // fn: () => {
|
|
|
+ // // getPriceData();
|
|
|
+ // },
|
|
|
+ // },
|
|
|
// {
|
|
|
// type: "input",
|
|
|
// prop: "spec",
|
|
@@ -653,9 +842,10 @@ const formConfig = computed(() => {
|
|
|
// disabled: false,
|
|
|
// },
|
|
|
{
|
|
|
- type: "input",
|
|
|
- prop: "color",
|
|
|
- label: "颜色",
|
|
|
+ type: "slot",
|
|
|
+ slotName: "color",
|
|
|
+ prop: "",
|
|
|
+ label: "",
|
|
|
itemWidth: 50,
|
|
|
disabled: false,
|
|
|
},
|
|
@@ -706,19 +896,28 @@ const formConfig = computed(() => {
|
|
|
controls: false,
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // itemType: "textarea",
|
|
|
+ // prop: "remark",
|
|
|
+ // label: "备注",
|
|
|
+ // itemWidth: 100,
|
|
|
+ // },
|
|
|
{
|
|
|
- type: "input",
|
|
|
- prop: "hsCode",
|
|
|
- label: "海关编码",
|
|
|
- itemWidth: 50,
|
|
|
- disabled: false,
|
|
|
+ type: "title1",
|
|
|
+ title: "辅材",
|
|
|
},
|
|
|
{
|
|
|
- type: "input",
|
|
|
- itemType: "textarea",
|
|
|
- prop: "remark",
|
|
|
- label: "备注",
|
|
|
- itemWidth: 100,
|
|
|
+ type: "slot",
|
|
|
+ slotName: "materialDetail",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "附加工艺要求",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "technology",
|
|
|
},
|
|
|
];
|
|
|
});
|
|
@@ -800,6 +999,33 @@ const openModal = () => {
|
|
|
fileList: [],
|
|
|
currency: "",
|
|
|
prodFileList: [],
|
|
|
+ isFold: 0,
|
|
|
+ isCustomized: 0,
|
|
|
+ packAsk: [],
|
|
|
+ productBomDetailList: [],
|
|
|
+ productCustomInfoList: [
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ isCheck: 0,
|
|
|
+ isCheckBox: false,
|
|
|
+ fileList: [],
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 2,
|
|
|
+ isCheck: 0,
|
|
|
+ isCheckBox: false,
|
|
|
+ fileList: [],
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 3,
|
|
|
+ isCheck: 0,
|
|
|
+ isCheckBox: false,
|
|
|
+ fileList: [],
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
// if (currencyData.value && currencyData.value.length > 0) {
|
|
|
// formData.data.currency = currencyData.value[0].dictKey;
|
|
@@ -815,11 +1041,27 @@ const submitForm = () => {
|
|
|
if (!formData.data.fileList.length > 0) {
|
|
|
return proxy.msgTip("请上传图片", 2);
|
|
|
}
|
|
|
+ // if(!formData.data.productBomDetailList.length>0){
|
|
|
+
|
|
|
+ // }
|
|
|
// formData.data.fileList = formData.data.fileList.map((x) => ({
|
|
|
// id: x.id,
|
|
|
// fileName: x.fileName,
|
|
|
// fileUrl: x.fileUrl,
|
|
|
// }));
|
|
|
+ for (let i = 0; i < formData.data.productCustomInfoList.length; i++) {
|
|
|
+ const ele = formData.data.productCustomInfoList[i];
|
|
|
+ ele.isCheck = ele.isCheckBox ? 1 : 0;
|
|
|
+ if (ele.isCheckBox) {
|
|
|
+ if (!(ele.fileList && ele.fileList.length > 0)) {
|
|
|
+ return proxy.msgTip(`请上传${getLabel(ele.type)}附件`, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (formData.data.packAsk && formData.data.packAsk.length > 0) {
|
|
|
+ formData.data.packAsk = formData.data.packAsk.join(",");
|
|
|
+ }
|
|
|
submitLoading.value = true;
|
|
|
proxy.post("/productInfo/" + modalType.value, formData.data).then(
|
|
|
(res) => {
|
|
@@ -830,6 +1072,9 @@ const submitForm = () => {
|
|
|
},
|
|
|
(err) => {
|
|
|
submitLoading.value = false;
|
|
|
+ if (formData.data.packAsk) {
|
|
|
+ formData.data.packAsk = formData.data.packAsk.split(",");
|
|
|
+ }
|
|
|
}
|
|
|
);
|
|
|
});
|
|
@@ -858,6 +1103,39 @@ const getDtl = (row) => {
|
|
|
modalType.value = "edit";
|
|
|
proxy.post("/productInfo/detail", { id: row.id }).then((res) => {
|
|
|
formData.data = res;
|
|
|
+ formData.data.productBomDetailList =
|
|
|
+ formData.data.productBomDetailList.filter((x) => x.type == 2);
|
|
|
+
|
|
|
+ if (
|
|
|
+ formData.data.productCustomInfoList &&
|
|
|
+ formData.data.productCustomInfoList.length > 0
|
|
|
+ ) {
|
|
|
+ // let productCustomInfoIds = formData.data.productCustomInfoList.map(
|
|
|
+ // (x) => x.id
|
|
|
+ // );
|
|
|
+ // proxy.getFileData({
|
|
|
+ // businessIdList: productCustomInfoIds,
|
|
|
+ // data: formData.data.productCustomInfoList,
|
|
|
+ // att: "id",
|
|
|
+ // businessType: "0",
|
|
|
+ // fileAtt: "fileList",
|
|
|
+ // });
|
|
|
+ formData.data.productCustomInfoList.forEach((x) => {
|
|
|
+ x.isCheckBox = x.isCheck == 1;
|
|
|
+ if (!x.fileList) {
|
|
|
+ x.fileList = [];
|
|
|
+ } else {
|
|
|
+ x.fileList = x.fileList.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ url: x.fileUrl,
|
|
|
+ name: x.fileName,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (formData.data.packAsk) {
|
|
|
+ formData.data.packAsk = formData.data.packAsk.split(",");
|
|
|
+ }
|
|
|
formData.data.fileList = row.fileList.map((x) => ({
|
|
|
...x,
|
|
|
url: x.fileUrl,
|
|
@@ -866,6 +1144,7 @@ const getDtl = (row) => {
|
|
|
if (formData.data.fileList.length > 0) {
|
|
|
formData.data.imageUrl = formData.data.fileList[0].fileUrl;
|
|
|
}
|
|
|
+
|
|
|
proxy
|
|
|
.post("/fileInfo/getList", { businessIdList: [row.id] })
|
|
|
.then((fileObj) => {
|
|
@@ -997,25 +1276,52 @@ const submitBomForm = () => {
|
|
|
});
|
|
|
};
|
|
|
const openSelectMaterial = ref(false);
|
|
|
+const openType = ref(-1);
|
|
|
+const clickOpenSelectMaterial = (type) => {
|
|
|
+ openType.value = type;
|
|
|
+ openSelectMaterial.value = true;
|
|
|
+};
|
|
|
const selectMaterial = (row) => {
|
|
|
- let flag = formData.bomData.productBomDetailList.some(
|
|
|
- (x) => x.materialId == row.id
|
|
|
- );
|
|
|
- if (!flag) {
|
|
|
- formData.bomData.productBomDetailList.push({
|
|
|
- type: 2,
|
|
|
- materialName: row.name,
|
|
|
- materialCode: row.customCode,
|
|
|
- materialId: row.id,
|
|
|
- quantity: null,
|
|
|
- });
|
|
|
- proxy.msgTip("选择成功");
|
|
|
+ if (openType.value == 1) {
|
|
|
+ let flag = formData.data.productBomDetailList.some(
|
|
|
+ (x) => x.materialId == row.id
|
|
|
+ );
|
|
|
+ if (!flag) {
|
|
|
+ formData.data.productBomDetailList.push({
|
|
|
+ type: 2,
|
|
|
+ materialName: row.name,
|
|
|
+ materialCode: row.customCode,
|
|
|
+ materialId: row.id,
|
|
|
+ quantity: null,
|
|
|
+ });
|
|
|
+ proxy.msgTip("选择成功");
|
|
|
+ } else {
|
|
|
+ proxy.msgTip("该物料已选择", 2);
|
|
|
+ }
|
|
|
} else {
|
|
|
- proxy.msgTip("该物料已选择", 2);
|
|
|
+ let flag = formData.bomData.productBomDetailList.some(
|
|
|
+ (x) => x.materialId == row.id
|
|
|
+ );
|
|
|
+ if (!flag) {
|
|
|
+ formData.bomData.productBomDetailList.push({
|
|
|
+ type: 2,
|
|
|
+ materialName: row.name,
|
|
|
+ materialCode: row.customCode,
|
|
|
+ materialId: row.id,
|
|
|
+ quantity: null,
|
|
|
+ });
|
|
|
+ proxy.msgTip("选择成功");
|
|
|
+ } else {
|
|
|
+ proxy.msgTip("该物料已选择", 2);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
-const handleRemove = (index) => {
|
|
|
- formData.bomData.productBomDetailList.splice(index, 1);
|
|
|
+const handleRemove = (index, type) => {
|
|
|
+ if (type == 1) {
|
|
|
+ formData.data.productBomDetailList.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ formData.bomData.productBomDetailList.splice(index, 1);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const handleClickFile = (file) => {
|
|
@@ -1076,6 +1382,57 @@ const exportExcel = () => {
|
|
|
proxy.downloadFile(res, "产品数据.xlsx");
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const handleBeforeUploadOne = async (file, index) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ file.id = res.id;
|
|
|
+ file.fileUrl = res.fileUrl;
|
|
|
+ uploadData.value = res.uploadBody;
|
|
|
+ formData.data.productCustomInfoList[index].fileData = res;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+
|
|
|
+const handleSuccessOne = (index) => {
|
|
|
+ if (
|
|
|
+ formData.data.productCustomInfoList[index].fileData &&
|
|
|
+ formData.data.productCustomInfoList[index].fileData.fileUrl
|
|
|
+ ) {
|
|
|
+ let file = formData.data.productCustomInfoList[index].fileData;
|
|
|
+ formData.data.productCustomInfoList[index].fileList.push({
|
|
|
+ id: file.id,
|
|
|
+ fileName: file.fileName,
|
|
|
+ name: file.fileName,
|
|
|
+ url: file.fileUrl,
|
|
|
+ fileUrl: file.fileUrl,
|
|
|
+ });
|
|
|
+ formData.data.productCustomInfoList[index].fileData = {};
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleRemoveFile = (file, index) => {
|
|
|
+ let sonIndex = formData.data.productCustomInfoList[index].fileList.findIndex(
|
|
|
+ (x) => x.id == file.id || x.id == file.raw.id
|
|
|
+ );
|
|
|
+ if (sonIndex > -1) {
|
|
|
+ formData.data.productCustomInfoList[index].fileList.splice(sonIndex, 1);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ if (file && file.fileUrl) {
|
|
|
+ window.open(file.fileUrl, "_blank");
|
|
|
+ } else {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
+ }
|
|
|
+};
|
|
|
+let obj = {
|
|
|
+ 1: "定制刀模",
|
|
|
+ 2: "定制纹路",
|
|
|
+ 3: "定制模具",
|
|
|
+};
|
|
|
+const getLabel = (type) => {
|
|
|
+ return obj[type];
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -1107,4 +1464,13 @@ const exportExcel = () => {
|
|
|
// padding: 5px 10px;
|
|
|
}
|
|
|
}
|
|
|
+.small-title {
|
|
|
+ padding-left: 15px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ color: #3366ff;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+:deep(.el-checkbox) {
|
|
|
+ margin-right: 0px;
|
|
|
+}
|
|
|
</style>
|