|
@@ -7,7 +7,8 @@
|
|
:data="treeListData"
|
|
:data="treeListData"
|
|
v-model="sourceList.pagination.productClassifyId"
|
|
v-model="sourceList.pagination.productClassifyId"
|
|
@change="treeChange"
|
|
@change="treeChange"
|
|
- @changeTreeList="getTreeList">
|
|
|
|
|
|
+ @changeTreeList="getTreeList"
|
|
|
|
+ >
|
|
</treeList>
|
|
</treeList>
|
|
</div>
|
|
</div>
|
|
<div class="content">
|
|
<div class="content">
|
|
@@ -38,16 +39,22 @@
|
|
disabled: false,
|
|
disabled: false,
|
|
},
|
|
},
|
|
]"
|
|
]"
|
|
- @get-list="getList">
|
|
|
|
|
|
+ @get-list="getList"
|
|
|
|
+ >
|
|
<template #pic="{ item }">
|
|
<template #pic="{ item }">
|
|
<div v-if="item.fileList.length > 0">
|
|
<div v-if="item.fileList.length > 0">
|
|
- <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
|
|
|
|
|
|
+ <img
|
|
|
|
+ :src="item.fileList[0].fileUrl"
|
|
|
|
+ class="pic"
|
|
|
|
+ @click="handleClickFile(item.fileList[0])"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
<div v-else></div>
|
|
<div v-else></div>
|
|
</template>
|
|
</template>
|
|
<template #size="{ item }">
|
|
<template #size="{ item }">
|
|
<div>
|
|
<div>
|
|
- <span>{{ item.productLong }}cm</span>* <span>{{ item.productWide }}cm</span>*
|
|
|
|
|
|
+ <span>{{ item.productLong }}cm</span>*
|
|
|
|
+ <span>{{ item.productWide }}cm</span>*
|
|
<span>{{ item.productHigh }}cm</span>
|
|
<span>{{ item.productHigh }}cm</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -64,9 +71,21 @@
|
|
</byTable>
|
|
</byTable>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="600" v-loading="submitLoading" destroy-on-close>
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="modalType == 'add' ? '添加产品' : '编辑产品'"
|
|
|
|
+ v-model="dialogVisible"
|
|
|
|
+ width="600"
|
|
|
|
+ v-loading="submitLoading"
|
|
|
|
+ destroy-on-close
|
|
|
|
+ >
|
|
<div class="public_height_dialog">
|
|
<div class="public_height_dialog">
|
|
- <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
|
|
|
|
|
|
+ <byForm
|
|
|
|
+ :formConfig="formConfig"
|
|
|
|
+ :formOption="formOption"
|
|
|
|
+ v-model="formData.data"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ ref="byform"
|
|
|
|
+ >
|
|
<template #productPic>
|
|
<template #productPic>
|
|
<div>
|
|
<div>
|
|
<el-upload
|
|
<el-upload
|
|
@@ -76,7 +95,8 @@
|
|
list-type="picture-card"
|
|
list-type="picture-card"
|
|
:on-remove="handleRemove"
|
|
:on-remove="handleRemove"
|
|
:before-upload="handleBeforeUpload"
|
|
: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>
|
|
@@ -85,11 +105,22 @@
|
|
</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 type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">确 定</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="submitForm('byform')"
|
|
|
|
+ size="large"
|
|
|
|
+ :loading="submitLoading"
|
|
|
|
+ >确 定</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="导入产品" v-model="openExcelDialog" width="400" v-loading="excelLoading">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="导入产品"
|
|
|
|
+ v-model="openExcelDialog"
|
|
|
|
+ width="400"
|
|
|
|
+ v-loading="excelLoading"
|
|
|
|
+ >
|
|
<el-upload
|
|
<el-upload
|
|
:action="actionUrl + '/productInfo/excelImportByEhsd'"
|
|
:action="actionUrl + '/productInfo/excelImportByEhsd'"
|
|
:headers="headers"
|
|
:headers="headers"
|
|
@@ -97,11 +128,14 @@
|
|
:on-progress="handleProgress"
|
|
:on-progress="handleProgress"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:on-error="handleError"
|
|
:on-error="handleError"
|
|
- accept=".xlsx">
|
|
|
|
|
|
+ accept=".xlsx"
|
|
|
|
+ >
|
|
<el-button type="primary">点击导入</el-button>
|
|
<el-button type="primary">点击导入</el-button>
|
|
</el-upload>
|
|
</el-upload>
|
|
<template #footer>
|
|
<template #footer>
|
|
- <el-button @click="openExcelDialog = false" size="large">取 消</el-button>
|
|
|
|
|
|
+ <el-button @click="openExcelDialog = false" size="large"
|
|
|
|
+ >取 消</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -140,14 +174,26 @@ let openExcelDialog = ref(false);
|
|
let excelLoading = ref(false);
|
|
let excelLoading = ref(false);
|
|
let modalType = ref("add");
|
|
let modalType = ref("add");
|
|
let rules = ref({
|
|
let rules = ref({
|
|
- productClassifyId: [{ required: true, message: "请选择产品分类", trigger: "change" }],
|
|
|
|
|
|
+ productClassifyId: [
|
|
|
|
+ { required: true, message: "请选择产品分类", trigger: "change" },
|
|
|
|
+ ],
|
|
name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
unit: [{ required: true, message: "请选择产品单位", trigger: "change" }],
|
|
unit: [{ required: true, message: "请选择产品单位", trigger: "change" }],
|
|
- productLong: [{ required: true, message: "请输入长 (cm)", trigger: "blur" }],
|
|
|
|
- productWide: [{ required: true, message: "请输入宽 (cm)", trigger: "blur" }],
|
|
|
|
- productHigh: [{ required: true, message: "请输入高 (cm)", trigger: "blur" }],
|
|
|
|
- innerPackMethod: [{ required: true, message: "请选择内包装方式", trigger: "change" }],
|
|
|
|
- outerPackMethod: [{ required: true, message: "请选择外包装方式", trigger: "change" }],
|
|
|
|
|
|
+ productLong: [
|
|
|
|
+ { required: true, message: "请输入长 (cm)", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ productWide: [
|
|
|
|
+ { required: true, message: "请输入宽 (cm)", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ productHigh: [
|
|
|
|
+ { required: true, message: "请输入高 (cm)", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ innerPackMethod: [
|
|
|
|
+ { required: true, message: "请选择内包装方式", trigger: "change" },
|
|
|
|
+ ],
|
|
|
|
+ outerPackMethod: [
|
|
|
|
+ { required: true, message: "请选择外包装方式", trigger: "change" },
|
|
|
|
+ ],
|
|
});
|
|
});
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -254,11 +300,15 @@ const config = computed(() => {
|
|
el: "button",
|
|
el: "button",
|
|
click() {
|
|
click() {
|
|
// 弹窗提示是否删除
|
|
// 弹窗提示是否删除
|
|
- ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning",
|
|
|
|
- }).then(() => {
|
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
+ "此操作将永久删除该数据, 是否继续?",
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).then(() => {
|
|
// 删除
|
|
// 删除
|
|
proxy
|
|
proxy
|
|
.post("/productInfo/delete", {
|
|
.post("/productInfo/delete", {
|
|
@@ -464,40 +514,42 @@ const formConfig = computed(() => {
|
|
const getList = async (req) => {
|
|
const getList = async (req) => {
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
loading.value = true;
|
|
loading.value = true;
|
|
- proxy.post("/productInfo/getConditionProductList", sourceList.value.pagination).then(
|
|
|
|
- (message) => {
|
|
|
|
- sourceList.value.data = message.rows.map((x) => ({
|
|
|
|
- ...x,
|
|
|
|
- fileList: [],
|
|
|
|
- ...JSON.parse(x.ehsdJson),
|
|
|
|
- }));
|
|
|
|
- sourceList.value.pagination.total = message.total;
|
|
|
|
- setTimeout(() => {
|
|
|
|
- loading.value = false;
|
|
|
|
- }, 200);
|
|
|
|
- const productIdList = message.rows.map((x) => x.id);
|
|
|
|
- // 请求文件数据并回显
|
|
|
|
- if (productIdList.length > 0) {
|
|
|
|
- proxy
|
|
|
|
- .post("/fileInfo/getList", {
|
|
|
|
- businessIdList: productIdList,
|
|
|
|
- })
|
|
|
|
- .then((fileObj) => {
|
|
|
|
- for (let i = 0; i < sourceList.value.data.length; i++) {
|
|
|
|
- const e = sourceList.value.data[i];
|
|
|
|
- for (const key in fileObj) {
|
|
|
|
- if (e.id === key) {
|
|
|
|
- e.fileList = fileObj[key];
|
|
|
|
|
|
+ proxy
|
|
|
|
+ .post("/productInfo/getConditionProductList", sourceList.value.pagination)
|
|
|
|
+ .then(
|
|
|
|
+ (message) => {
|
|
|
|
+ sourceList.value.data = message.rows.map((x) => ({
|
|
|
|
+ ...x,
|
|
|
|
+ fileList: [],
|
|
|
|
+ ...JSON.parse(x.ehsdJson),
|
|
|
|
+ }));
|
|
|
|
+ sourceList.value.pagination.total = message.total;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ loading.value = false;
|
|
|
|
+ }, 200);
|
|
|
|
+ const productIdList = message.rows.map((x) => x.id);
|
|
|
|
+ // 请求文件数据并回显
|
|
|
|
+ if (productIdList.length > 0) {
|
|
|
|
+ proxy
|
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
|
+ businessIdList: productIdList,
|
|
|
|
+ })
|
|
|
|
+ .then((fileObj) => {
|
|
|
|
+ for (let i = 0; i < sourceList.value.data.length; i++) {
|
|
|
|
+ const e = sourceList.value.data[i];
|
|
|
|
+ for (const key in fileObj) {
|
|
|
|
+ if (e.id === key) {
|
|
|
|
+ e.fileList = fileObj[key];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ loading.value = false;
|
|
}
|
|
}
|
|
- },
|
|
|
|
- (err) => {
|
|
|
|
- loading.value = false;
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ );
|
|
};
|
|
};
|
|
|
|
|
|
const treeChange = (e) => {
|
|
const treeChange = (e) => {
|
|
@@ -517,13 +569,24 @@ const openModal = () => {
|
|
currency: "$",
|
|
currency: "$",
|
|
currencyOne: "¥",
|
|
currencyOne: "¥",
|
|
};
|
|
};
|
|
|
|
+ fileList.value = [];
|
|
|
|
+ fileListCopy.value = [];
|
|
};
|
|
};
|
|
|
|
|
|
const openExcel = () => {
|
|
const openExcel = () => {
|
|
openExcelDialog.value = true;
|
|
openExcelDialog.value = true;
|
|
};
|
|
};
|
|
|
|
|
|
-const needAtt = ["productClassifyId", "name", "spec", "remark", "fileList", "id", "unit", "definition"];
|
|
|
|
|
|
+const needAtt = [
|
|
|
|
+ "productClassifyId",
|
|
|
|
+ "name",
|
|
|
|
+ "spec",
|
|
|
|
+ "remark",
|
|
|
|
+ "fileList",
|
|
|
|
+ "id",
|
|
|
|
+ "unit",
|
|
|
|
+ "definition",
|
|
|
|
+];
|
|
let jsonObj = {};
|
|
let jsonObj = {};
|
|
const submitForm = () => {
|
|
const submitForm = () => {
|
|
byform.value.handleSubmit((valid) => {
|
|
byform.value.handleSubmit((valid) => {
|
|
@@ -563,17 +626,21 @@ const submitForm = () => {
|
|
for (const key in jsonObj) {
|
|
for (const key in jsonObj) {
|
|
formData.data[key] = jsonObj[key];
|
|
formData.data[key] = jsonObj[key];
|
|
}
|
|
}
|
|
- formData.data.innerPackMethod = formData.data.innerPackMethod.split(",");
|
|
|
|
- formData.data.outerPackMethod = formData.data.outerPackMethod.split(",");
|
|
|
|
|
|
+ formData.data.innerPackMethod =
|
|
|
|
+ formData.data.innerPackMethod.split(",");
|
|
|
|
+ formData.data.outerPackMethod =
|
|
|
|
+ formData.data.outerPackMethod.split(",");
|
|
submitLoading.value = false;
|
|
submitLoading.value = false;
|
|
}
|
|
}
|
|
);
|
|
);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
const getTreeList = () => {
|
|
const getTreeList = () => {
|
|
- proxy.post("/productClassify/tree", { parentId: "", name: "", definition: "1" }).then((message) => {
|
|
|
|
- treeListData.value = message;
|
|
|
|
- });
|
|
|
|
|
|
+ proxy
|
|
|
|
+ .post("/productClassify/tree", { parentId: "", name: "", definition: "1" })
|
|
|
|
+ .then((message) => {
|
|
|
|
+ treeListData.value = message;
|
|
|
|
+ });
|
|
};
|
|
};
|
|
const getDtl = (row) => {
|
|
const getDtl = (row) => {
|
|
modalType.value = "edit";
|
|
modalType.value = "edit";
|
|
@@ -597,21 +664,23 @@ const getDtl = (row) => {
|
|
}
|
|
}
|
|
formData.data = res;
|
|
formData.data = res;
|
|
dialogVisible.value = true;
|
|
dialogVisible.value = true;
|
|
- proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((fileObj) => {
|
|
|
|
- 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 = [];
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ proxy
|
|
|
|
+ .post("/fileInfo/getList", { businessIdList: [row.id] })
|
|
|
|
+ .then((fileObj) => {
|
|
|
|
+ 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 isdisabled = ["price", "costPrice", "remark", "netWeight"];
|
|
const isdisabled = ["price", "costPrice", "remark", "netWeight"];
|
|
@@ -639,7 +708,9 @@ const handleBeforeUpload = async (file) => {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
const handleRemove = (file) => {
|
|
const handleRemove = (file) => {
|
|
- const index = fileListCopy.value.findIndex((x) => x.uid === file.uid || x.id === file.id);
|
|
|
|
|
|
+ const index = fileListCopy.value.findIndex(
|
|
|
|
+ (x) => x.uid === file.uid || x.id === file.id
|
|
|
|
+ );
|
|
fileListCopy.value.splice(index, 1);
|
|
fileListCopy.value.splice(index, 1);
|
|
};
|
|
};
|
|
const handleClickFile = (file) => {
|
|
const handleClickFile = (file) => {
|
|
@@ -674,24 +745,31 @@ const handleSuccess = (res) => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const getDict = () => {
|
|
const getDict = () => {
|
|
- proxy.getDictOne(["inner_packaging_method_ehsd", "outside_packaging_method_ehsd", "unit", "account_currency"]).then((res) => {
|
|
|
|
- innerMethon.value = res["inner_packaging_method_ehsd"].map((x) => ({
|
|
|
|
- label: x.dictValue,
|
|
|
|
- value: x.dictKey,
|
|
|
|
- }));
|
|
|
|
- outsideMethon.value = res["outside_packaging_method_ehsd"].map((x) => ({
|
|
|
|
- label: x.dictValue,
|
|
|
|
- value: x.dictKey,
|
|
|
|
- }));
|
|
|
|
- productUnit.value = res["unit"].map((x) => ({
|
|
|
|
- label: x.dictValue,
|
|
|
|
- value: x.dictKey,
|
|
|
|
- }));
|
|
|
|
- accountCurrency.value = res["account_currency"].map((x) => ({
|
|
|
|
- label: x.dictKey,
|
|
|
|
- value: x.dictValue,
|
|
|
|
- }));
|
|
|
|
- });
|
|
|
|
|
|
+ proxy
|
|
|
|
+ .getDictOne([
|
|
|
|
+ "inner_packaging_method_ehsd",
|
|
|
|
+ "outside_packaging_method_ehsd",
|
|
|
|
+ "unit",
|
|
|
|
+ "account_currency",
|
|
|
|
+ ])
|
|
|
|
+ .then((res) => {
|
|
|
|
+ innerMethon.value = res["inner_packaging_method_ehsd"].map((x) => ({
|
|
|
|
+ label: x.dictValue,
|
|
|
|
+ value: x.dictKey,
|
|
|
|
+ }));
|
|
|
|
+ outsideMethon.value = res["outside_packaging_method_ehsd"].map((x) => ({
|
|
|
|
+ label: x.dictValue,
|
|
|
|
+ value: x.dictKey,
|
|
|
|
+ }));
|
|
|
|
+ productUnit.value = res["unit"].map((x) => ({
|
|
|
|
+ label: x.dictValue,
|
|
|
|
+ value: x.dictKey,
|
|
|
|
+ }));
|
|
|
|
+ accountCurrency.value = res["account_currency"].map((x) => ({
|
|
|
|
+ label: x.dictKey,
|
|
|
|
+ value: x.dictValue,
|
|
|
|
+ }));
|
|
|
|
+ });
|
|
};
|
|
};
|
|
getDict();
|
|
getDict();
|
|
getTreeList();
|
|
getTreeList();
|