Kaynağa Gözat

多公司 字典问题

lxf 1 yıl önce
ebeveyn
işleme
83056f8476
1 değiştirilmiş dosya ile 100 ekleme ve 116 silme
  1. 100 116
      src/views/publicModule/companyConfig/index.vue

+ 100 - 116
src/views/publicModule/companyConfig/index.vue

@@ -32,8 +32,9 @@
                 <el-input v-model="formData.data.stopDate" placeholder="请输入" />
               </el-col>
             </el-row>
-          </div> </template
-        ><template #allAddress>
+          </div>
+        </template>
+        <template #allAddress>
           <el-row style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="countryId">
@@ -185,7 +186,6 @@
 import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
-import useUserStore from "@/store/modules/user";
 import { computed, ref } from "vue";
 import selectCity from "@/components/selectCity/index.vue";
 
@@ -207,6 +207,8 @@ let rules = ref({
   countryEnStr: [{ required: true, message: "请输入国家 (英文)", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
+const contactInformationType = ref([]);
+const enterpriseType = ref([]);
 const selectConfig = [];
 const config = computed(() => {
   return [
@@ -228,7 +230,7 @@ const config = computed(() => {
         prop: "type",
       },
       render(type) {
-        return proxy.dictDataEcho(type, enterpriseType.value);
+        return proxy.dictValueLabel(type, enterpriseType.value);
       },
     },
     {
@@ -262,7 +264,7 @@ const config = computed(() => {
         prop: "taxpayerQualification",
       },
       render(type) {
-        return proxy.dictDataEcho(type, contactInformationType.value);
+        return proxy.dictValueLabel(type, contactInformationType.value);
       },
     },
     {
@@ -338,116 +340,100 @@ const formOption = reactive({
   rules: [],
 });
 const byform = ref(null);
-const formConfig = reactive([
-  {
-    type: "input",
-    prop: "name",
-    label: "公司名称",
-    required: true,
-  },
-  {
-    type: "input",
-    prop: "nameEn",
-    label: "英文名",
-  },
-  {
-    type: "select",
-    prop: "type",
-    label: "企业类型",
-  },
-  {
-    type: "input",
-    prop: "uscCode",
-    label: "统一社会信用代码",
-  },
-  {
-    type: "input",
-    prop: "legalPersonName",
-    label: "法定代表人",
-  },
-  {
-    type: "input",
-    prop: "registeredCapital",
-    label: "注册资本",
-  },
-  {
-    type: "slot",
-    slotName: "timeGanger",
-    prop: "startDate",
-    label: "营业期限",
-  },
-  {
-    type: "slot",
-    slotName: "allAddress",
-    label: "公司地址",
-  },
-  {
-    type: "slot",
-    slotName: "allAddressEnglish",
-    label: "公司地址 (英文)",
-  },
-  {
-    type: "input",
-    prop: "corporationNumber",
-    label: "公司电话",
-    itemType: "text",
-    placeholder: "请输入公司电话",
-  },
-  {
-    type: "select",
-    prop: "taxpayerQualification",
-    label: "纳税人资质",
-    data: [],
-  },
-  {
-    type: "input",
-    prop: "iaeeCode",
-    label: "进出口企业代码",
-    required: true,
-  },
-  {
-    type: "input",
-    prop: "crCode",
-    label: "海关注册代码",
-    required: true,
-  },
-  {
-    type: "slot",
-    prop: "file",
-    slotName: "file",
-    label: "签章",
-  },
-]);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "name",
+      label: "公司名称",
+      required: true,
+    },
+    {
+      type: "input",
+      prop: "nameEn",
+      label: "英文名",
+    },
+    {
+      type: "select",
+      prop: "type",
+      label: "企业类型",
+      data: enterpriseType.value,
+    },
+    {
+      type: "input",
+      prop: "uscCode",
+      label: "统一社会信用代码",
+    },
+    {
+      type: "input",
+      prop: "legalPersonName",
+      label: "法定代表人",
+    },
+    {
+      type: "input",
+      prop: "registeredCapital",
+      label: "注册资本",
+    },
+    {
+      type: "slot",
+      slotName: "timeGanger",
+      prop: "startDate",
+      label: "营业期限",
+    },
+    {
+      type: "slot",
+      slotName: "allAddress",
+      label: "公司地址",
+    },
+    {
+      type: "slot",
+      slotName: "allAddressEnglish",
+      label: "公司地址 (英文)",
+    },
+    {
+      type: "input",
+      prop: "corporationNumber",
+      label: "公司电话",
+      itemType: "text",
+      placeholder: "请输入公司电话",
+    },
+    {
+      type: "select",
+      prop: "taxpayerQualification",
+      label: "纳税人资质",
+      data: contactInformationType.value,
+    },
+    {
+      type: "input",
+      prop: "iaeeCode",
+      label: "进出口企业代码",
+      required: true,
+    },
+    {
+      type: "input",
+      prop: "crCode",
+      label: "海关注册代码",
+      required: true,
+    },
+    {
+      type: "slot",
+      prop: "file",
+      slotName: "file",
+      label: "签章",
+    },
+  ];
+});
 const getDict = () => {
-  const tenantId = useUserStore().user.tenantId;
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      tenantId: tenantId,
-      dictCode: "enterprise_type",
-    })
-    .then((res) => {
-      formConfig[2].data = res.rows.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      enterpriseType.value = res.rows;
-    });
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      tenantId: tenantId,
-      dictCode: "taxpayer_qualification",
-    })
-    .then((res) => {
-      formConfig[7].data = res.rows.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      contactInformationType.value = res.rows;
-    });
+  proxy.getDictOne(["enterprise_type", "taxpayer_qualification"]).then((res) => {
+    enterpriseType.value = res["enterprise_type"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    contactInformationType.value = res["taxpayer_qualification"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -547,8 +533,6 @@ const getDtl = (row) => {
     dialogVisible.value = true;
   });
 };
-const enterpriseType = ref([]);
-const contactInformationType = ref([]);
 const uploadDataOne = ref({});
 const uploadFileOne = async (file) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });