فهرست منبع

新增登录条件判断/根据需求修改单位信息采集页面

fanghuisheng 2 سال پیش
والد
کامیت
0e1371f096
4فایلهای تغییر یافته به همراه320 افزوده شده و 102 حذف شده
  1. 1 0
      package.json
  2. 313 97
      src/pages/business/mhxf/unitInfoCollection/index.vue
  3. 6 5
      src/pages/login.vue
  4. BIN
      src/static/images/unitInfoCollection/icon1.png

+ 1 - 0
package.json

@@ -5,6 +5,7 @@
         "dev:app": "uni -p app",
         "dev:custom": "uni -p",
         "dev:h5": "uni",
+        "dev:h5:prod": "uni --mode production",
         "dev:h5:ssr": "uni --ssr",
         "dev:mp-alipay": "uni -p mp-alipay",
         "dev:mp-baidu": "uni -p mp-baidu",

+ 313 - 97
src/pages/business/mhxf/unitInfoCollection/index.vue

@@ -17,19 +17,22 @@
                 </template>
               </u-input>
             </u-form-item>
-            <u-form-item label="组织机构代码" prop="organization" required :borderBottom="true">
-              <u-input v-model="form.organization" placeholder="请输入组织机构代码" border="none" maxlength="18" />
+            <u-form-item label="统一社会信用代码" prop="organization" required :borderBottom="true">
+              <u-input v-model="form.organization" placeholder="请输入统一社会信用代码" border="none" maxlength="18" />
             </u-form-item>
             <u-form-item label="法人代表" prop="delegateName" required :borderBottom="true">
               <u-input v-model="form.delegateName" placeholder="请输入法人代表" border="none" />
             </u-form-item>
+            <u-form-item label="所属街镇" prop="streetTown" required :borderBottom="true" @click="handleAction('所属街镇')">
+              <u-input v-model="form.streetTown" placeholder="请选择所属街镇" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" />
+            </u-form-item>
             <u-form-item label="单位地址" prop="address" required :borderBottom="true">
               <u-input v-model="form.address" placeholder="请输入单位地址" border="none" />
             </u-form-item>
             <u-form-item label="消防管理人电话" prop="fireManagePhone" required :borderBottom="true">
               <u-input v-model="form.fireManagePhone" placeholder="请输入消防管理人电话" border="none" maxlength="11" />
             </u-form-item>
-            <u-form-item label="成立时间" prop="foundTime" required :borderBottom="true" @click="handleDateTime('成立时间')">
+            <u-form-item label="成立时间" prop="foundTime" required :borderBottom="true" @click="handleDateTime('成立时间', 0, form.foundTime)">
               <u-input v-model="form.foundTime" placeholder="请选择成立时间" border="none" suffixIcon="calendar" suffixIconStyle="color: #909399;font-size:22px" />
             </u-form-item>
             <u-form-item label="消防安全责任人" prop="fireDutyName" :borderBottom="true">
@@ -44,11 +47,11 @@
             <u-form-item label="固定资产(万元)" prop="fixedAssets" :borderBottom="true">
               <u-input type="number" v-model="form.fixedAssets" placeholder="请输入固定资产(万元)" suffixIcon="万元" suffixIconStyle="color:#999999;font-size:15px" border="none" />
             </u-form-item>
-            <u-form-item label="占地面积" prop="coverArea" :borderBottom="true">
-              <u-input type="number" v-model="form.coverArea" placeholder="请输入占地面积" suffixIcon="平方米" suffixIconStyle="color:#999999;font-size:15px" border="none" />
+            <u-form-item label="单位性质" prop="companyNature" :borderBottom="true" @click="handleAction('单位性质')">
+              <u-input v-model="form.companyNature" placeholder="请选择单位性质" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" />
             </u-form-item>
-            <u-form-item label="建筑面积" prop="buildArea" :borderBottom="true">
-              <u-input type="number" v-model="form.buildArea" placeholder="请输入建筑面积" suffixIcon="平方米" suffixIconStyle="color:#999999;font-size:15px" border="none" />
+            <u-form-item label="单位建筑面积" prop="buildArea" :borderBottom="true">
+              <u-input type="number" v-model="form.buildArea" placeholder="请输入单位建筑面积" suffixIcon="平方米" suffixIconStyle="color:#999999;font-size:15px" border="none" />
             </u-form-item>
           </u--form>
 
@@ -67,8 +70,10 @@
       <u--form :model="form.baseBuildList" ref="uForm1" :rules="rules" labelWidth="130">
         <view style="padding: 10px 0" v-for="(li, index) in form.baseBuildList" :key="index">
           <view class="" style="padding: 10px 10px 20px 10px; background: #ffffff">
