Procházet zdrojové kódy

+ 交通强国小程序变更

chen.cheng před 9 měsíci
rodič
revize
7f280124e3

+ 135 - 1
README.md

@@ -18,4 +18,138 @@ this.$emit('handleClick', '参数');
      "subPackages" : false//关闭分包优化  
   },  
 ```
-4. hbuild发布微信小程序需要启动微信开发者工具
+4. hbuild发布微信小程序需要启动微信开发者工具
+
+##### 表单配置
+
+```json
+{
+  "userInfo.usrName": {
+    "type": "string",
+    "required": true,
+    "message": "请填写姓名",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.tel": {
+    "type": "string",
+    "len": 11,
+    "required": true,
+    "message": "请填写11位手机号",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.email": {
+    "type": "string",
+    "required": false,
+    "message": "请填写邮箱",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.orgUnitName": {
+    "type": "string",
+    "required": true,
+    "message": "请填写单位名称",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.uniLevel": {
+    "type": "string",
+    "required": true,
+    "message": "请填写职务",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.usrType": {
+    "type": "string",
+    "required": true,
+    "message": "请填写人员类型",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.conferenceFlag": {
+    "type": "string",
+    "required": true,
+    "message": "请选择是否参加现场调研",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.contentId": {
+    "type": "number",
+    "required": true,
+    "message": "请选择会场",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.themeFlag": {
+    "type": "string",
+    "required": true,
+    "message": "请选择是否参加主题研讨",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.themeId": {
+    "type": "number",
+    "required": true,
+    "message": "请选择主题",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.wayComing": {
+    "type": "string",
+    "required": true,
+    "message": "请选择来程交通方式",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.comInfo": {
+    "type": "string",
+    "required": true,
+    "message": "请填写来程车次/航班",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.wayBack": {
+    "type": "string",
+    "required": true,
+    "message": "去程交通方式",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  },
+  "userInfo.backInfo": {
+    "type": "string",
+    "required": true,
+    "message": "请填写去程车次/航班",
+    "trigger": [
+      "blur",
+      "change"
+    ]
+  }
+}
+```

+ 13 - 3
common/EnumConst.js

@@ -8,6 +8,9 @@ export const ICON_CFG = {
   login_bg: '/profile/upload/2024/08/17/head-bg_20240817230007A002.png',
   theme_icon: '/profile/upload/2024/10/12/theme_icon_20241012185848A002.svg',
   theme_bg: '/profile/upload/2024/10/12/index_bg_20241012192232A004.png',
+  reviewed_icon: '/profile/upload/2024/10/13/reviewed_20241013142134A001.png',
+  to_review_icon: '/profile/upload/2024/10/13/to_review_20241013142254A002.png',
+  no_pass: '/profile/upload/2024/10/13/no_pass_20241013144713A003.svg',
 };
 
 export const CONTENT_TYPE = {
@@ -95,34 +98,42 @@ export const REVIEW_STATUS = {
     name: '审核通过',
     value: '0',
     tag: 'success',
+    icon: ICON_CFG.reviewed_icon,
     tip: 32,
+    color: '#34c878',
   },
   '1': {
     name: '审核不通过',
     value: '1',
     tag: 'error',
+    icon: ICON_CFG.no_pass,
     tip: 33,
+    color: 'red',
   },
   '2': {
     name: '待审核',
     value: '2',
     tag: 'warning',
+    icon: ICON_CFG.to_review_icon,
+    color: '#3d77e3',
   },
   'pass': {
     name: '审核通过',
     value: '0',
     tag: 'success',
-
+    color: '#3d77e3',
   },
   'noPass': {
     name: '审核不通过',
     value: '1',
     tag: 'error',
+    color: 'red',
   },
   'wait': {
     name: '待审核',
     value: '2',
     tag: 'warning',
+    color: '#34c878',
   },
 };
 
@@ -136,13 +147,12 @@ export const TFC_TYPE = {
     value: 2,
   },
   3: {
-    name: '公路',
+    name: '自行前往',
     value: 3,
   },
 };
 
 export const TFC_INFO = {
-
   1: {
     name: '车次',
     value: 1,

+ 8 - 0
common/common.scss

@@ -102,6 +102,14 @@
 .register-form-container {
   .u-form {
     .u-form-item {
+      /deep/ .u-form-item__body__left {
+        &::before {
+          content: "";
+          width: 4rpx;
+          margin-right: 10rpx;
+          display: inline-block;
+        }
+      }
       &.require {
         /deep/ .u-form-item__body__left {
           &::before {

+ 29 - 9
components/RegistForm/index.vue

@@ -96,6 +96,7 @@
         <u-radio-group
             v-model="model1.userInfo.usrType"
             placement="row"
+            @change="usrTypeChange"
         >
           <u-radio
               :style="{
@@ -363,7 +364,7 @@
 <script>
 
 import { fetchContentInfo, getDicts } from '@/common/api';
-import { CONTENT_TYPE, TFC_INFO, TFC_TYPE, USR_TYPE, USR_TYPE_LIST } from '@/common/EnumConst';
+import { CONTENT_TYPE, FORM_MOD, TFC_INFO, TFC_TYPE, USR_TYPE, USR_TYPE_LIST } from '@/common/EnumConst';
 import SingleDropList from '@/components/SingleDropList/index.vue';
 import { getImageUrl, getUserInfo } from '@/util';
 
@@ -385,6 +386,10 @@ export default {
       type: Function,
       default: function () {},
     },
+    mode: {
+      type: String,
+      default: 'add',
+    },
     registInfo: {
       type: Object,
       default: function () {
@@ -425,16 +430,15 @@ export default {
     this.initUser();
   },
   onLoad() {
+
   },
   onReady() {
     this.setFormRules();
   },
-
   methods: {
     initUser() {
       const user = getUserInfo();
       if (user) {
-        this.model1.userInfo.usrName = user.usrName;
         this.model1.userInfo.tel = user.tel;
       }
       this.init();
@@ -505,10 +509,12 @@ export default {
             value: item.dictValue,
           };
         });
-        this.model1.userInfo.wayComing = data[0].dictValue;
-        this.model1.userInfo.wayBack = data[0].dictValue;
-        this.waycomChange(data[0].dictValue);
-        this.wayBackChange(data[0].dictValue);
+        if (this.mode !== FORM_MOD.modify) {
+          this.model1.userInfo.wayComing = data[0].dictValue;
+          this.model1.userInfo.wayBack = data[0].dictValue;
+          this.waycomChange(data[0].dictValue);
+          this.wayBackChange(data[0].dictValue);
+        }
       }
     },
     onSubmit() {
@@ -517,7 +523,7 @@ export default {
         this.$emit('onSubmitHandle', this.model1.userInfo);
         this.loading = false;
       }).catch(errors => {
-        console.error(errors)
+        console.error(errors);
         this.loading = false;
       });
     },
@@ -526,16 +532,22 @@ export default {
     },
     waycomChange(e) {
       this.comLabel = TFC_INFO[e].name;
+      if (e == 3) {
+        this.model1.userInfo.comInfo = '无';
+      }
     },
     wayBackChange(e) {
       this.backLabel = TFC_INFO[e].name;
+      if (e == 3) {
+        this.model1.userInfo.backInfo = '无';
+      }
     },
     restForm() {
       this.model1 = {
         userInfo: {
           usrName: '',
           conferenceFlag: '0',
-          usrType: "1",
+          usrType: '1',
           follows: [],
         },
       };
@@ -548,6 +560,14 @@ export default {
     clearValidate() {
       this.$refs.uForm.clearValidate();
     },
+    usrTypeChange(val) {
+      if (val === '2') {
+        this.model1.userInfo.conferenceFlag = '3';
+        return;
+      }
+      this.model1.userInfo.conferenceFlag = '0';
+      this.$refs.uForm.setRules(this.rules);
+    },
   },
 };
 </script>

+ 1 - 0
pasb/pages/myApply/index.scss

@@ -13,6 +13,7 @@
     box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2), -5px -5px 10px rgba(0, 0, 0, 0.1);
     box-sizing: border-box;
     padding: 20rpx;
+    position: relative;
     > view {
       width: 100%;
       &:not(:last-child){

+ 18 - 7
pasb/pages/myApply/index.vue

@@ -5,15 +5,21 @@
         <view class="apply-item" v-for="item in indexList" @click="()=>onContentClick(item)">
           <view class="apply-item-header">
             <view>{{ item.applyTypeName }}</view>
-            <view>
-              <u-tag
-                  plain
-                  :text="REVIEW_STATUS[item.reviewState].name"
-                  :type="REVIEW_STATUS[item.reviewState].tag">
-              </u-tag>
+            <view :style="{
+                 background: `url(${getImageUrl(REVIEW_STATUS[item.reviewState].icon)}) no-repeat 100% 100%`,
+                 backgroundSize: '100%',
+                 width: '109rpx',
+                 height: '109rpx',
+                 position: 'absolute',
+                 right:0,
+                 top:0
+               }">
             </view>
           </view>
           <view class="apply-item-title overflow-hidden" style="height: 50px;line-height: 25px" v-if="item.contentTitle">{{ item.contentTitle }}</view>
+          <view class="apply-item-title overflow-hidden" style="height: 50px;line-height: 25px" v-if="item.themeTitle">
+            {{ item.themeTitle }}
+          </view>
           <view class="apply-item-footer">
             <view>参会人:{{ item.usrName }}</view>
             <view>{{ $u.timeFormat(item.createTime, 'yyyy-MM-dd hh:mm') }}</view>
@@ -32,11 +38,15 @@
 
 <script>
 import { getUsrApplyInfo } from '@/common/api';
-import { REVIEW_STATUS } from '@/common/EnumConst';
+import { ICON_CFG, REVIEW_STATUS } from '@/common/EnumConst';
 import AuthWrap from '@/components/AuthComp/index.vue';
+import { getImageUrl } from '@/util';
 
 export default {
   computed: {
+    ICON_CFG() {
+      return ICON_CFG;
+    },
     REVIEW_STATUS() {
       return REVIEW_STATUS;
     },
@@ -55,6 +65,7 @@ export default {
     this.loadmore();
   },
   methods: {
+    getImageUrl,
     onContentClick(item) {
       uni.navigateTo({
         url: `/pasbrg/pages/regmeeting/index?id=${item.id}`,

+ 17 - 9
pasb/pages/regist/index.vue

@@ -5,6 +5,7 @@
         <RegistForm
             v-if="rules"
             :rules="rules"
+            :mode='mode'
             ref="registForm"
             @onSubmitHandle="onFormSubmit"
             :regist-info="model1.userInfo">
@@ -45,12 +46,12 @@ export default {
         userInfo: {
           usrName: '',
           conferenceFlag: '0',
-          themeFlag: '0',
           usrType: '1',
           follows: [],
         },
       },
       rules: null,
+      mode: null,
     };
   },
   created() {
@@ -60,17 +61,18 @@ export default {
     const { msg } = await formCfg('meet_form_cfg');
     if (msg) {
       const cfgJson = JSON.parse(msg);
-        Object.keys(staticRules).forEach(item => {
-          if (!cfgJson[item]) {
-            Object.assign(cfgJson[item], staticRules[item]);
-          }
-        });
-        this.rules = cfgJson;
-      }
+      Object.keys(staticRules).forEach(item => {
+        if (!cfgJson[item]) {
+          Object.assign(cfgJson[item], staticRules[item]);
+        }
+      });
+      this.rules = cfgJson;
+    }
     //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
     this.$refs.authWrap.reloadPage();
     this.$refs.registForm?.setFormRules();
     if (res && res.mode === FORM_MOD.modify) {
+      this.mode = FORM_MOD.modify;
       await this.getUsrMeetingInfo(res.apply);
     } else {
       this.$refs.registForm?.restForm();
@@ -84,7 +86,13 @@ export default {
       uni.hideKeyboard();
     },
     async onFormSubmit(userInfo) {
-      const { code } = await putUsrRegist(userInfo, MEETING_TYPE.meeting.value);
+      const params = {
+        conferenceFlag: '',
+        comInfo: '',
+        backInfo: '',
+      };
+      Object.assign(params, userInfo);
+      const { code } = await putUsrRegist(params, MEETING_TYPE.meeting.value);
       if (code !== 200) {
         return;
       }

+ 61 - 37
pasbrg/pages/regmeeting/index.vue

@@ -25,40 +25,46 @@
         <u-cell title="人员类型" :label="USR_TYPE[meetingInfo.usrType].name">
         </u-cell>
       </u-cell-group>
-      <template v-if="meetingInfo.applyType == MEETING_TYPE.meeting.value">
-        <u-cell-group :border="false">
-          <u-cell title="是否参加现场调研">
-            <view
-                slot="label"
-            >
-              <u-tag
-                  plain
-                  :text="SYS_YES_NO[meetingInfo.conferenceFlag].name"
-                  :type="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value ? 'success' : 'warning'">
-              </u-tag>
-            </view>
-          </u-cell>
-        </u-cell-group>
-        <u-cell-group :border="false" v-if="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value">
-          <u-cell title="调研会场" :label="meetingInfo.contentTitle">
-          </u-cell>
-        </u-cell-group>
-      </template>
-      <template v-else>
-        <u-cell-group :border="false">
-          <u-cell title="会议类型" :label="MEETING_TYPE[meetingInfo.applyType].name">
-          </u-cell>
-        </u-cell-group>
-        <u-cell-group :border="false">
-          <u-cell title="会议信息" :label="meetingInfo.contentTitle">
-          </u-cell>
-        </u-cell-group>
-      </template>
+      <u-cell-group :border="false"
+                    v-if="rules.conferenceFlag && meetingInfo.conferenceFlag && [0,1].includes(meetingInfo.conferenceFlag)">
+        <u-cell title="是否参加现场调研">
+          <view
+              slot="label"
+          >
+            <u-tag
+                plain
+                :text="SYS_YES_NO[meetingInfo.conferenceFlag].name"
+                :type="meetingInfo.conferenceFlag == SYS_YES_NO['0'].value ? 'success' : 'warning'">
+            </u-tag>
+          </view>
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group :border="false" v-if="rules.contentId && meetingInfo.contentTitle">
+        <u-cell title="调研会场" :label="meetingInfo.contentTitle">
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group :border="false" v-if="rules.themeFlag">
+        <u-cell title="是否参加主题研讨">
+          <view
+              slot="label"
+          >
+            <u-tag
+                plain
+                :text="SYS_YES_NO[meetingInfo.themeFlag].name"
+                :type="meetingInfo.themeFlag == SYS_YES_NO['0'].value ? 'success' : 'warning'">
+            </u-tag>
+          </view>
+        </u-cell>
+      </u-cell-group>
+      <u-cell-group :border="false" v-if="rules.themeId && meetingInfo.themeTitle">
+        <u-cell title="研讨主题" :label="meetingInfo.themeTitle">
+        </u-cell>
+      </u-cell-group>
       <u-cell-group :border="false">
         <u-cell title="来程交通方式" :label="TFC_TYPE[meetingInfo.wayComing].name">
         </u-cell>
       </u-cell-group>
-      <u-cell-group :border="false">
+      <u-cell-group :border="false" v-if="meetingInfo.comInfo && meetingInfo.wayComing!='3'">
         <u-cell :title="TFC_INFO[meetingInfo.wayComing].name" :label="meetingInfo.comInfo">
         </u-cell>
       </u-cell-group>
@@ -66,7 +72,7 @@
         <u-cell title="回程交通方式" :label="TFC_TYPE[meetingInfo.wayBack].name">
         </u-cell>
       </u-cell-group>
-      <u-cell-group :border="false">
+      <u-cell-group :border="false" v-if="meetingInfo.backInfo  && meetingInfo.wayBack!='3'">
         <u-cell :title="TFC_INFO[meetingInfo.wayBack].name" :label="meetingInfo.backInfo">
         </u-cell>
       </u-cell-group>
@@ -82,7 +88,9 @@
             <u-tag
                 plain
                 :text="REVIEW_STATUS[meetingInfo.reviewState].name"
-                :type="REVIEW_STATUS[meetingInfo.reviewState].tag">
+                :color="REVIEW_STATUS[meetingInfo.reviewState].color"
+                :borderColor="REVIEW_STATUS[meetingInfo.reviewState].color"
+            >
             </u-tag>
           </view>
         </u-cell>
@@ -91,8 +99,8 @@
         <u-cell title="不通过原因" :label="meetingInfo.reviewMsg">
         </u-cell>
       </u-cell-group>
-      <u-cell-group :border="false" v-for="(item,index) in meetingInfo.follows">
-        <u-cell  :border="false" :title="`随行人员${index+1}`" :label="item.usrName">
+      <u-cell-group :border="false" v-for="(item,index) in meetingInfo.follows" :key="index">
+        <u-cell :border="false" :title="`随行人员${index+1}`" :label="item.usrName">
         </u-cell>
         <u-cell title="联系电话" :label="item.tel">
         </u-cell>
@@ -118,7 +126,7 @@
 </template>
 
 <script>
-import { fetchMeetingTips, fetchUsrApplyDetail } from '@/common/api';
+import { fetchMeetingTips, fetchUsrApplyDetail, formCfg } from '@/common/api';
 import { FORM_MOD, MEETING_TYPE, REVIEW_STATUS, SYS_YES_NO, TFC_INFO, TFC_TYPE, USR_TYPE } from '@/common/EnumConst';
 import AuthWrap from '@/components/AuthComp/index.vue';
 import RichText from '@/components/RichText/index.vue';
@@ -141,17 +149,21 @@ export default {
       TFC_TYPE,
       meetingInfo: {},
       tips: {},
+      rules: {},
     };
   },
   created() {
+
   },
   onLoad(res) {
     // 登录返回之后的页面
     if (res) {
       this.queryParams = res;
     }
-    this.getUsrMeetingInfo();
-    this.getTips();
+    this.getRules(() => {
+      this.getUsrMeetingInfo();
+      this.getTips();
+    });
   },
   onUnload() {
     let pages = getCurrentPages();//获取所有界面栈的实例列表
@@ -159,6 +171,18 @@ export default {
     prePage.onLoad();
   },
   methods: {
+    async getRules(callback) {
+      const { msg } = await formCfg('meet_form_cfg');
+      if (msg) {
+        const cfg = JSON.parse(msg);
+        const formatCfg = {};
+        Object.keys(cfg).forEach(key => {
+          formatCfg[key.split('.')[1]] = cfg[key];
+        });
+        this.rules = formatCfg;
+      }
+      callback();
+    },
     async getUsrMeetingInfo() {
       const { data } = await fetchUsrApplyDetail(this.queryParams.id);
       if (!data) {