|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="user">
|
|
|
+ <div class="box">
|
|
|
<div class="tree">
|
|
|
<treeList title="产品分类" submitType="1" :data="treeListData" v-model="sourceList.pagination.productClassifyId" @change="treeChange"
|
|
|
@changeTreeList="getTreeList">
|
|
@@ -7,20 +7,13 @@
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
<byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
- :selectConfig="selectConfig" :table-events="{
|
|
|
- //element talbe事件都能传
|
|
|
- select: select,
|
|
|
- }" :action-list="[
|
|
|
- props.selectStatus
|
|
|
- ? {}
|
|
|
- : {
|
|
|
+ :selectConfig="selectConfig" :action-list="[
|
|
|
+ {
|
|
|
text: 'Excel导入',
|
|
|
action: () => openExcel(),
|
|
|
disabled: false,
|
|
|
},
|
|
|
- props.selectStatus
|
|
|
- ? {}
|
|
|
- : {
|
|
|
+ {
|
|
|
text: '添加',
|
|
|
action: () => openModal('add'),
|
|
|
disabled: false,
|
|
@@ -57,52 +50,54 @@
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="80%" v-loading="submitLoading" destroy-on-close>
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="80%" destroy-on-close>
|
|
|
<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="formDom" v-loading="submitLoading">
|
|
|
<template #nameEnglish>
|
|
|
<div style="width: 100%">
|
|
|
<el-input v-model="formData.data.nameEnglish" placeholder="请输入" onkeyup="value=value.replace(/[^\x00-\xff]/g, '')"></el-input>
|
|
|
- <!-- @input="(val) => handleKeyup(val)" -->
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #productionFile>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <!-- <a href="ftp://192.168.1.13/" target="_blank" style="color:#409eff">点击上传</a> -->
|
|
|
+ <span style="color:#409eff;cursor:pointer" @click="handleClickUpload">点击上传</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #productionFileOne>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <span style="color:#409eff;cursor:pointer" @click="handleClickUpload">点击上传</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #productLong>
|
|
|
<div style="width: 100%">
|
|
|
- <el-row :gutter="10">
|
|
|
+ <el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item prop="productLong" label-width="0px" class="margin-b-0">
|
|
|
- <el-input v-model="formData.data.productLong" placeholder="请输入"></el-input>
|
|
|
+ <el-form-item prop="productLong" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.productLong" placeholder="请输入" 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="productWide" label-width="0px" class="margin-b-0">
|
|
|
- <el-input v-model="formData.data.productWide" placeholder="请输入"></el-input>
|
|
|
+ <el-form-item prop="productWide" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.productWide" placeholder="请输入" 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="productHigh" label-width="0px" class="margin-b-0">
|
|
|
- <el-input v-model="formData.data.productHigh" placeholder="请输入"></el-input>
|
|
|
+ <el-form-item prop="productHigh" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.productHigh" placeholder="请输入" style="width: 100%" :precision="2" :controls="false"
|
|
|
+ :min="0" onmousewheel="return false;" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #productPic>
|
|
|
- <div>
|
|
|
- <el-upload v-model:fileList="fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
|
|
|
- list-type="picture-card" :on-remove="handleRemove" :before-upload="handleBeforeUpload" :on-preview="handlePreview"
|
|
|
- accept=".gif, .jpeg, .jpg, .png">
|
|
|
- <el-icon>
|
|
|
- <Plus />
|
|
|
- </el-icon>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</byForm>
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="defualt" v-debounce>取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm('byform')" size="defualt" :loading="submitLoading" v-debounce>确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="defualt" v-debounce>确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -116,29 +111,28 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog v-if="productContractDialog" v-model="productContractDialog" :title="'外销合同'" width="80%" append-to-body>
|
|
|
- <ProductContract :currentProductId="currentProductId"></ProductContract>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import treeList from "@/components/product/treeList";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
-import ProductContract from "@/components/contractCom/productContract.vue";
|
|
|
-
|
|
|
-const headers = ref({ Authorization: "Bearer " + getToken() });
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
const actionUrl = import.meta.env.VITE_APP_BASE_API;
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const treeListData = ref([]);
|
|
|
-const innerMethon = ref([]);
|
|
|
-const outsideMethon = ref([]);
|
|
|
-const productUnit = ref([]);
|
|
|
-const accountCurrency = ref([]);
|
|
|
+const innerMethon = computed(
|
|
|
+ () => proxy.useUserStore().allDict["inner_packaging_method_ehsd"]
|
|
|
+);
|
|
|
+const outsideMethon = computed(
|
|
|
+ () => proxy.useUserStore().allDict["outside_packaging_method_ehsd"]
|
|
|
+);
|
|
|
+const productUnit = computed(() => proxy.useUserStore().allDict["unit"]);
|
|
|
+const currencyData = computed(
|
|
|
+ () => proxy.useUserStore().allDict["account_currency"]
|
|
|
+);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
|
pagination: {
|
|
@@ -151,11 +145,11 @@ const sourceList = ref({
|
|
|
definition: "1",
|
|
|
},
|
|
|
});
|
|
|
-let dialogVisible = ref(false);
|
|
|
-let openExcelDialog = ref(false);
|
|
|
-let excelLoading = ref(false);
|
|
|
-let modalType = ref("add");
|
|
|
-let rules = ref({
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const openExcelDialog = ref(false);
|
|
|
+const excelLoading = ref(false);
|
|
|
+const modalType = ref("add");
|
|
|
+const rules = ref({
|
|
|
productClassifyId: [
|
|
|
{ required: true, message: "请选择产品分类", trigger: "change" },
|
|
|
],
|
|
@@ -179,7 +173,6 @@ let rules = ref({
|
|
|
{ required: true, message: "请选择外包装方式", trigger: "change" },
|
|
|
],
|
|
|
});
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
const props = defineProps({
|
|
|
selectStatus: Boolean,
|
|
|
});
|
|
@@ -203,7 +196,7 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "产品编码",
|
|
|
- prop: "code",
|
|
|
+ prop: "customCode",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -223,16 +216,10 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "销售指导价",
|
|
|
slot: "price",
|
|
|
- width: 150,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "成本价",
|
|
|
- slot: "costPrice",
|
|
|
- width: 150,
|
|
|
+ width: 100,
|
|
|
},
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
@@ -275,29 +262,19 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- // 弹窗提示是否删除
|
|
|
- ElMessageBox.confirm(
|
|
|
- "此操作将永久删除该数据, 是否继续?",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
- // 删除
|
|
|
- proxy
|
|
|
- .post("/productInfo/delete", {
|
|
|
- id: row.id,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- ElMessage({
|
|
|
- message: "删除成功",
|
|
|
- type: "success",
|
|
|
+ proxy
|
|
|
+ .msgConfirm()
|
|
|
+ .then((res) => {
|
|
|
+ proxy
|
|
|
+ .post("/productInfo/delete", {
|
|
|
+ id: row.id,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ proxy.msgTip("删除成功", 1);
|
|
|
+ getList();
|
|
|
});
|
|
|
- getList();
|
|
|
- });
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
},
|
|
|
},
|
|
|
];
|
|
@@ -309,7 +286,7 @@ const config = computed(() => {
|
|
|
const uploadData = ref({});
|
|
|
const fileList = ref([]);
|
|
|
const fileListCopy = ref([]);
|
|
|
-let formData = reactive({
|
|
|
+const formData = reactive({
|
|
|
data: {},
|
|
|
});
|
|
|
const formOption = reactive({
|
|
@@ -319,7 +296,7 @@ const formOption = reactive({
|
|
|
itemWidth: 100,
|
|
|
rules: [],
|
|
|
});
|
|
|
-const byform = ref(null);
|
|
|
+const formDom = ref(null);
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -331,11 +308,8 @@ const formConfig = computed(() => {
|
|
|
prop: "productClassifyId",
|
|
|
label: "产品分类",
|
|
|
data: treeListData.value,
|
|
|
- itemWidth: 50,
|
|
|
+ itemWidth: 100,
|
|
|
disabled: false,
|
|
|
- style: {
|
|
|
- width: "100%",
|
|
|
- },
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
@@ -351,10 +325,30 @@ const formConfig = computed(() => {
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
{
|
|
|
- type: "slot",
|
|
|
- slotName: "productPic",
|
|
|
+ type: "input",
|
|
|
+ prop: "customCode",
|
|
|
+ label: "产品编号",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "picture-card",
|
|
|
+ accept: ".gif, .jpeg, .jpg, .png",
|
|
|
prop: "fileList",
|
|
|
- label: "产品图片",
|
|
|
+ label: "产品缩略图",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "productionFileOne",
|
|
|
+ label: "产品原图",
|
|
|
+ itemWidth: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "productionFile",
|
|
|
+ label: "生产文件",
|
|
|
+ itemWidth: 100,
|
|
|
},
|
|
|
{
|
|
|
type: "title1",
|
|
@@ -364,24 +358,36 @@ const formConfig = computed(() => {
|
|
|
type: "selectInput",
|
|
|
prop: "price",
|
|
|
selectProp: "currency",
|
|
|
- label: "销售指导价",
|
|
|
+ label: "销售价",
|
|
|
itemWidth: 50,
|
|
|
- style: {
|
|
|
- width: "100%",
|
|
|
- },
|
|
|
- data: accountCurrency.value,
|
|
|
+ disabledSelect: true,
|
|
|
+ data: currencyData.value,
|
|
|
},
|
|
|
{
|
|
|
- type: "selectInput",
|
|
|
- prop: "costPrice",
|
|
|
- selectProp: "costCurrency",
|
|
|
- label: "成本价",
|
|
|
+ type: "title1",
|
|
|
+ title: "工艺",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "sss",
|
|
|
+ label: "工艺选择",
|
|
|
itemWidth: 50,
|
|
|
- style: {
|
|
|
- width: "100%",
|
|
|
- },
|
|
|
- data: accountCurrency.value,
|
|
|
+ data: [],
|
|
|
+ filterable: true,
|
|
|
+ // placeholder: "",
|
|
|
+ disabled: false,
|
|
|
},
|
|
|
+ // {
|
|
|
+ // type: "selectInput",
|
|
|
+ // prop: "costPrice",
|
|
|
+ // selectProp: "costCurrency",
|
|
|
+ // label: "成本价",
|
|
|
+ // itemWidth: 50,
|
|
|
+ // style: {
|
|
|
+ // width: "100%",
|
|
|
+ // },
|
|
|
+ // data: currencyData.value,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "title1",
|
|
|
title: "属性信息",
|
|
@@ -399,59 +405,45 @@ const formConfig = computed(() => {
|
|
|
prop: "productLong",
|
|
|
label: "尺寸",
|
|
|
itemWidth: 50,
|
|
|
- // placeholder: "长(cm)",
|
|
|
disabled: false,
|
|
|
},
|
|
|
// {
|
|
|
- // type: "input",
|
|
|
- // prop: "productWide",
|
|
|
- // label: "",
|
|
|
- // itemWidth: 33.33,
|
|
|
- // placeholder: "宽(cm)",
|
|
|
+ // type: "select",
|
|
|
+ // prop: "innerPackMethod",
|
|
|
+ // label: "内包装方式",
|
|
|
+ // required: true,
|
|
|
+ // itemWidth: 50,
|
|
|
+ // multiple: true,
|
|
|
+ // data: innerMethon.value,
|
|
|
+ // filterable: true,
|
|
|
+ // placeholder: "内包装方式",
|
|
|
+ // style: {
|
|
|
+ // width: "100%",
|
|
|
+ // },
|
|
|
// disabled: false,
|
|
|
// },
|
|
|
// {
|
|
|
- // type: "input",
|
|
|
- // prop: "productHigh",
|
|
|
- // label: "",
|
|
|
- // itemWidth: 33.33,
|
|
|
- // placeholder: "高(cm)",
|
|
|
+ // type: "select",
|
|
|
+ // prop: "outerPackMethod",
|
|
|
+ // label: "外包装方式",
|
|
|
+ // required: true,
|
|
|
+ // itemWidth: 50,
|
|
|
+ // multiple: true,
|
|
|
+ // data: outsideMethon.value,
|
|
|
+ // filterable: true,
|
|
|
+ // placeholder: "外包装方式",
|
|
|
+ // style: {
|
|
|
+ // width: "100%",
|
|
|
+ // },
|
|
|
// disabled: false,
|
|
|
// },
|
|
|
{
|
|
|
- type: "select",
|
|
|
- prop: "innerPackMethod",
|
|
|
- label: "内包装方式",
|
|
|
- required: true,
|
|
|
- itemWidth: 50,
|
|
|
- multiple: true,
|
|
|
- data: innerMethon.value,
|
|
|
- filterable: true,
|
|
|
- placeholder: "内包装方式",
|
|
|
- style: {
|
|
|
- width: "100%",
|
|
|
- },
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "select",
|
|
|
- prop: "outerPackMethod",
|
|
|
- label: "外包装方式",
|
|
|
- required: true,
|
|
|
- itemWidth: 50,
|
|
|
- multiple: true,
|
|
|
- data: outsideMethon.value,
|
|
|
- filterable: true,
|
|
|
- placeholder: "外包装方式",
|
|
|
- style: {
|
|
|
- width: "100%",
|
|
|
- },
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
+ type: "number",
|
|
|
prop: "netWeight",
|
|
|
label: "净重(kg)",
|
|
|
+ precision: 2,
|
|
|
+ min: 0,
|
|
|
+ controls: false,
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
{
|
|
@@ -471,23 +463,22 @@ const formConfig = computed(() => {
|
|
|
];
|
|
|
});
|
|
|
|
|
|
-const getList = async (req) => {
|
|
|
+const getList = (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
loading.value = true;
|
|
|
proxy
|
|
|
.post("/productInfo/getConditionProductList", sourceList.value.pagination)
|
|
|
.then(
|
|
|
- (message) => {
|
|
|
- sourceList.value.data = message.rows.map((x) => ({
|
|
|
+ (res) => {
|
|
|
+ sourceList.value.data = res.rows.map((x) => ({
|
|
|
...x,
|
|
|
fileList: [],
|
|
|
- ...JSON.parse(x.ehsdJson),
|
|
|
}));
|
|
|
- sourceList.value.pagination.total = message.total;
|
|
|
+ sourceList.value.pagination.total = res.total;
|
|
|
setTimeout(() => {
|
|
|
loading.value = false;
|
|
|
}, 200);
|
|
|
- const productIdList = message.rows.map((x) => x.id);
|
|
|
+ let productIdList = res.rows.map((x) => x.id);
|
|
|
// 请求文件数据并回显
|
|
|
if (productIdList.length > 0) {
|
|
|
proxy
|
|
@@ -496,8 +487,8 @@ const getList = async (req) => {
|
|
|
})
|
|
|
.then((fileObj) => {
|
|
|
for (let i = 0; i < sourceList.value.data.length; i++) {
|
|
|
- const e = sourceList.value.data[i];
|
|
|
- for (const key in fileObj) {
|
|
|
+ let e = sourceList.value.data[i];
|
|
|
+ for (let key in fileObj) {
|
|
|
if (e.id === key) {
|
|
|
e.fileList = fileObj[key];
|
|
|
}
|
|
@@ -522,78 +513,39 @@ const openModal = () => {
|
|
|
modalType.value = "add";
|
|
|
formData.data = {
|
|
|
definition: "1",
|
|
|
- outerPackMethod: [],
|
|
|
- innerPackMethod: [],
|
|
|
fileList: [],
|
|
|
- fileListCopy: [],
|
|
|
currency: "",
|
|
|
costCurrency: "",
|
|
|
};
|
|
|
- if (accountCurrency.value && accountCurrency.value.length > 0) {
|
|
|
- formData.data.currency = accountCurrency.value[0].value;
|
|
|
- formData.data.costCurrency = accountCurrency.value[0].value;
|
|
|
+ if (currencyData.value && currencyData.value.length > 0) {
|
|
|
+ formData.data.currency = currencyData.value[0].dictKey;
|
|
|
+ formData.data.costCurrency = currencyData.value[0].dictKey;
|
|
|
}
|
|
|
- fileList.value = [];
|
|
|
- fileListCopy.value = [];
|
|
|
};
|
|
|
|
|
|
const openExcel = () => {
|
|
|
openExcelDialog.value = true;
|
|
|
};
|
|
|
|
|
|
-const needAtt = [
|
|
|
- "productClassifyId",
|
|
|
- "name",
|
|
|
- "spec",
|
|
|
- "remark",
|
|
|
- "fileList",
|
|
|
- "id",
|
|
|
- "unit",
|
|
|
- "definition",
|
|
|
-];
|
|
|
const submitForm = () => {
|
|
|
- byform.value.handleSubmit((valid) => {
|
|
|
- // if (!fileListCopy.value.length > 0) {
|
|
|
- // return ElMessage({
|
|
|
- // message: "请上传产品图片",
|
|
|
- // type: "info",
|
|
|
- // });
|
|
|
- // }
|
|
|
- let jsonObj = {};
|
|
|
- formData.data.fileList = fileListCopy.value.map((x) => ({
|
|
|
- id: x.id,
|
|
|
- fileName: x.fileName,
|
|
|
- }));
|
|
|
- for (const key in formData.data) {
|
|
|
- if (needAtt.includes(key)) {
|
|
|
- } else {
|
|
|
- jsonObj[key] = formData.data[key];
|
|
|
- delete formData.data[key];
|
|
|
- }
|
|
|
+ formDom.value.handleSubmit((valid) => {
|
|
|
+ if (!formData.data.fileList.length > 0) {
|
|
|
+ return proxy.msgTip("请上传图片", 2);
|
|
|
}
|
|
|
- jsonObj.innerPackMethod = jsonObj.innerPackMethod.join(",");
|
|
|
- jsonObj.outerPackMethod = jsonObj.outerPackMethod.join(",");
|
|
|
- jsonObj.type = "1"; //1为公司产品库
|
|
|
- formData.data.ehsdJson = JSON.stringify(jsonObj);
|
|
|
+ // formData.data.fileList = formData.data.fileList.map((x) => ({
|
|
|
+ // id: x.id,
|
|
|
+ // fileName: x.fileName,
|
|
|
+ // fileUrl: x.fileUrl,
|
|
|
+ // }));
|
|
|
submitLoading.value = true;
|
|
|
proxy.post(`/productInfo/${modalType.value}ByEhsd`, formData.data).then(
|
|
|
(res) => {
|
|
|
- ElMessage({
|
|
|
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
+ proxy.msgTip("操作成功", 1);
|
|
|
dialogVisible.value = false;
|
|
|
submitLoading.value = false;
|
|
|
getList();
|
|
|
},
|
|
|
(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;
|
|
|
}
|
|
|
);
|
|
@@ -609,50 +561,25 @@ const getTreeList = () => {
|
|
|
const getDtl = (row) => {
|
|
|
modalType.value = "edit";
|
|
|
proxy.post("/productInfo/detailByEhsd", { id: row.id }).then((res) => {
|
|
|
- res.definition = "1"; //产品
|
|
|
- let jsonObj = JSON.parse(res.ehsdJson);
|
|
|
- res = {
|
|
|
- ...res,
|
|
|
- currency: jsonObj.currency
|
|
|
- ? jsonObj.currency
|
|
|
- : accountCurrency.value[0].value,
|
|
|
- costCurrency: jsonObj.costCurrency
|
|
|
- ? jsonObj.costCurrency
|
|
|
- : accountCurrency.value[0].value,
|
|
|
- ...jsonObj,
|
|
|
- };
|
|
|
- if (res.innerPackMethod) {
|
|
|
- res.innerPackMethod = res.innerPackMethod.split(",");
|
|
|
- } else {
|
|
|
- res.innerPackMethod = [];
|
|
|
- }
|
|
|
- if (res.outerPackMethod) {
|
|
|
- res.outerPackMethod = res.outerPackMethod.split(",");
|
|
|
- } else {
|
|
|
- res.outerPackMethod = [];
|
|
|
- }
|
|
|
+ res.definition = "1";
|
|
|
formData.data = res;
|
|
|
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) => ({
|
|
|
+ formData.data.fileList = fileObj[row.id].map((x) => ({
|
|
|
...x,
|
|
|
url: x.fileUrl,
|
|
|
+ name: x.fileName,
|
|
|
}));
|
|
|
} else {
|
|
|
- fileList.value = [];
|
|
|
- fileListCopy.value = [];
|
|
|
+ formData.data.fileList = [];
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
-const isdisabled = ["price", "costPrice", "remark", "netWeight"];
|
|
|
+
|
|
|
// watch(modalType, (val) => {
|
|
|
// if (val) {
|
|
|
// for (let i = 0; i < formConfig.value.length; i++) {
|
|
@@ -665,23 +592,7 @@ const isdisabled = ["price", "costPrice", "remark", "netWeight"];
|
|
|
// }
|
|
|
// }
|
|
|
// });
|
|
|
-const handleBeforeUpload = async (file) => {
|
|
|
- const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
- uploadData.value = res.uploadBody;
|
|
|
- fileListCopy.value.push({
|
|
|
- id: res.id,
|
|
|
- fileName: res.fileName,
|
|
|
- path: res.fileUrl,
|
|
|
- url: res.fileUrl,
|
|
|
- uid: file.uid,
|
|
|
- });
|
|
|
-};
|
|
|
-const handleRemove = (file) => {
|
|
|
- const index = fileListCopy.value.findIndex(
|
|
|
- (x) => x.uid === file.uid || x.id === file.id
|
|
|
- );
|
|
|
- fileListCopy.value.splice(index, 1);
|
|
|
-};
|
|
|
+
|
|
|
const handleClickFile = (file) => {
|
|
|
window.open(file.fileUrl, "_blank");
|
|
|
};
|
|
@@ -712,34 +623,7 @@ const handleSuccess = (res) => {
|
|
|
getList();
|
|
|
}
|
|
|
};
|
|
|
-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.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- });
|
|
|
-};
|
|
|
-getDict();
|
|
|
+
|
|
|
getTreeList();
|
|
|
getList();
|
|
|
const clickSelect = (item) => {
|
|
@@ -766,16 +650,19 @@ const handlePreview = (file) => {
|
|
|
window.open(file.fileUrl, "_black");
|
|
|
}
|
|
|
};
|
|
|
-const productContractDialog = ref(false);
|
|
|
-const currentProductId = ref("");
|
|
|
-const handleOpenProductContract = (row) => {
|
|
|
- currentProductId.value = row.id;
|
|
|
- productContractDialog.value = true;
|
|
|
+
|
|
|
+const handleClickUpload = () => {
|
|
|
+ let a = document.createElement("a");
|
|
|
+ a.href = "printer://" + "ftp://192.168.1.13/123/";
|
|
|
+ a.style.display = "none";
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.user {
|
|
|
+.box {
|
|
|
padding: 20px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|