-            <view style="overflow: hidden">
-              <u-icon name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit(index)"></u-icon>
+            <view style="display: flex; overflow: hidden">
+              <image style="width: 15px; height: 15px; margin: auto 10px auto 0" src="@/static/images/unitInfoCollection/icon1.png" />
+              <view style="margin: auto auto auto 0">建筑{{ index + 1 }}</view>
+              <u-icon v-if="form.baseBuildList.length > 1" name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit(index)"></u-icon>
             </view>
             <view style="padding-left: 9px">
               <u-form-item label="建筑名称" prop="li.buildName" required :borderBottom="true">
@@ -78,7 +83,7 @@
                 <u-input v-model="li.address" placeholder="请输入建筑地址" border="none" />
               </u-form-item>
               <u-form-item label="建筑结构" prop="li.buildStructure" required :borderBottom="true" @click="handleAction('建筑结构', index)">
-                <u-input v-model="li.buildStructure" placeholder="请选择建筑结构" border="none" suffixIcon="arrow-right" :suffixIconStyle="'color: #909399'" />
+                <u-input v-model="li.buildStructure" placeholder="请选择建筑结构" border="none" suffixIcon="arrow-right" suffixIconStyle="color: #909399" />
               </u-form-item>
               <u-form-item label="地上层数" prop="li.aboveFloor" required :borderBottom="true">
                 <u-input v-model="li.aboveFloor" placeholder="请输入地上层数" border="none" />
@@ -93,20 +98,20 @@
                 <u-input v-model="li.underSpace" placeholder="请输入地下空间面积" suffixIcon="平方米" suffixIconStyle="color:#999999;font-size:15px" border="none" />
               </u-form-item>
               <u-form-item label="使用性质" prop="li.useCharacter" required :borderBottom="true" @click="handleAction('使用性质', index)">
-                <u-input v-model="li.useCharacter" placeholder="请选择使用性质" border="none" suffixIcon="arrow-right" :suffixIconStyle="'color: #909399'" />
+                <u-input v-model="li.useCharacter" placeholder="请选择使用性质" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" />
               </u-form-item>
-              <u-form-item label="建成年份" prop="li.completeYear" required :borderBottom="true" @click="handleDateTime('建成年份', index)">
-                <u-input v-model="li.completeYear" placeholder="请选择建成年份" border="none" suffixIcon="calendar" suffixIconStyle="color: #909399;font-size:22px" />
+              <u-form-item label="建成年份" prop="li.completeYear" required :borderBottom="true" @click="handleDateTime('建成年份', index, li.completeYear)">
+                <u-input v-model="li.completeYear" placeholder="请选择建成年份" suffixIcon="calendar" suffixIconStyle="color: #909399;font-size:22px" border="none" />
               </u-form-item>
               <u-form-item label="建筑高度" prop="li.buildHigh" required :borderBottom="true">
-                <u-input v-model="li.buildHigh" placeholder="请输入建筑高度" border="none" suffixIcon="米" :suffixIconStyle="'color: #909399'"  />
+                <u-input v-model="li.buildHigh" placeholder="请输入建筑高度" suffixIcon="米" suffixIconStyle="color: #909399;font-size:15px" border="none" />
               </u-form-item>
             </view>
           </view>
         </view>
       </u--form>
 
-      <view style="padding-bottom: 125px">
+      <view style="padding-bottom: 70px">
         <u-button type="primary" style="width: 25%; height: 25px; margin-top: 10px" @click="addSubmit" shape="circle" icon="plus" size="mini"> 添加建筑 </u-button>
       </view>
 
@@ -119,7 +124,18 @@
       </view>
     </view>
 
-    <u-action-sheet :show="actionShow" :actions="actionsList" :title="'请选择' + actionTitle" @close="actionShow = false" @select="selectAction"> </u-action-sheet>
+    <u-picker
+      :show="actionShow"
+      :columns="actionsList"
+      :title="'请选择' + actionTitle"
+      keyName="name"
+      visibleItemCount="6"
+      :defaultIndex="[actionIndex]"
+      :closeOnClickOverlay="true"
+      @close="actionShow = false"
+      @cancel="actionShow = false"
+      @confirm="selectAction"
+    ></u-picker>
 
     <u-datetime-picker
       :show="showTime"
@@ -129,7 +145,8 @@
       @cancel="showTime = false"
       @confirm="timeSubmit"
       :closeOnClickOverlay="true"
-      :minDate="80"
+      :minDate="Number(new Date('1900'))"
+      :maxDate="Number(new Date())"
     ></u-datetime-picker>
 
     <u-modal
