Pārlūkot izejas kodu

合同模板,多公司配置整改

lxf 2 gadi atpakaļ
vecāks
revīzija
86070ac0bc

+ 166 - 65
src/views/publicModule/companyConfig/index.vue

@@ -1,28 +1,24 @@
 <template>
   <div class="tenant">
-    <!-- <Banner /> -->
-    <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="[
-          {
-            text: '添加公司',
-            action: () => openModal('add'),
-          },
-        ]"
-        @get-list="getList">
-        <template #timeSlot="{ item }"> {{ item.startDate }} - {{ item.stopDate }} </template>
-      </byTable>
-    </div>
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      highlight-current-row
+      :selectConfig="selectConfig"
+      :table-events="{
+        select: select,
+      }"
+      :action-list="[
+        {
+          text: '添加公司',
+          action: () => openModal('add'),
+        },
+      ]"
+      @get-list="getList">
+      <template #timeSlot="{ item }"> {{ item.startDate }} - {{ item.stopDate }} </template>
+    </byTable>
     <el-dialog :title="modalType == 'add' ? '添加公司' : '编辑公司'" v-model="dialogVisible" width="600" v-loading="loading">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
         <template #timeGanger>
@@ -36,7 +32,67 @@
                 <el-input v-model="formData.data.stopDate" placeholder="请输入" />
               </el-col>
             </el-row>
-          </div>
+          </div> </template
+        ><template #allAddress>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-form-item prop="countryId">
+                <el-select v-model="formData.data.countryId" placeholder="国家" filterable allow-create @change="(val) => getCityData(val, '20', true)">
+                  <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="provinceName">
+                <selectCity
+                  placeholder="省/洲"
+                  @change="(val) => getCityData(val, '30', true)"
+                  addressId="provinceId"
+                  addressName="provinceName"
+                  v-model="formData.data"
+                  :data="provinceData">
+                </selectCity>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="cityName">
+                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row style="margin-top: 20px; width: 100%">
+            <el-col :span="24">
+              <el-form-item prop="address">
+                <el-input v-model="formData.data.address" type="textarea"> </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </template>
+        <template #allAddressEnglish>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-form-item prop="countryEnStr">
+                <el-input v-model="formData.data.countryEnStr" placeholder="请输入国家 (英文)" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="provinceEnStr">
+                <el-input v-model="formData.data.provinceEnStr" placeholder="请输入省/洲 (英文)" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="cityEnStr">
+                <el-input v-model="formData.data.cityEnStr" placeholder="请输入城市 (英文)" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row style="margin-top: 20px; width: 100%">
+            <el-col :span="24">
+              <el-form-item prop="addressEn">
+                <el-input v-model="formData.data.addressEn" type="textarea"> </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
         </template>
         <template #file>
           <div style="width: 100%">
@@ -130,23 +186,25 @@ 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, defineComponent, ref } from "vue";
+import { computed, ref } from "vue";
+import selectCity from "@/components/selectCity/index.vue";
 
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({
   data: [],
   pagination: {
-    total: 3,
+    total: 0,
     pageNum: 1,
     pageSize: 10,
   },
 });
 let dialogVisible = ref(false);
-let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
   name: [{ required: true, message: "请输入公司名称", trigger: "blur" }],
+  countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
+  countryEnStr: [{ required: true, message: "请输入国家 (英文)", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = [];
@@ -219,7 +277,6 @@ const config = computed(() => {
         width: "200",
         align: "right",
       },
-      // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
           {
@@ -241,13 +298,11 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              // 弹窗提示是否删除
               ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
                 type: "warning",
               }).then(() => {
-                // 删除
                 proxy
                   .post("/corporation/delete", {
                     id: row.id,
@@ -322,6 +377,23 @@ const formConfig = reactive([
     label: "营业期限",
   },
   {
+    type: "slot",
+    slotName: "allAddress",
+    label: "公司地址",
+  },
+  {
+    type: "slot",
+    slotName: "allAddressEnglish",
+    label: "公司地址 (英文)",
+  },
+  {
+    type: "input",
+    prop: "corporationNumber",
+    label: "公司电话",
+    itemType: "text",
+    placeholder: "请输入公司电话",
+  },
+  {
     type: "select",
     prop: "taxpayerQualification",
     label: "纳税人资质",
@@ -346,6 +418,37 @@ const formConfig = reactive([
     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;
+    });
+};
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -357,15 +460,44 @@ const getList = async (req) => {
     }, 200);
   });
 };
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+const getCityData = (id, type, isChange) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (isChange) {
+        formData.data.provinceId = "";
+        formData.data.provinceName = "";
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (isChange) {
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+getCityData("0");
+getDict();
+getList();
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
   formData.data = {
+    countryId: "44",
     enterpriseLogoList: [],
     larSignList: [],
     officialSealList: [],
     contractSealList: [],
   };
+  getCityData(formData.data.countryId, "20");
 };
 const selection = ref({
   data: [],
@@ -386,17 +518,18 @@ const submitForm = () => {
         submitLoading.value = false;
         getList();
       },
-      (err) => (submitLoading.value = false)
+      () => (submitLoading.value = false)
     );
   });
 };
 const getDtl = (row) => {
-  dialogVisible.value = true;
   modalType.value = "edit";
   proxy.post("/corporation/detail", { id: row.id }).then((res) => {
     res.type = res.type + "";
     res.taxpayerQualification = res.taxpayerQualification + "";
     formData.data = res;
+    getCityData(formData.data.countryId, "20");
+    getCityData(formData.data.provinceId, "30");
     proxy.post("/fileInfo/getList", { businessIdList: [res.id], fileType: 1 }).then((resFile) => {
       formData.data.enterpriseLogoList = resFile[res.id];
     });
@@ -409,43 +542,11 @@ const getDtl = (row) => {
     proxy.post("/fileInfo/getList", { businessIdList: [res.id], fileType: 4 }).then((resFile) => {
       formData.data.contractSealList = resFile[res.id];
     });
+    dialogVisible.value = true;
   });
 };
 const enterpriseType = ref([]);
 const contactInformationType = ref([]);
-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;
-    });
-};
-getList();
-getDict();
 const uploadDataOne = ref({});
 const uploadFileOne = async (file) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });

