|
@@ -25,7 +25,7 @@
|
|
}"
|
|
}"
|
|
:action-list="[
|
|
:action-list="[
|
|
{
|
|
{
|
|
- text: '导入产品库',
|
|
|
|
|
|
+ text: 'Excel导入',
|
|
action: () => openExcel(),
|
|
action: () => openExcel(),
|
|
disabled: false,
|
|
disabled: false,
|
|
},
|
|
},
|
|
@@ -49,10 +49,9 @@
|
|
</template>
|
|
</template>
|
|
<template #size="{ item }">
|
|
<template #size="{ item }">
|
|
<div>
|
|
<div>
|
|
- <span>{{ item.productLong }}</span
|
|
|
|
- >* <span>{{ item.packagWide }}</span
|
|
|
|
- >*
|
|
|
|
- <span>{{ item.packagHigh }}</span>
|
|
|
|
|
|
+ <span>{{ item.productLong }}cm</span>*
|
|
|
|
+ <span>{{ item.productWide }}cm</span>*
|
|
|
|
+ <span>{{ item.productHigh }}cm</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</byTable>
|
|
</byTable>
|
|
@@ -60,7 +59,7 @@
|
|
<el-dialog
|
|
<el-dialog
|
|
:title="modalType == 'add' ? '添加产品' : '编辑产品'"
|
|
:title="modalType == 'add' ? '添加产品' : '编辑产品'"
|
|
v-model="dialogVisible"
|
|
v-model="dialogVisible"
|
|
- width="60%"
|
|
|
|
|
|
+ width="600"
|
|
v-loading="submitLoading"
|
|
v-loading="submitLoading"
|
|
destroy-on-close
|
|
destroy-on-close
|
|
>
|
|
>
|
|
@@ -75,76 +74,20 @@
|
|
<template #productPic>
|
|
<template #productPic>
|
|
<div>
|
|
<div>
|
|
<el-upload
|
|
<el-upload
|
|
- v-model:formData.data.imgList="formData.data.imgList"
|
|
|
|
|
|
+ v-model:fileList="fileList"
|
|
action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
:data="uploadData"
|
|
:data="uploadData"
|
|
list-type="picture-card"
|
|
list-type="picture-card"
|
|
- :on-remove="(file) => handleRemove(file, 'imgList')"
|
|
|
|
- :before-upload="(file) => handleBeforeUpload(file, 'imgList')"
|
|
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
+ :before-upload="handleBeforeUpload"
|
|
accept=".gif, .jpeg, .jpg, .png"
|
|
accept=".gif, .jpeg, .jpg, .png"
|
|
>
|
|
>
|
|
<el-icon><Plus /></el-icon>
|
|
<el-icon><Plus /></el-icon>
|
|
</el-upload>
|
|
</el-upload>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
- <template #productPicOne>
|
|
|
|
- <div>
|
|
|
|
- <el-upload
|
|
|
|
- v-model:formData.data.minorImgList="formData.data.minorImgList"
|
|
|
|
- action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
|
- :data="uploadData"
|
|
|
|
- list-type="picture-card"
|
|
|
|
- :on-remove="(file) => handleRemove(file, 'minorImgList')"
|
|
|
|
- :before-upload="
|
|
|
|
- (file) => handleBeforeUpload(file, 'minorImgList')
|
|
|
|
- "
|
|
|
|
- accept=".gif, .jpeg, .jpg, .png"
|
|
|
|
- >
|
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
|
- </el-upload>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
-
|
|
|
|
- <template #productPicTwo>
|
|
|
|
- <div>
|
|
|
|
- <el-upload
|
|
|
|
- v-model:formData.data.fileList="formData.data.fileList"
|
|
|
|
- :show-file-list="false"
|
|
|
|
- class="upload-demo"
|
|
|
|
- action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
|
- :data="uploadData"
|
|
|
|
- :before-upload="(file) => handleBeforeUpload(file, 'fileList')"
|
|
|
|
- >
|
|
|
|
- <el-button type="primary">选择</el-button>
|
|
|
|
- </el-upload>
|
|
|
|
- <div>
|
|
|
|
- <div style="margin-top: 15px">
|
|
|
|
- <el-tag
|
|
|
|
- style="margin-right: 10px"
|
|
|
|
- class="ml-2"
|
|
|
|
- type="info"
|
|
|
|
- v-for="(item, index) in formData.data.fileListCopy"
|
|
|
|
- :key="index"
|
|
|
|
- closable
|
|
|
|
- @close="handleClose(index)"
|
|
|
|
- >{{ item.fileName }}</el-tag
|
|
|
|
- >
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
-
|
|
|
|
- <template #detailDec>
|
|
|
|
- <div style="width: 100%">
|
|
|
|
- <Editor
|
|
|
|
- :value="formData.data.remark"
|
|
|
|
- @updateValue="updateContent"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
</byForm>
|
|
</byForm>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
<el-button
|
|
<el-button
|
|
@@ -158,23 +101,26 @@
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="Excel导入"
|
|
|
|
|
|
+ title="导入产品"
|
|
v-model="openExcelDialog"
|
|
v-model="openExcelDialog"
|
|
width="400"
|
|
width="400"
|
|
- v-loading="loading"
|
|
|
|
|
|
+ v-loading="excelLoading"
|
|
>
|
|
>
|
|
|
|
+ <el-upload
|
|
|
|
+ :action="actionUrl + '/productInfo/excelImportByEhsd'"
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :on-success="handleSuccess"
|
|
|
|
+ :on-progress="handleProgress"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ :on-error="handleError"
|
|
|
|
+ accept=".xlsx"
|
|
|
|
+ >
|
|
|
|
+ <el-button type="primary">点击导入</el-button>
|
|
|
|
+ </el-upload>
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button @click="openExcelDialog = false" size="large"
|
|
<el-button @click="openExcelDialog = false" size="large"
|
|
>取 消</el-button
|
|
>取 消</el-button
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="submitExcel()"
|
|
|
|
- size="large"
|
|
|
|
- :loading="submitLoading"
|
|
|
|
- >
|
|
|
|
- 确 定
|
|
|
|
- </el-button>
|
|
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -185,7 +131,9 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|
import byTable from "@/components/byTable/index";
|
|
import byTable from "@/components/byTable/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import treeList from "@/components/product/treeList";
|
|
import treeList from "@/components/product/treeList";
|
|
-import Editor from "@/components/Editor/index.vue";
|
|
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
|
+const headers = ref({ Authorization: "Bearer " + getToken() });
|
|
|
|
+const actionUrl = import.meta.env.VITE_APP_BASE_API;
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
const submitLoading = ref(false);
|
|
const submitLoading = ref(false);
|
|
const sourceList = ref({
|
|
const sourceList = ref({
|
|
@@ -202,15 +150,14 @@ const sourceList = ref({
|
|
});
|
|
});
|
|
let dialogVisible = ref(false);
|
|
let dialogVisible = ref(false);
|
|
let openExcelDialog = ref(false);
|
|
let openExcelDialog = ref(false);
|
|
|
|
+let excelLoading = ref(false);
|
|
let modalType = ref("add");
|
|
let modalType = ref("add");
|
|
let rules = ref({
|
|
let rules = ref({
|
|
productClassifyId: [
|
|
productClassifyId: [
|
|
- { required: true, message: "请选择类目", trigger: "change" },
|
|
|
|
- ],
|
|
|
|
- name: [{ required: true, message: "请输入名称(中文)", trigger: "blur" }],
|
|
|
|
- nameEnglish: [
|
|
|
|
- { required: true, message: "请输入名称(英文)", trigger: "blur" },
|
|
|
|
|
|
+ { required: true, message: "请选择产品分类", trigger: "change" },
|
|
],
|
|
],
|
|
|
|
+ name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
|
|
+ unit: [{ required: true, message: "请选择产品单位", trigger: "change" }],
|
|
productLong: [
|
|
productLong: [
|
|
{ required: true, message: "请输入长 (cm)", trigger: "blur" },
|
|
{ required: true, message: "请输入长 (cm)", trigger: "blur" },
|
|
],
|
|
],
|
|
@@ -226,16 +173,6 @@ let rules = ref({
|
|
outerPackMethod: [
|
|
outerPackMethod: [
|
|
{ required: true, message: "请选择外包装方式", trigger: "change" },
|
|
{ required: true, message: "请选择外包装方式", trigger: "change" },
|
|
],
|
|
],
|
|
- netWeight: [{ required: true, message: "请输入净重(kg)", trigger: "blur" }],
|
|
|
|
- salesUnit: [
|
|
|
|
- { required: true, message: "请输入采购/销售单位", trigger: "blur" },
|
|
|
|
- ],
|
|
|
|
- issueReceiptUnit: [
|
|
|
|
- { required: true, message: "请输入出入库单位", trigger: "blur" },
|
|
|
|
- ],
|
|
|
|
- conversionScale: [
|
|
|
|
- { required: true, message: "请输入换算比列", trigger: "blur" },
|
|
|
|
- ],
|
|
|
|
});
|
|
});
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
const selectConfig = reactive([
|
|
const selectConfig = reactive([
|
|
@@ -251,50 +188,54 @@ const config = computed(() => {
|
|
attrs: {
|
|
attrs: {
|
|
label: "图片",
|
|
label: "图片",
|
|
slot: "pic",
|
|
slot: "pic",
|
|
- width: 80,
|
|
|
|
|
|
+ align: "center",
|
|
|
|
+ width: 100,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
- label: "编号",
|
|
|
|
- prop: "customCode",
|
|
|
|
|
|
+ label: "产品编码",
|
|
|
|
+ prop: "code",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
- label: "名称",
|
|
|
|
|
|
+ label: "产品名称",
|
|
prop: "name",
|
|
prop: "name",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
- label: "尺寸",
|
|
|
|
- slot: "size",
|
|
|
|
|
|
+ label: "单位",
|
|
|
|
+ prop: "unit",
|
|
|
|
+ },
|
|
|
|
+ render(unit) {
|
|
|
|
+ return proxy.dictValueLabel(unit, productUnit.value);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
- label: "成本价(¥)",
|
|
|
|
- prop: "costPrice",
|
|
|
|
|
|
+ label: "尺寸",
|
|
|
|
+ slot: "size",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
- label: "销售指导价($)",
|
|
|
|
|
|
+ label: "销售指导价",
|
|
prop: "price",
|
|
prop: "price",
|
|
width: 150,
|
|
width: 150,
|
|
},
|
|
},
|
|
- },
|
|
|
|
- {
|
|
|
|
- attrs: {
|
|
|
|
- label: "型号",
|
|
|
|
- prop: "spec",
|
|
|
|
|
|
+ render(price) {
|
|
|
|
+ return "$" + proxy.moneyFormat(price, 2);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
- label: "创建人",
|
|
|
|
- prop: "createUserName",
|
|
|
|
|
|
+ label: "成本价",
|
|
|
|
+ prop: "costPrice",
|
|
|
|
+ },
|
|
|
|
+ render(costPrice) {
|
|
|
|
+ return "¥" + proxy.moneyFormat(costPrice, 2);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -359,12 +300,11 @@ const config = computed(() => {
|
|
const uploadData = ref({});
|
|
const uploadData = ref({});
|
|
const fileList = ref([]);
|
|
const fileList = ref([]);
|
|
const fileListCopy = ref([]);
|
|
const fileListCopy = ref([]);
|
|
-const fileListOne = ref([]);
|
|
|
|
-const fileListCopyOne = ref([]);
|
|
|
|
let formData = reactive({
|
|
let formData = reactive({
|
|
data: {},
|
|
data: {},
|
|
});
|
|
});
|
|
const formOption = reactive({
|
|
const formOption = reactive({
|
|
|
|
+ disabled: false,
|
|
inline: true,
|
|
inline: true,
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
itemWidth: 100,
|
|
itemWidth: 100,
|
|
@@ -374,6 +314,7 @@ const byform = ref(null);
|
|
const treeListData = ref([]);
|
|
const treeListData = ref([]);
|
|
const innerMethon = ref([]);
|
|
const innerMethon = ref([]);
|
|
const outsideMethon = ref([]);
|
|
const outsideMethon = ref([]);
|
|
|
|
+const productUnit = ref([]);
|
|
const formConfig = computed(() => {
|
|
const formConfig = computed(() => {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
@@ -383,137 +324,105 @@ const formConfig = computed(() => {
|
|
{
|
|
{
|
|
type: "treeSelect",
|
|
type: "treeSelect",
|
|
prop: "productClassifyId",
|
|
prop: "productClassifyId",
|
|
- label: "类目",
|
|
|
|
|
|
+ label: "产品分类",
|
|
data: treeListData.value,
|
|
data: treeListData.value,
|
|
- itemWidth: 50,
|
|
|
|
|
|
+ itemWidth: 100,
|
|
|
|
+ disabled: false,
|
|
style: {
|
|
style: {
|
|
width: "100%",
|
|
width: "100%",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
- prop: "customCode",
|
|
|
|
- label: "编码",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
prop: "name",
|
|
prop: "name",
|
|
- label: "名称(中文)",
|
|
|
|
|
|
+ label: "产品名称",
|
|
itemWidth: 100,
|
|
itemWidth: 100,
|
|
- placeholder: "请输入名称(中文)",
|
|
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
prop: "nameEnglish",
|
|
prop: "nameEnglish",
|
|
- label: "名称(英文)",
|
|
|
|
|
|
+ label: "英文名",
|
|
itemWidth: 100,
|
|
itemWidth: 100,
|
|
- placeholder: "请输入名称(英文)",
|
|
|
|
|
|
+ disabled: false,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "select",
|
|
|
|
+ prop: "unit",
|
|
|
|
+ label: "单位",
|
|
|
|
+ required: true,
|
|
|
|
+ itemWidth: 100,
|
|
|
|
+ data: productUnit.value,
|
|
|
|
+ style: {
|
|
|
|
+ width: "50%",
|
|
|
|
+ },
|
|
|
|
+ disabled: false,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "slot",
|
|
|
|
+ slotName: "productPic",
|
|
|
|
+ prop: "fileList",
|
|
|
|
+ label: "产品图片",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "title",
|
|
type: "title",
|
|
- title: "价格维护",
|
|
|
|
|
|
+ title: "价格信息",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- type: "number",
|
|
|
|
|
|
+ type: "selectInput",
|
|
prop: "price",
|
|
prop: "price",
|
|
- label: "销售指导价($)",
|
|
|
|
|
|
+ selectProp: "currency",
|
|
|
|
+ label: "销售指导价",
|
|
itemWidth: 50,
|
|
itemWidth: 50,
|
|
- controls: false,
|
|
|
|
- precision: 2,
|
|
|
|
- min: 0,
|
|
|
|
- placeholder: "请输入销售指导价($)",
|
|
|
|
style: {
|
|
style: {
|
|
width: "100%",
|
|
width: "100%",
|
|
},
|
|
},
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- type: "number",
|
|
|
|
|
|
+ type: "selectInput",
|
|
prop: "costPrice",
|
|
prop: "costPrice",
|
|
- label: "成本价(¥)",
|
|
|
|
|
|
+ selectProp: "currencyOne",
|
|
|
|
+ label: "成本价",
|
|
itemWidth: 50,
|
|
itemWidth: 50,
|
|
- controls: false,
|
|
|
|
- precision: 2,
|
|
|
|
- min: 0,
|
|
|
|
- placeholder: "请输入成本价(¥)",
|
|
|
|
-
|
|
|
|
style: {
|
|
style: {
|
|
width: "100%",
|
|
width: "100%",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "title",
|
|
type: "title",
|
|
- title: "属性字段",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "materialChinese",
|
|
|
|
- label: "材质(中文)",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入材质(中文)",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "material",
|
|
|
|
- label: "材质(英文)",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入材质(英文)",
|
|
|
|
|
|
+ title: "属性信息",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
prop: "spec",
|
|
prop: "spec",
|
|
- label: "型号(中文)",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入型号(中文)",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "productModelEn",
|
|
|
|
- label: "型号(英文)",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入型号(英文)",
|
|
|
|
|
|
+ label: "规格型号",
|
|
|
|
+ itemWidth: 100,
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
prop: "productLong",
|
|
prop: "productLong",
|
|
- label: "样品尺寸",
|
|
|
|
|
|
+ label: "尺寸",
|
|
itemWidth: 33.33,
|
|
itemWidth: 33.33,
|
|
- placeholder: "请输入长(cm)",
|
|
|
|
|
|
+ placeholder: "长(cm)",
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
prop: "productWide",
|
|
prop: "productWide",
|
|
label: " ",
|
|
label: " ",
|
|
itemWidth: 33.33,
|
|
itemWidth: 33.33,
|
|
- placeholder: "请输入宽(cm)",
|
|
|
|
|
|
+ placeholder: "宽(cm)",
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
prop: "productHigh",
|
|
prop: "productHigh",
|
|
label: " ",
|
|
label: " ",
|
|
itemWidth: 33.33,
|
|
itemWidth: 33.33,
|
|
- placeholder: "请输入高(cm)",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "packagLong",
|
|
|
|
- label: "装箱尺寸",
|
|
|
|
- itemWidth: 33.33,
|
|
|
|
- placeholder: "请输入长(cm)",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "packagWide",
|
|
|
|
- label: " ",
|
|
|
|
- itemWidth: 33.33,
|
|
|
|
- placeholder: "请输入宽(cm)",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "packagHigh",
|
|
|
|
- label: " ",
|
|
|
|
- itemWidth: 33.33,
|
|
|
|
- placeholder: "请输入高(cm)",
|
|
|
|
|
|
+ placeholder: "高(cm)",
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "select",
|
|
type: "select",
|
|
@@ -523,11 +432,11 @@ const formConfig = computed(() => {
|
|
itemWidth: 50,
|
|
itemWidth: 50,
|
|
multiple: true,
|
|
multiple: true,
|
|
data: innerMethon.value,
|
|
data: innerMethon.value,
|
|
- placeholder: "请选择内包装方式",
|
|
|
|
-
|
|
|
|
|
|
+ placeholder: "内包装方式",
|
|
style: {
|
|
style: {
|
|
width: "100%",
|
|
width: "100%",
|
|
},
|
|
},
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "select",
|
|
type: "select",
|
|
@@ -537,135 +446,37 @@ const formConfig = computed(() => {
|
|
itemWidth: 50,
|
|
itemWidth: 50,
|
|
multiple: true,
|
|
multiple: true,
|
|
data: outsideMethon.value,
|
|
data: outsideMethon.value,
|
|
- placeholder: "请选择外包装方式",
|
|
|
|
-
|
|
|
|
|
|
+ placeholder: "外包装方式",
|
|
style: {
|
|
style: {
|
|
width: "100%",
|
|
width: "100%",
|
|
},
|
|
},
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
prop: "netWeight",
|
|
prop: "netWeight",
|
|
label: "净重(kg)",
|
|
label: "净重(kg)",
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入净重(kg)",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "grossWeight",
|
|
|
|
- label: "毛重(kg)",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入毛重(kg)",
|
|
|
|
|
|
+ itemWidth: 100,
|
|
|
|
+ style: {
|
|
|
|
+ width: "30%",
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
- prop: "customsCode",
|
|
|
|
|
|
+ prop: "hsCode",
|
|
label: "海关编码",
|
|
label: "海关编码",
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入海关编码",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "moq",
|
|
|
|
- label: "MOQ",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入MOQ",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "salesUnit",
|
|
|
|
- label: "采购/销售单位",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入采购/销售单位",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "issueReceiptUnit",
|
|
|
|
- label: "出入库单位",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入出入库单位",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "conversionScale",
|
|
|
|
- label: "换算比例",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "换算比例 = 1 采购单位/1出入库单位",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "title",
|
|
|
|
- title: "仓储字段",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "safetyStock",
|
|
|
|
- label: "安全库存",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入安全库存",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "input",
|
|
|
|
- prop: "procurementCycle",
|
|
|
|
- label: "采购周期",
|
|
|
|
- itemWidth: 50,
|
|
|
|
- placeholder: "请输入采购周期",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "radio",
|
|
|
|
- prop: "firstInFirstOut",
|
|
|
|
- label: "先入先出",
|
|
|
|
- required: true,
|
|
|
|
- border: true,
|
|
|
|
- itemWidth: 70,
|
|
|
|
- data: [
|
|
|
|
- {
|
|
|
|
- label: "不启用",
|
|
|
|
- value: "0",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: "一物一码",
|
|
|
|
- value: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: "一物一码 & 先入先出",
|
|
|
|
- value: "2",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ itemWidth: 100,
|
|
|
|
+ style: {
|
|
|
|
+ width: "30%",
|
|
|
|
+ },
|
|
|
|
+ disabled: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: "input",
|
|
type: "input",
|
|
- prop: "qualityQualifiedRate",
|
|
|
|
- label: "质检合格率",
|
|
|
|
- itemWidth: 30,
|
|
|
|
- placeholder: "请输入质检合格率",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "title",
|
|
|
|
- title: "图片介绍",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "slot",
|
|
|
|
- slotName: "productPic",
|
|
|
|
- prop: "imgList",
|
|
|
|
- label: "产品主图",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "slot",
|
|
|
|
- slotName: "productPicOne",
|
|
|
|
- prop: "minorImgList",
|
|
|
|
- label: "产品副图",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "slot",
|
|
|
|
- slotName: "productPicTwo",
|
|
|
|
- prop: "fileList",
|
|
|
|
- label: "制作图纸",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: "slot",
|
|
|
|
- slotName: "detailDec",
|
|
|
|
|
|
+ itemType: "textarea",
|
|
prop: "remark",
|
|
prop: "remark",
|
|
- label: "详情描述",
|
|
|
|
|
|
+ label: "备注",
|
|
|
|
+ itemWidth: 100,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
});
|
|
});
|
|
@@ -692,7 +503,6 @@ const getList = async (req) => {
|
|
proxy
|
|
proxy
|
|
.post("/fileInfo/getList", {
|
|
.post("/fileInfo/getList", {
|
|
businessIdList: productIdList,
|
|
businessIdList: productIdList,
|
|
- fileType: 1,
|
|
|
|
})
|
|
})
|
|
.then((fileObj) => {
|
|
.then((fileObj) => {
|
|
for (let i = 0; i < sourceList.value.data.length; i++) {
|
|
for (let i = 0; i < sourceList.value.data.length; i++) {
|
|
@@ -724,63 +534,41 @@ const openModal = () => {
|
|
definition: "1",
|
|
definition: "1",
|
|
outerPackMethod: [],
|
|
outerPackMethod: [],
|
|
innerPackMethod: [],
|
|
innerPackMethod: [],
|
|
- remark: "",
|
|
|
|
- imgList: [],
|
|
|
|
- imgListCopy: [],
|
|
|
|
- minorImgList: [],
|
|
|
|
- minorImgListCopy: [],
|
|
|
|
fileList: [],
|
|
fileList: [],
|
|
fileListCopy: [],
|
|
fileListCopy: [],
|
|
|
|
+ currency: "$",
|
|
|
|
+ currencyOne: "¥",
|
|
};
|
|
};
|
|
- // fileList.value = [];
|
|
|
|
- // fileListCopy.value = [];
|
|
|
|
- // fileListOne.value = [];
|
|
|
|
- // fileListCopyOne.value = [];
|
|
|
|
};
|
|
};
|
|
|
|
|
|
const openExcel = () => {
|
|
const openExcel = () => {
|
|
openExcelDialog.value = true;
|
|
openExcelDialog.value = true;
|
|
};
|
|
};
|
|
-const submitExcel = () => {
|
|
|
|
- openExcelDialog.value = false;
|
|
|
|
-};
|
|
|
|
|
|
|
|
const tree = ref(null);
|
|
const tree = ref(null);
|
|
const needAtt = [
|
|
const needAtt = [
|
|
"productClassifyId",
|
|
"productClassifyId",
|
|
- "customCode",
|
|
|
|
"name",
|
|
"name",
|
|
"spec",
|
|
"spec",
|
|
"remark",
|
|
"remark",
|
|
"fileList",
|
|
"fileList",
|
|
- "imgList",
|
|
|
|
- "minorImgList",
|
|
|
|
- "fileListCopy",
|
|
|
|
- "imgListCopy",
|
|
|
|
- "minorImgListCopy",
|
|
|
|
"id",
|
|
"id",
|
|
|
|
+ "unit",
|
|
|
|
+ "definition",
|
|
];
|
|
];
|
|
|
|
+let jsonObj = {};
|
|
const submitForm = () => {
|
|
const submitForm = () => {
|
|
byform.value.handleSubmit((valid) => {
|
|
byform.value.handleSubmit((valid) => {
|
|
- if (!formData.data.imgListCopy.length > 0) {
|
|
|
|
|
|
+ if (!fileListCopy.value.length > 0) {
|
|
return ElMessage({
|
|
return ElMessage({
|
|
- message: "请上传产品主图",
|
|
|
|
|
|
+ message: "请上传产品图片",
|
|
type: "info",
|
|
type: "info",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- formData.data.imgList = formData.data.imgListCopy.map((x) => ({
|
|
|
|
|
|
+ formData.data.fileList = fileListCopy.value.map((x) => ({
|
|
id: x.id,
|
|
id: x.id,
|
|
fileName: x.fileName,
|
|
fileName: x.fileName,
|
|
}));
|
|
}));
|
|
- formData.data.minorImgList = formData.data.minorImgListCopy.map((x) => ({
|
|
|
|
- id: x.id,
|
|
|
|
- fileName: x.fileName,
|
|
|
|
- }));
|
|
|
|
- formData.data.fileList = formData.data.fileListCopy.map((x) => ({
|
|
|
|
- id: x.id,
|
|
|
|
- fileName: x.fileName,
|
|
|
|
- }));
|
|
|
|
- let jsonObj = {};
|
|
|
|
for (const key in formData.data) {
|
|
for (const key in formData.data) {
|
|
if (needAtt.includes(key)) {
|
|
if (needAtt.includes(key)) {
|
|
} else {
|
|
} else {
|
|
@@ -804,6 +592,13 @@ const submitForm = () => {
|
|
getList();
|
|
getList();
|
|
},
|
|
},
|
|
(err) => {
|
|
(err) => {
|
|
|
|
+ for (const key in jsonObj) {
|
|
|
|
+ formData.data[key] = jsonObj[key];
|
|
|
|
+ }
|
|
|
|
+ formData.data.innerPackMethod =
|
|
|
|
+ formData.data.innerPackMethod.split(",");
|
|
|
|
+ formData.data.outerPackMethod =
|
|
|
|
+ formData.data.outerPackMethod.split(",");
|
|
submitLoading.value = false;
|
|
submitLoading.value = false;
|
|
}
|
|
}
|
|
);
|
|
);
|
|
@@ -824,13 +619,9 @@ const getDtl = (row) => {
|
|
res.definition = "1"; //产品
|
|
res.definition = "1"; //产品
|
|
res = {
|
|
res = {
|
|
...res,
|
|
...res,
|
|
|
|
+ currency: "$",
|
|
|
|
+ currencyOne: "¥",
|
|
...JSON.parse(res.ehsdJson),
|
|
...JSON.parse(res.ehsdJson),
|
|
- imgList: [],
|
|
|
|
- imgListCopy: [],
|
|
|
|
- minorImgList: [],
|
|
|
|
- minorImgListCopy: [],
|
|
|
|
- fileList: [],
|
|
|
|
- fileListCopy: [],
|
|
|
|
};
|
|
};
|
|
if (res.innerPackMethod) {
|
|
if (res.innerPackMethod) {
|
|
res.innerPackMethod = res.innerPackMethod.split(",");
|
|
res.innerPackMethod = res.innerPackMethod.split(",");
|
|
@@ -845,29 +636,43 @@ const getDtl = (row) => {
|
|
formData.data = res;
|
|
formData.data = res;
|
|
dialogVisible.value = true;
|
|
dialogVisible.value = true;
|
|
proxy
|
|
proxy
|
|
- .post("/fileInfo/getList", { businessIdList: [row.id], fileType: 1 })
|
|
|
|
- .then((fileObj) => {
|
|
|
|
- formData.data.imgList = fileObj[row.id] || [];
|
|
|
|
- formData.data.imgListCopy = fileObj[row.id] || [];
|
|
|
|
- });
|
|
|
|
- proxy
|
|
|
|
- .post("/fileInfo/getList", { businessIdList: [row.id], fileType: 2 })
|
|
|
|
- .then((fileObj) => {
|
|
|
|
- formData.data.minorImgList = fileObj[row.id] || [];
|
|
|
|
- formData.data.minorImgListCopy = fileObj[row.id] || [];
|
|
|
|
- });
|
|
|
|
- proxy
|
|
|
|
- .post("/fileInfo/getList", { businessIdList: [row.id], fileType: 3 })
|
|
|
|
|
|
+ .post("/fileInfo/getList", { businessIdList: [row.id] })
|
|
.then((fileObj) => {
|
|
.then((fileObj) => {
|
|
- formData.data.fileList = fileObj[row.id] || [];
|
|
|
|
- formData.data.fileListCopy = fileObj[row.id] || [];
|
|
|
|
|
|
+ if (fileObj[row.id]) {
|
|
|
|
+ fileList.value = fileObj[row.id].map((x) => ({
|
|
|
|
+ ...x,
|
|
|
|
+ url: x.fileUrl,
|
|
|
|
+ }));
|
|
|
|
+ fileListCopy.value = fileObj[row.id].map((x) => ({
|
|
|
|
+ ...x,
|
|
|
|
+ url: x.fileUrl,
|
|
|
|
+ }));
|
|
|
|
+ } else {
|
|
|
|
+ fileList.value = [];
|
|
|
|
+ fileListCopy.value = [];
|
|
|
|
+ }
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
};
|
|
-const handleBeforeUpload = async (file, att) => {
|
|
|
|
|
|
+
|
|
|
|
+const isdisabled = ["price", "costPrice", "remark", "netWeight"];
|
|
|
|
+watch(modalType, (val) => {
|
|
|
|
+ if (val) {
|
|
|
|
+ for (let i = 0; i < formConfig.value.length; i++) {
|
|
|
|
+ const element = formConfig.value[i];
|
|
|
|
+ if (element.type != "title" || element.type != "slot") {
|
|
|
|
+ if (!isdisabled.includes(element.prop)) {
|
|
|
|
+ element.disabled = val == "edit" ? true : false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const handleBeforeUpload = async (file) => {
|
|
const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
uploadData.value = res.uploadBody;
|
|
uploadData.value = res.uploadBody;
|
|
- formData.data[att + "Copy"].push({
|
|
|
|
|
|
+ fileListCopy.value.push({
|
|
id: res.id,
|
|
id: res.id,
|
|
fileName: res.fileName,
|
|
fileName: res.fileName,
|
|
path: res.fileUrl,
|
|
path: res.fileUrl,
|
|
@@ -875,27 +680,54 @@ const handleBeforeUpload = async (file, att) => {
|
|
uid: file.uid,
|
|
uid: file.uid,
|
|
});
|
|
});
|
|
};
|
|
};
|
|
-const handleRemove = (file, att) => {
|
|
|
|
- const index = formData.data[att + "Copy"].findIndex(
|
|
|
|
|
|
+
|
|
|
|
+const handleRemove = (file) => {
|
|
|
|
+ const index = fileListCopy.value.findIndex(
|
|
(x) => x.uid === file.uid || x.id === file.id
|
|
(x) => x.uid === file.uid || x.id === file.id
|
|
);
|
|
);
|
|
- formData.data[att + "Copy"].splice(index, 1);
|
|
|
|
-};
|
|
|
|
-const handleClose = (index) => {
|
|
|
|
- formData.data.fileList.splice(index, 1);
|
|
|
|
- formData.data.fileListCopy.splice(index, 1);
|
|
|
|
|
|
+ fileListCopy.value.splice(index, 1);
|
|
};
|
|
};
|
|
|
|
+
|
|
const handleClickFile = (file) => {
|
|
const handleClickFile = (file) => {
|
|
window.open(file.fileUrl, "_blank");
|
|
window.open(file.fileUrl, "_blank");
|
|
};
|
|
};
|
|
-const updateContent = (val) => {
|
|
|
|
- formData.data.remark = val;
|
|
|
|
|
|
+
|
|
|
|
+const handleProgress = () => {
|
|
|
|
+ excelLoading.value = true;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const handleError = (err) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: `${err},请重试!`,
|
|
|
|
+ type: "info",
|
|
|
|
+ });
|
|
|
|
+ openExcelDialog.value = false;
|
|
|
|
+ excelLoading.value = false;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const handleSuccess = (res) => {
|
|
|
|
+ if (res.code != 200) {
|
|
|
|
+ return ElMessage({
|
|
|
|
+ message: `${res.msg},请重试!`,
|
|
|
|
+ type: "info",
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: "导入成功!",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ openExcelDialog.value = false;
|
|
|
|
+ excelLoading.value = false;
|
|
|
|
+ getList();
|
|
|
|
+ }
|
|
};
|
|
};
|
|
const getDict = () => {
|
|
const getDict = () => {
|
|
proxy
|
|
proxy
|
|
.getDictOne([
|
|
.getDictOne([
|
|
"inner_packaging_method_ehsd",
|
|
"inner_packaging_method_ehsd",
|
|
"outside_packaging_method_ehsd",
|
|
"outside_packaging_method_ehsd",
|
|
|
|
+ "unit",
|
|
])
|
|
])
|
|
.then((res) => {
|
|
.then((res) => {
|
|
innerMethon.value = res["inner_packaging_method_ehsd"].map((x) => ({
|
|
innerMethon.value = res["inner_packaging_method_ehsd"].map((x) => ({
|
|
@@ -906,6 +738,10 @@ const getDict = () => {
|
|
label: x.dictValue,
|
|
label: x.dictValue,
|
|
value: x.dictKey,
|
|
value: x.dictKey,
|
|
}));
|
|
}));
|
|
|
|
+ productUnit.value = res["unit"].map((x) => ({
|
|
|
|
+ label: x.dictValue,
|
|
|
|
+ value: x.dictKey,
|
|
|
|
+ }));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
getDict();
|
|
getDict();
|