@@ -166,9 +183,11 @@ const newPublicStore = publicStore();
 
 const dataList = reactive({
   form: {
-    organization: "", //组织机构代码
+    organization: "", //信用代码
     companyName: "", //单位名称
     delegateName: "", //法人代表姓名
+    streetTown: "", //所属街镇
+    streetTownValue: 0, //所属街镇
     address: "", //详细地址
     fireManagePhone: "", //消防安全管理人电话
     foundTime: "", //单位成立时间
@@ -176,7 +195,8 @@ const dataList = reactive({
     fireManageName: "", //消防安全管理人姓名
     employeeNum: "", //职工人数
     fixedAssets: "", //固定资产(单位:万元)
-    coverArea: "", //占地面积
+    companyNature: "", //单位性质
+    companyNatureValue: 0, //单位性质
     buildArea: "", //建筑面积
 
     baseBuildList: [
@@ -200,14 +220,14 @@ const dataList = reactive({
     organization: [
       {
         required: true,
-        message: "请输入组织机构代码",
+        message: "请输入统一社会信用代码",
         trigger: ["blur", "change"],
       },
       {
         type: "string",
         min: 18,
         required: true,
-        message: "请输入18位组织机构代码",
+        message: "请输入18位统一社会信用代码",
         trigger: ["change"],
       },
     ],
@@ -234,7 +254,7 @@ const dataList = reactive({
   actionIndex: 0,
   actionTitle: "",
   actionShow: false,
-  actionsList: [],
+  actionsList: [[]],
   showTime: false,
   timeValue: Number(new Date()),
   timeTitle: "",
@@ -254,7 +274,7 @@ const newCompanyName = ref("");
  * @icon图标按钮点击事件
  */
 function companySubmit(e) {
-  actionsList.value = [];
+  actionsList.value = [[]];
 
   companyByNameSelect({
     companyName: e,
@@ -264,7 +284,7 @@ function companySubmit(e) {
         actionShow.value = true;
         res.data.forEach((el) => {
           el.name = el.companyName;
-          actionsList.value.push(el);
+          actionsList.value[0].push(el);
         });
         actionTitle.value = "单位名称";
       } else {
@@ -312,10 +332,10 @@ function handleSubmitApi(value) {
           organization: form.value.organization, //组织机构代码
           address: form.value.address, //单位地址
           foundTime: form.value.foundTime + "T00:00:00", //成立时间
+          companyNature: form.value.companyNature, //单位性质
         },
         baseCompanyAttach1: {
           employeeNum: form.value.employeeNum, //职工人数
-          coverArea: form.value.coverArea, //占地面积
           buildArea: form.value.buildArea, //建筑面积
           fixedAssets: form.value.fixedAssets, //固定资产
         },
@@ -363,10 +383,9 @@ function handleSubmitApi(value) {
           uni.showToast({
             title: "提交成功",
           });
-          setTimeout(()=>{
+          setTimeout(() => {
             proxy.$tab.reLaunch("/pages/index");
-          },2000)
-          
+          }, 2000);
         }
       });
     })
@@ -383,72 +402,230 @@ function handleAction(value, index) {
 
   if (value == "建筑结构") {
     actionsList.value = [
-      {
-        value: 1,
-        name: "砖混结构",
-      },
-      {
-        value: 2,
-        name: "钢筋混凝土",
-      },
-      {
-        value: 3,
-        name: "钢结构",
-      },
-      {
-        value: 4,
-        name: "大型钢筋混凝土",
-      },
-      {
-        value: 5,
-        name: "木质结构",
-      },
-      {
-        value: 6,
-        name: "砖木结构",
-      },
+      [
+        {
+          value: 2,
+          name: "钢筋混凝土",
+        },
+        {
+          value: 1,
+          name: "砖混结构",
+        },
+        {
+          value: 3,
+          name: "钢结构",
+        },
+        {
+          value: 4,
+          name: "大型钢筋混凝土",
+        },
+        {
+          value: 5,
+          name: "木质结构",
+        },
+        {
+          value: 6,
+          name: "砖木结构",
+        },
+      ],
     ];
     actionTitle.value = "建筑结构";
     actionIndex.value = index;
-  } else if (value == "使用性质") {
+  }
+
+  if (value == "使用性质") {
     actionsList.value = [
-      {
-        value: 1,
-        name: "工业",
-      },
-      {
-        value: 2,
-        name: "商业",
-      },
-      {
-        value: 3,
-        name: "办公",
-      },
-      {
-        value: 4,
-        name: "危险品",
-      },
-      {
-        value: 5,
-        name: "生产、存储、经营、居住一体",
-      },
+      [
+        {
+          value: 1,
+          name: "饭店、旅馆",
+        },
+        {
+          value: 2,
+          name: "公寓、住宅",
+        },
+        {
+          value: 3,
+          name: "体育场馆",
+        },
+        {
+          value: 4,
+          name: "俱乐部、夜总会、歌舞厅电影院、剧院、礼堂办公、商务科研 (包括实验室等)",
+        },
+        {
+          value: 5,
+          name: "医院",
+        },
+        {
+          value: 6,
+          name: "教学",
+        },
+        {
+          value: 7,
+          name: "商业 (包括商店、商场、集贸市场等)",
+        },
+        {
+          value: 8,
+          name: "金融",
+        },
+        {
+          value: 9,
+          name: "交通",
+        },
+
+        {
+          value: 10,
+          name: "文博馆(包括展览馆、博物馆、图书馆、档案馆、文化馆等)",
+        },
+        {
+          value: 11,
+          name: "通信枢纽、电视广播发射、中转",
+        },
+
+        {
+          value: 12,
+          name: "厂房",
+        },
+        {
+          value: 13,
+          name: "库房",
+        },
+        {
+          value: 14,
+          name: "油气罐站、管线",
+        },
+        {
+          value: 15,
+          name: "综台建筑",
+        },
+        {
+          value: 16,
+          name: "其他",
+        },
+      ],
     ];
     actionTitle.value = "使用性质";
     actionIndex.value = index;
   }
-}
 
-/**
- * @时间弹出框点击事件
- */
-function handleDateTime(value, index) {
-  showTime.value = true;
-  if (value == "成立时间") {
-    timeIndex.value = index;
-    timeTitle.value = "成立时间";
-  } else if (value == "建成年份") {
-    timeIndex.value = index;
-    timeTitle.value = "建成年份";
+  if (value == "单位性质") {
+    actionsList.value = [
+      [
+        {
+          value: 1,
+          name: "机关",
+        },
+        {
+          value: 2,
+          name: "团体",
+        },
+        {
+          value: 3,
+          name: "企业",
+        },
+        {
+          value: 4,
+          name: "事业",
+        },
+        {
+          value: 5,
+          name: "其他",
+        },
+      ],
+    ];
+    actionTitle.value = "单位性质";
+  }
+
+  if (value == "所属街镇") {
+    actionsList.value = [
+      [
+        {
+          name: "江川路街道",
+          value: 1201,
+          x: 121.399126538181,
+          y: 31.0099719391863,
+        },
+        {
+          name: "新虹街道",
+          value: 1217,
+          x: 121.319329296294,
+          y: 31.1983901916889,
+        },
+        {
+          name: "古美路街道",
+          value: 1206,
+          x: 121.388451866936,
+          y: 31.1478233480159,
+        },
+        {
+          name: "浦锦街道",
+          value: 1218,
+          x: 121.483929120352,
+          y: 31.089967318558,
+        },
+        {
+          name: "浦江镇",
+          value: 1215,
+          x: 121.524058543447,
+          y: 31.0540039472667,
+        },
+        {
+          name: "吴泾镇",
+          value: 1213,
+          x: 121.454076463728,
+          y: 31.04860402113,
+        },
+        {
+          name: "马桥镇",
+          value: 1214,
+          x: 121.352680027718,
+          y: 31.0213512298508,
+        },
+        {
+          name: "颛桥镇",
+          value: 1209,
+          x: 121.40607138504,
+          y: 31.0612972443508,
+        },
+        {
+          name: "莘庄镇",
+          value: 1207,
+          x: 121.37064864047,
+          y: 31.1154549548722,
+        },
+        {
+          name: "梅陇镇",
+          value: 1212,
+          x: 121.421346814491,
+          y: 31.1069718313722,
+        },
+        {
+          name: "七宝镇",
+          value: 1208,
+          x: 121.350366186317,
+          y: 31.1553292680362,
+        },
+        {
+          name: "虹桥镇",
+          value: 1211,
+          x: 121.37956256207,
+          y: 31.1806219953212,
+        },
+        {
+          name: "华漕镇",
+          value: 1210,
+          x: 121.277541517147,
+          y: 31.2289121171624,
+        },
+        {
+          name: "莘庄工业区",
+          value: 1216,
+          x: 121.376508452784,
+          y: 31.0678185611843,
+        },
+      ],
+    ];
+    actionTitle.value = "所属街镇";
   }
 }
 
@@ -459,16 +636,37 @@ function selectAction(e) {
   console.log(e);
 
   if (actionTitle.value == "建筑结构") {
-    form.value.baseBuildList[actionIndex.value].buildStructure = e.name;
-    form.value.baseBuildList[actionIndex.value].buildStructureValue = e.value;
-  } else if (actionTitle.value == "使用性质") {
-    form.value.baseBuildList[actionIndex.value].useCharacter = e.name;
-    form.value.baseBuildList[actionIndex.value].useCharacterValue = e.value;
-  } else if (actionTitle.value == "单位名称") {
-    newCompanyName.value = e.companyName;
-    form.value = e;
-    form.value.foundTime = e.foundTime.split("T")[0];
-    if (e.baseBuildList.length <= 0) {
+    form.value.baseBuildList[actionIndex.value].buildStructure = e.value[0].name;
+    form.value.baseBuildList[actionIndex.value].buildStructureValue = e.value[0].value;
+  }
+
+  if (actionTitle.value == "使用性质") {
+    form.value.baseBuildList[actionIndex.value].useCharacter = e.value[0].name;
+    form.value.baseBuildList[actionIndex.value].useCharacterValue = e.value[0].value;
+  }
+
+  if (actionTitle.value == "单位性质") {
+    form.value.companyNature = e.value[0].name;
+    form.value.companyNatureValue = e.value[0].value;
+  }
+
+  if (actionTitle.value == "所属街镇") {
+    form.value.streetTown = e.value[0].name;
+    form.value.streetTownValue = e.value[0].value;
+  }
+
+  if (actionTitle.value == "单位名称") {
+    newCompanyName.value = e.value[0].companyName;
+    // form.value = e.value[0];
+    form.value.companyName = e.value[0].companyName;
+    form.value.organization = e.value[0].organization;
+    form.value.delegateName = e.value[0].delegateName;
+    form.value.address = e.value[0].address;
+    form.value.foundTime = e.value[0].foundTime.split("T")[0];
+
+    if (e.value[0].baseBuildList != null) {
+      form.value.baseBuildList = e.value[0].baseBuildList;
+    } else {
       form.value.baseBuildList = [
         {
           buildName: "", //建筑名称
@@ -487,6 +685,24 @@ function selectAction(e) {
       ];
     }
   }
+
+  actionShow.value = false;
+}
+
+/**
+ * @时间弹出框点击事件
+ */
+function handleDateTime(value, index, time) {
+  showTime.value = true;
+  if (value == "成立时间") {
+    timeValue.value = time ? Number(new Date(time)) : Number(new Date());
+    timeIndex.value = index;
+    timeTitle.value = "成立时间";
+  } else if (value == "建成年份") {
+    timeValue.value = time ? Number(new Date(time)) : Number(new Date());
+    timeIndex.value = index;
+    timeTitle.value = "建成年份";
+  }
 }
 
 /**
@@ -530,14 +746,14 @@ function addSubmit() {
  * @按钮点击事件
  */
 function deleteSubmit(index) {
-  console.log("id" in form.value.baseBuildList[index]);
-
   if ("id" in form.value.baseBuildList[index]) {
     delBaseBuild(form.value.baseBuildList[index].id).then((res) => {
       if (res.status == "SUCCESS") {
         form.value.baseBuildList.splice(index, 1);
       }
     });
+  } else {
+    form.value.baseBuildList.splice(index, 1);
   }
 }
 

+ 6 - 5
src/pages/login.vue

@@ -134,23 +134,21 @@ async function getSendSms(params) {
  * 判断运行环境
  */
 function env() {
-	
   // const u = navigator.userAgent
   // //https://blog.csdn.net/weixin_42659644/article/details/126294231
   // if(u.indexOf('saas')>-1){ //指定app内 获取app识别号
   // }else{
-
   // }
 
   let port = uni.getSystemInfoSync().platform;
   switch (port) {
     case "android":
-	 getMobileTenantConfigApi({ url: window.location.host });
+      getMobileTenantConfigApi({ url: window.location.host });
       console.log("Android"); //android
       break;
     case "ios":
       console.log("iOS"); //ios
-	  getMobileTenantConfigApi({ url: window.location.host });
+      getMobileTenantConfigApi({ url: window.location.host });
       break;
     case "windows":
       // console.log("H5"); //H5
@@ -162,8 +160,11 @@ function env() {
       break;
   }
 }
+
+// #ifdef H5
 env();
-//getMobileTenantConfigApi({ url: "172.16.1.47:3000" }) // 测试
+// #endif
+
 /** 点击提交按钮 */
 async function submitRes() {
   if (switchText.value == "账号密码登录") {

BIN
src/static/images/unitInfoCollection/icon1.png