+ 0 - 111
src/views/publicModule/contractTemplate/index.vue

@@ -20,67 +20,6 @@
 
     <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="800" v-loading="loadingOperation">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
-        <template #allAddress>
-          <el-row style="width: 100%">
-            <el-col :span="8">
-              <el-form-item prop="countryId">
-                <el-select v-model="formData.data.countryId" placeholder="国家" filterable allow-create @change="(val) => getCityData(val, '20', true)">
-                  <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item prop="provinceName">
-                <selectCity
-                  placeholder="省/洲"
-                  @change="(val) => getCityData(val, '30', true)"
-                  addressId="provinceId"
-                  addressName="provinceName"
-                  v-model="formData.data"
-                  :data="provinceData">
-                </selectCity>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item prop="cityName">
-                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="24">
-              <el-form-item prop="address">
-                <el-input v-model="formData.data.address" type="textarea"> </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </template>
-        <template #allAddressEnglish>
-          <el-row style="width: 100%">
-            <el-col :span="8">
-              <el-form-item prop="countryEnStr">
-                <el-input v-model="formData.data.countryEnStr" placeholder="请输入国家 (英文)" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item prop="provinceEnStr">
-                <el-input v-model="formData.data.provinceEnStr" placeholder="请输入省/洲 (英文)" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item prop="cityEnStr">
-                <el-input v-model="formData.data.cityEnStr" placeholder="请输入城市 (英文)" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="24">
-              <el-form-item prop="addressEn">
-                <el-input v-model="formData.data.addressEn" type="textarea"> </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </template>
         <template #templateContent>
           <div style="width: 100%">
             <Editor :value="formData.data.templateContent" @updateValue="updateContent" />
@@ -101,7 +40,6 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, ref } from "vue";
 import Editor from "@/components/Editor/index.vue";
-import selectCity from "@/components/selectCity/index.vue";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -278,23 +216,6 @@ const formConfig = computed(() => {
       itemWidth: 70,
     },
     {
-      type: "input",
-      prop: "corporationNumber",
-      label: "公司电话",
-      itemType: "text",
-      placeholder: "请输入公司电话",
-    },
-    {
-      type: "slot",
-      slotName: "allAddress",
-      label: "公司地址",
-    },
-    {
-      type: "slot",
-      slotName: "allAddressEnglish",
-      label: "公司地址 (英文)",
-    },
-    {
       type: "slot",
       slotName: "templateContent",
       label: "合同模板",
@@ -304,42 +225,12 @@ const formConfig = computed(() => {
 let rules = ref({
   templateName: [{ required: true, message: "请输入模板名称", trigger: "blur" }],
   corporationId: [{ required: true, message: "请选择公司", trigger: "change" }],
-  countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
-  countryEnStr: [{ required: true, message: "请输入国家 (英文)", trigger: "blur" }],
-  provinceEnStr: [{ required: true, message: "请输入省/洲 (英文)", trigger: "blur" }],
 });
-const countryData = ref([]);
-const provinceData = ref([]);
-const cityData = ref([]);
-const getCityData = (id, type, isChange) => {
-  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
-    if (type === "20") {
-      provinceData.value = res;
-      if (isChange) {
-        formData.data.provinceId = "";
-        formData.data.provinceName = "";
-        formData.data.cityId = "";
-        formData.data.cityName = "";
-      }
-    } else if (type === "30") {
-      cityData.value = res;
-      if (isChange) {
-        formData.data.cityId = "";
-        formData.data.cityName = "";
-      }
-    } else {
-      countryData.value = res;
-    }
-  });
-};
-getCityData("0");
 const openModal = () => {
   modalType.value = "add";
   formData.data = {
     templateContent: "",
-    countryId: "44",
   };
-  getCityData(formData.data.countryId, "20");
   loadingOperation.value = false;
   dialogVisible.value = true;
 };
@@ -367,8 +258,6 @@ const update = (row) => {
   loadingOperation.value = true;
   proxy.post("/contractTemplate/detail", { id: row.id }).then((res) => {
     formData.data = res;
-    getCityData(formData.data.countryId, "20");
-    getCityData(formData.data.provinceId, "30");
     loadingOperation.value = false;
     dialogVisible.value = true;
   });