|
@@ -22,14 +22,6 @@
|
|
|
]"
|
|
|
@get-list="getList"
|
|
|
>
|
|
|
- <template #fileSlot="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickFile(item)"
|
|
|
- >
|
|
|
- {{ item.fileName }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
<el-dialog
|
|
@@ -45,80 +37,6 @@
|
|
|
:rules="rules"
|
|
|
ref="byform"
|
|
|
>
|
|
|
- <template #address>
|
|
|
- <el-row :gutter="10" style="width: 100%">
|
|
|
- <el-col :span="8">
|
|
|
- <el-select v-model="formData.data.aa" placeholder="国家">
|
|
|
- <el-option v-for="item in 3" label="ceshi" value="1">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-select v-model="formData.data.aa" placeholder="省/洲">
|
|
|
- <el-option v-for="item in 3" label="ceshi" value="1">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-select v-model="formData.data.aa" placeholder="城市">
|
|
|
- <el-option v-for="item in 3" label="ceshi" value="1">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row style="margin-top: 20px; width: 100%">
|
|
|
- <el-col :span="24">
|
|
|
- <el-input v-model="formData.data.bb" type="textarea"> </el-input>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template #contact>
|
|
|
- <el-row :gutter="10" style="width: 100%">
|
|
|
- <el-col :span="8">
|
|
|
- <el-input v-model="formData.data.aa" placeholder="联系人">
|
|
|
- </el-input>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-input v-model="formData.data.aa" placeholder="联系电话">
|
|
|
- </el-input>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template #fileSlot>
|
|
|
- <div>
|
|
|
- <el-upload
|
|
|
- v-model:fileList="fileList"
|
|
|
- class="upload-demo"
|
|
|
- action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
- :limit="3"
|
|
|
- :data="uploadData"
|
|
|
- :on-preview="handlePreview"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :on-success="handleSuccess"
|
|
|
- :before-upload="handleBeforeUpload"
|
|
|
- accept=".pdf"
|
|
|
- >
|
|
|
- <el-button type="primary">选择</el-button>
|
|
|
- <template #file>
|
|
|
- <div>
|
|
|
- <div style="margin-top: 15px">
|
|
|
- <el-tag
|
|
|
- class="ml-2"
|
|
|
- type="info"
|
|
|
- v-for="(item, index) in fileList"
|
|
|
- :key="index"
|
|
|
- closable
|
|
|
- @close="handleClose(index)"
|
|
|
- >{{ item.fileName }}</el-tag
|
|
|
- >
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
@@ -136,17 +54,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-/* eslint-disable vue/no-unused-components */
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
-import FileUpload from "@/components/FileUpload/index";
|
|
|
-import { computed, defineComponent, ref } from "vue";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
-
|
|
|
-const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
|
|
|
-const headers = ref({ Authorization: "Bearer " + getToken() });
|
|
|
-const uploadData = ref({});
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const sourceList = ref({
|
|
@@ -158,9 +68,8 @@ const sourceList = ref({
|
|
|
status: "15,30",
|
|
|
},
|
|
|
});
|
|
|
-let dialogVisible = ref(false);
|
|
|
-let modalType = ref("add");
|
|
|
-let fileList = ref([]);
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const modalType = ref("add");
|
|
|
let rules = ref({
|
|
|
name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
|
|
|
});
|
|
@@ -285,7 +194,6 @@ const config = computed(() => {
|
|
|
width: "80",
|
|
|
align: "right",
|
|
|
},
|
|
|
- // 渲染 el-button,一般用在最后一列。
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
{
|
|
@@ -306,7 +214,7 @@ const config = computed(() => {
|
|
|
];
|
|
|
});
|
|
|
|
|
|
-let formData = reactive({
|
|
|
+const formData = reactive({
|
|
|
data: {
|
|
|
type: "1",
|
|
|
},
|
|
@@ -319,48 +227,7 @@ const formOption = reactive({
|
|
|
});
|
|
|
const byform = ref(null);
|
|
|
const formConfig = computed(() => {
|
|
|
- return [
|
|
|
- {
|
|
|
- type: "radio",
|
|
|
- prop: "name",
|
|
|
- label: "供应商类型",
|
|
|
- required: true,
|
|
|
- border: true,
|
|
|
- data: [
|
|
|
- { label: "贸易商", value: "1" },
|
|
|
- { label: "工厂", value: "2" },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "name",
|
|
|
- label: "供应商名称",
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "slot",
|
|
|
- slotName: "address",
|
|
|
- label: "地址",
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "slot",
|
|
|
- slotName: "contact",
|
|
|
- label: "联系信息",
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "slot",
|
|
|
- slotName: "fileSlot",
|
|
|
- label: "上传附件",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- label: "备注",
|
|
|
- prop: "remakes",
|
|
|
- itemType: "textarea",
|
|
|
- },
|
|
|
- ];
|
|
|
+ return [];
|
|
|
});
|
|
|
|
|
|
const getList = async (req) => {
|
|
@@ -369,7 +236,6 @@ const getList = async (req) => {
|
|
|
proxy
|
|
|
.post("/subscribeDetail/pageByWdly", sourceList.value.pagination)
|
|
|
.then((message) => {
|
|
|
- console.log(message);
|
|
|
message.rows.forEach((x) => {
|
|
|
if (x.status <= 30) {
|
|
|
x.isCheck = true;
|
|
@@ -387,89 +253,35 @@ const getList = async (req) => {
|
|
|
}, 200);
|
|
|
});
|
|
|
};
|
|
|
-// const openModal = () => {
|
|
|
-// proxy.$router.push({
|
|
|
-
|
|
|
-// })
|
|
|
-// };
|
|
|
|
|
|
const submitForm = () => {
|
|
|
- if (fileList.value.length > 0) {
|
|
|
- byform.value.handleSubmit((valid) => {
|
|
|
- formData.data.fileList = fileList.value;
|
|
|
- submitLoading.value = true;
|
|
|
- proxy.post("/productionProcesses/" + modalType.value, formData.data).then(
|
|
|
- (res) => {
|
|
|
- ElMessage({
|
|
|
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- fileList.value = [];
|
|
|
- dialogVisible.value = false;
|
|
|
- submitLoading.value = false;
|
|
|
- getList();
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- console.log(err, "aswwwww");
|
|
|
- submitLoading.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
- });
|
|
|
- } else {
|
|
|
- return ElMessage({
|
|
|
- message: "请上传附件!",
|
|
|
- type: "info",
|
|
|
- });
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-const getDtl = (row) => {
|
|
|
- modalType.value = "edit";
|
|
|
- proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
|
|
|
- fileList.value = [
|
|
|
- {
|
|
|
- id: "",
|
|
|
- fileName: res.fileName,
|
|
|
- path: "",
|
|
|
+ byform.value.handleSubmit((valid) => {
|
|
|
+ formData.data.fileList = fileList.value;
|
|
|
+ submitLoading.value = true;
|
|
|
+ proxy.post("/productionProcesses/" + modalType.value, formData.data).then(
|
|
|
+ (res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ fileList.value = [];
|
|
|
+ dialogVisible.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
},
|
|
|
- ];
|
|
|
- formData.data = res;
|
|
|
- dialogVisible.value = true;
|
|
|
+ (err) => {
|
|
|
+ console.log(err, "aswwwww");
|
|
|
+ submitLoading.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const handleBeforeUpload = async (file) => {
|
|
|
- const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
- uploadData.value = res.uploadBody;
|
|
|
- fileList.value = [
|
|
|
- {
|
|
|
- id: res.id,
|
|
|
- fileName: res.fileName,
|
|
|
- path: res.fileUrl,
|
|
|
- },
|
|
|
- ];
|
|
|
-};
|
|
|
-
|
|
|
-const handlePreview = (file) => {
|
|
|
- console.log(file);
|
|
|
-};
|
|
|
-const handleSuccess = (file) => {
|
|
|
- console.log(file);
|
|
|
-};
|
|
|
-const handleRemove = (file) => {
|
|
|
- fileList.value = [];
|
|
|
-};
|
|
|
-const handleClose = (index) => {
|
|
|
- fileList.value.splice(index, 1);
|
|
|
-};
|
|
|
-getList();
|
|
|
const selectData = ref([]);
|
|
|
const selectDataOne = ref([]);
|
|
|
-
|
|
|
const selectRow = (data) => {
|
|
|
selectData.value = data;
|
|
|
};
|
|
|
-
|
|
|
watch(selectData, (newVal, oldVal) => {
|
|
|
if (newVal.length == 0) {
|
|
|
sourceList.value.data.forEach((x) => {
|
|
@@ -511,8 +323,11 @@ const start = (type) => {
|
|
|
};
|
|
|
|
|
|
const warehouseList = ref([]);
|
|
|
-const warehouseListData = () => {
|
|
|
- // // 币种数据
|
|
|
+const productUnit = ref([]);
|
|
|
+const getDict = () => {
|
|
|
+ proxy.getDict(["unit"]).then((res) => {
|
|
|
+ productUnit.value = res["unit"];
|
|
|
+ });
|
|
|
proxy
|
|
|
.post("/warehouse/page", {
|
|
|
pageNum: 1,
|
|
@@ -526,16 +341,8 @@ const warehouseListData = () => {
|
|
|
}));
|
|
|
});
|
|
|
};
|
|
|
-warehouseListData();
|
|
|
-
|
|
|
-const productUnit = ref([]);
|
|
|
-const getDict = () => {
|
|
|
- proxy.getDict(["unit"]).then((res) => {
|
|
|
- productUnit.value = res["unit"];
|
|
|
- console.log(productUnit.value, "qwda");
|
|
|
- });
|
|
|
-};
|
|
|
getDict();
|
|
|
+getList();
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|