guoqing 2 anni fa
parent
commit
c16e2fedaf

File diff suppressed because it is too large
+ 10599 - 1
package-lock.json


+ 1 - 1
public/index.html

@@ -8,7 +8,7 @@
     <title><%= htmlWebpackPlugin.options.title %></title>
 
     <!--小程序SDK 只有在小程序容器中才能加载到 -->
-	  <script src="shinemosdk://20000/index.js"></script>
+	  <!-- <script src="shinemosdk://20000/index.js"></script> -->
   </head>
   <body>
     <noscript>

+ 30 - 0
src/api/privateparty/PrivatePartyPointService.js

@@ -0,0 +1,30 @@
+import request from '@/utils/request'
+
+export default class PrivatePartyPointService {
+    save(inputForm) {
+        return request.post(
+            '/privateparty/privatePartyPoint/save',
+            inputForm
+        )
+    }
+
+    // delete(ids) {
+    //     return request({
+    //         url: '/privateparty/privatePartyPoint/delete',
+    //         method: 'delete',
+    //         params: { ids: ids }
+    //     })
+    // }
+
+    queryById(id) {
+        return request.get(
+            '/privateparty/privatePartyPoint/queryById', { id: id }
+        )
+    }
+    list(params) {
+        return request.get(
+            '/privateparty/privatePartyPoint/list',
+            params
+        )
+    }
+}

+ 16 - 0
src/api/siteInspection/siteInspectionServer.js

@@ -0,0 +1,16 @@
+import request from '@/utils/request'
+export default class siteInspectionServer {
+    // 保存
+    save(inputForm) {
+        return request.post(
+            '/csjcqk/siteInspection/save',
+            inputForm
+        )
+    }
+    list(params) {
+        return request.get(
+            `/csjcqk/siteInspection/list`,
+            params
+        )
+    }
+}

+ 50 - 0
src/api/sys/userSets.js

@@ -0,0 +1,50 @@
+import request from '@/utils/request'
+export default class userSets {
+    //轮播图
+    BannerImg() {
+        return request.get(`/banner/bannerImg/list`);
+    };
+    // 主题颜色
+    SelectColor(params) {
+        return request.get(
+            `/selectapp/selectColor/list`,
+            params
+        )
+    };
+    //盐政通登录
+    TokenLogin(params) {
+        return request.get(
+            `/yzt/Login`,
+            params
+        )
+    };
+
+    //盐政通测试用户同步规则
+    SchemaService(params) {
+        return request.post(
+            `/SchemaService`,
+            params
+        )
+    };
+    //盐政通测试用户新建
+    UserCreateService(params) {
+        return request.post(
+            `/UserCreateService`,
+            params
+        )
+    };
+    //盐政通测试用户更新
+    UserUpdateService(params) {
+        return request.post(
+            `/UserUpdateService`,
+            params
+        )
+    };
+    //盐政通测试用户删除
+    UserDeleteService(params) {
+        return request.post(
+            `/UserDeleteService`,
+            params
+        )
+    };
+}

+ 9 - 1
src/router/index.js

@@ -32,6 +32,14 @@ const routes = [{
         meta: {
             isShowTarbar: true,
         }
+    }, {
+        path: '/siteInspectionView',
+        name: 'siteInspectionView',
+        component: () =>
+            import ('../views/activityMan/siteInspection/siteInspectionView.vue'),
+        meta: {
+            isShowTarbar: true,
+        }
     }, {
         path: '/siteInspectionList',
         name: 'siteInspectionList',
@@ -188,4 +196,4 @@ const router = createRouter({
     routes,
 })
 
-export default router
+export default router

+ 2 - 18
src/views/activityMan/placeactivity/placeActivityList.vue

@@ -31,7 +31,7 @@
               <p style="color: #c4c4c4">{{ item.activityTime }}</p>
               <p style="color: red">待审核</p>
             </div>
-            <van-cell is-link to="placeActivityInfo">
+            <van-cell is-link>
               <template #title>
                 {{ item.reporter.name }}申请于{{ item.placeDel }}举办{{
                   item.activityName
@@ -72,7 +72,7 @@
               <p style="color: #c4c4c4">{{ item.activityTime }}</p>
               <p style="color: red">已审核</p>
             </div>
-            <van-cell is-link to="placeActivityInfo">
+            <van-cell is-link>
               <template #title>
                 {{ item.reporter.name }}申请于{{ item.placeDel }}举办{{
                   item.activityName
@@ -197,22 +197,6 @@ export default {
 body {
   background: #f5f5f5;
 }
-.nav_tab {
-  width: 100vw;
-  display: flex;
-  text-align: center;
-  background: #fff;
-  margin: 10px 0;
-}
-.tab {
-  flex: 1;
-  line-height: 40px;
-  font-size: 14px;
-}
-.active {
-  background: #36a7f3;
-  color: #fff;
-}
 .van-list {
   height: 80%;
   margin-top: 5px;

+ 163 - 64
src/views/activityMan/selfMeetingReport/selfMeetingList.vue

@@ -8,43 +8,85 @@
     @click-right="onClickRight"
   />
   <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" />
-  <van-list
-    v-model:loading="loading"
-    :finished="finished"
-    finished-text="没有更多了"
-    @load="onLoad"
+  <van-tabs
+    v-model:active="active"
+    title-inactive-color="#bdbdbd"
+    title-active-color="#36a7f3"
+    @click-tab="onClickTab"
   >
-    <!-- tab切换 -->
-    <div class="nav_tab">
-      <div class="tab active">未审核</div>
-      <div class="tab">已审核</div>
-    </div>
-    <van-swipe-cell v-for="item in list" :key="item">
-      <div class="list_item">
-        <!-- <div class="item-left">
-          <p style="color: #c4c4c4">{{ item.activityTime }}</p>
-          <p style="color: red">待审核</p>
-        </div> -->
-        <van-cell is-link :title="item">
-          <!-- <template #title>
-            {{ item.portname }}申请于{{ item.place }}举办{{ item.activity }}活动
+    <van-tab title="未审核" name="0">
+      <van-list
+        v-model:loading="loading"
+        :finished="finished"
+        finished-text="没有更多了"
+        @load="onLoad"
+      >
+        <van-swipe-cell
+          v-for="item in list"
+          :key="item"
+          :before-close="beforeClose"
+        >
+          <div class="list_item" @click="goInfo(item.id)">
+            <div class="item-left">
+              <p style="color: #c4c4c4">{{ item.partyTime }}</p>
+              <p style="color: red">待审核</p>
+            </div>
+            <van-cell is-link>
+              <template #title>
+                <p>地点:{{ item.placeSelectName }}</p>
+                <p>相关人员:{{ item.relatedPersons.name }}</p>
+                <p>频次:{{ item.frequency }}</p>
+              </template>
+            </van-cell>
+          </div>
+          <template #right>
+            <van-button square type="danger" text="删除" class="button" />
+            <van-button
+              square
+              type="primary"
+              text="修改"
+              class="button"
+              @click="updateItem(item)"
+            />
           </template>
-          <template #label>
-            {{ item.activityPlace + " " + item.address }}
-          </template> -->
-        </van-cell>
-      </div>
-      <template #right>
-        <van-button square type="danger" text="删除" class="button" />
-        <van-button square type="primary" text="修改" class="button" />
-      </template>
-    </van-swipe-cell>
-  </van-list>
+        </van-swipe-cell>
+      </van-list>
+    </van-tab>
+    <van-tab title="已审核" name="1">
+      <van-list
+        v-model:loading="loading"
+        :finished="finished"
+        finished-text="没有更多了"
+        @load="onLoad"
+      >
+        <van-swipe-cell
+          v-for="item in list"
+          :key="item"
+          :before-close="beforeClose"
+        >
+          <div class="list_item" @click="goInfo(item.id)">
+            <div class="item-left">
+              <p style="color: #c4c4c4">{{ item.partyTime }}</p>
+              <p style="color: red">已审核</p>
+            </div>
+            <van-cell is-link>
+              <template #title>
+                <p>地点:{{ item.placeSelectName }}</p>
+                <p>相关人员:{{ item.relatedPersons.name }}</p>
+                <p>频次:{{ item.frequency }}</p>
+              </template>
+            </van-cell>
+          </div>
+        </van-swipe-cell>
+      </van-list>
+    </van-tab>
+  </van-tabs>
 </template>
   
   <script>
 import { ref } from "vue";
-import router from "@/router";
+import PrivatePartyPointService from "@/api/privateparty/PrivatePartyPointService";
+import { useRouter } from "vue-router";
 export default {
   name: "placeActivityList",
   setup() {
@@ -55,56 +97,113 @@ export default {
     const onClickRight = () => {
       router.push("/selfMeeting");
     };
-    const value = ref('');
-    const list = ref([]);
+    const value = ref("");
+    // 切换
+    let active = ref(0);
+    const onClickTab = (val) => {
+      // 清空列表数据
+      finished.value = false;
+      list.value = [];
+      // 重新加载数据
+      // 将 loading 设置为 true,表示处于加载状态
+      loading.value = true;
+      if (val.name == 0) {
+        onLoad(0);
+      } else {
+        onLoad(1);
+      }
+    };
+    // 列表
+    let list = ref([]);
     const loading = ref(false);
     const finished = ref(false);
-
-    const onLoad = () => {
+    let index = 0;
+    const onLoad = (val) => {
       // 异步更新数据
-      // setTimeout 仅做示例,真实场景中一般为 ajax 请求
-      setTimeout(() => {
-        for (let i = 0; i < 10; i++) {
-          list.value.push(list.value.length + 1);
-        }
-
-        // 加载状态结束
-        loading.value = false;
-
-        // 数据全部加载完成
-        if (list.value.length >= 10) {
-          finished.value = true;
-        }
-      }, 1000);
+      new PrivatePartyPointService()
+        .list({
+          current: index + 1,
+          size: 10,
+          assessment: val ? val : 0,
+        })
+        .then((res) => {
+          list.value.push(...res.records);
+          // 加载状态结束
+          loading.value = false;
+          // 数据全部加载完成
+          if (res.records.length < 10) {
+            finished.value = true;
+          }
+          index++;
+        });
+    };
+    // 删除确认
+    const beforeClose = ({ position }) => {
+      switch (position) {
+        case "left":
+        case "cell":
+        case "outside":
+          return true;
+        case "right":
+          return new Promise((resolve) => {
+            showConfirmDialog({
+              title: "确定删除吗?",
+            }).then(resolve);
+          });
+      }
+    };
+    let router = useRouter();
+    // 修改跳转
+    const updateItem = (val) => {
+      router.push({
+        path: "/selfMeeting",
+        query: { id: val.id },
+      });
+    };
+    // 详情跳转
+    const goInfo = (val) => {
+      router.push({
+        path: "/selfMeetingInfo",
+        query: { id: val },
+      });
     };
     return {
+      active,
+      onClickTab,
       onClickLeft,
-      onClickRight,
-      value,
       list,
       onLoad,
       loading,
       finished,
+      value,
+      onClickRight,
+      beforeClose,
+      updateItem,
+      goInfo,
     };
   },
 };
-</script>
+</script >
   
-  <style>
-.nav_tab {
-  width: 100vw;
+<style scope>
+.van-list {
+  height: 80%;
+  margin-top: 5px;
+}
+.list_item {
   display: flex;
-  text-align: center;
   background: #fff;
-  margin: 10px 0;
 }
-.tab {
-  flex: 1;
-  line-height: 40px;
-  font-size: 14px;
+.list_item p{
+  line-height: 1;
+}
+.item-left {
+  text-align: center;
+  width: 30%;
+  font-size: 12px;
+  border-right: 1px solid #eee;
 }
-.active {
-  background: #36a7f3;
-  color: #fff;
+.button {
+  height: 100%;
 }
 </style>

+ 26 - 3
src/views/activityMan/selfMeetingReport/selfMeetingView.vue

@@ -5,7 +5,8 @@
     left-arrow
     @click-left="onClickLeft"
   />
-  <div class="main">
+  <van-loading size="16px" v-if="isLoading">加载中...</van-loading>
+  <div class="main" v-if="!isLoading">
     <p class="title">私设聚会点上报</p>
     <div class="formArea">
       <p class="miniTitle">基础信息</p>
@@ -119,14 +120,16 @@
 </template>
   
   <script>
-import { ref } from "vue";
+import { ref ,onMounted} from "vue";
 import personList from "../personList.vue";
 import tools from "@/api/sys/tools";
-import UserManage from "@/api/user/UserManage";
+import PrivatePartyPointService from "@/api/privateparty/PrivatePartyPointService";
 import { useRoute } from "vue-router";
 export default {
   components: { personList },
   setup() {
+    // 加载
+    let isLoading = ref(true);
     // 返回
     const onClickLeft = () => {
       history.back();
@@ -151,6 +154,25 @@ export default {
       state: "0",
       assessment: "0",
     });
+    // 根据路由初始化
+    let route = useRoute();
+    onMounted(() => {
+      if (route.query.id) {
+        new PrivatePartyPointService().queryById(route.query.id).then((data) => {
+          inputForm.value = data;
+          // let ids = data.knownList.id.split(",");
+          // inputForm.value.knownList.name = "";
+          // ids.forEach((item) => {
+          //   new UserManage().queryById(item).then((data) => {
+          //     inputForm.value.knownList.name += data.name + ",";
+          //   });
+          // });
+          isLoading.value = false;
+        });
+      } else {
+        isLoading.value = false;
+      }
+    });
     // 获取活动时间
     let showAct = ref(false);
     let currentDate = ref(["" + new Date().getFullYear(), "01", "01"]);
@@ -205,6 +227,7 @@ export default {
         .join("/");
     };
     return {
+      isLoading,
       inputForm,
       // 活动时间
       showAct,

+ 0 - 0
src/views/activityMan/siteInspection/siteInspectionInfo.vue


+ 145 - 73
src/views/activityMan/siteInspection/siteInspectionList.vue

@@ -1,87 +1,159 @@
 <template>
     <van-nav-bar
-      title="场所检查"
+      fixed
+      title="场所检查情况"
       left-text=""
+      right-text="上报"
       left-arrow
       @click-left="onClickLeft"
+      @click-right="onClickRight"
     />
-    <van-search
-    v-model="value"
-    shape="round"
-    placeholder="请输入搜索关键词"
-  />
+    <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" />
     <van-list
       v-model:loading="loading"
       :finished="finished"
       finished-text="没有更多了"
+      @load="onLoad"
     >
-      <van-button type="primary" size="small" to="/placeActivity">新增</van-button>
-      <van-cell v-for="item in list" :key="item" :title="item" label="2222" is-link>
-        <template #value>
-          11111
-        </template>
-      </van-cell>
-    </van-list>
-  </template>
+    <div class="nav_tab">
+      <div class="tab" :class="tabIndex ? '' : 'active'" @click="tabIndex = 0">
+        未审核
+      </div>
+      <div class="tab" :class="tabIndex ? 'active' : ''" @click="tabIndex = 1">
+        已审核
+      </div>
+    </div>
+    <van-swipe-cell
+      v-for="item in list"
+      :key="item.id"
+      :before-close="beforeClose"
+    >
+      <div class="list_item">
+        <div class="item-left">
+          <p style="color: #c4c4c4">{{ item.supervisionTime }}</p>
+          <p style="color: red">待审核</p>
+        </div>
+        <van-cell is-link to="siteInspectionView">
+          <template #title>
+            {{ item.siteName.name }}({{ item.placeDel}})
+          </template>
+          <template #label>
+            {{ item.supervisionContent }}
+          </template>
+        </van-cell>
+      </div>
+      <template #right>
+        <van-button square type="danger" text="删除" class="button" />
+        <van-button square type="primary" text="修改" class="button" />
+      </template>
+    </van-swipe-cell>
+  </van-list>
+</template>
 
   <script>
-  import  qs  from "qs";
-
-  export default {
-		data() {
-			return{
-        value:"",
-        list:[],
-        loading:false,
-        finished:false,
-        title:'民宗干事',
-				username:"",
-				sms:"",
-				password:"",
-				password2:"",
-				con1:"0",
-        searchForm: {
-            siteName: {
-                id: ''
-            }
-        },
-			}
-		},
-
-		async created(){
-			let aa=qs.stringify({
-            'current': 1,
-            'size': 10,
-            'orders': [],
-            ...this.searchForm
-            },  { allowDots: true, arrayFormat: 'indices' })
-
-			let id=this.$route.query.id;
-
-			var res = await this.$API.activityMan.siteInspectionList.get(aa);
-      console.log(res);
-
-		},
-
-		methods:{
-        onClickLeft(){
-          history.back();
-        },
-      },
-  };
-
-
-
-  </script>
-
-  <style>
-  .van-button {
-    top: -5px;
-  }
-
-  .van-list {
-    height: 80%;
-    margin-top: 5px;
-  }
+ import { ref } from "vue";
+import router from "@/router";
+import siteInspectionServer from "@/api/siteInspection/siteInspectionServer";
+export default {
+  name: "siteInspectionList",
+  setup() {
+    const onClickLeft = () => {
+      history.back();
+    };
+    const onClickRight = () => {
+      router.push("/siteInspectionView");
+    };
+    let tabIndex = ref(0);
+    let list = ref([]);
+    const loading = ref(false);
+    const finished = ref(false);
+    let index = 0;
+    const onLoad = () => {
+      // 异步更新数据
+      new siteInspectionServer()
+        .list({
+          current: index + 1,
+          size: 10,
+          assessment:0,
+        })
+        .then((res) => {
+          list.value.push(...res.records) ;
+          // 加载状态结束
+          loading.value = false;
+          index++;
+          // 数据全部加载完成
+          if (res.records.length < 10) {
+            finished.value = true;
+          }
+        });
+    };
+    // 搜索
+    let value = ref("");
+    // 删除确认
+    const beforeClose = ({ position }) => {
+      switch (position) {
+        case "left":
+        case "cell":
+        case "outside":
+          return true;
+        case "right":
+          return new Promise((resolve) => {
+            showConfirmDialog({
+              title: "确定删除吗?",
+            }).then(resolve);
+          });
+      }
+    };
+    return {
+      onClickLeft,
+      list,
+      onLoad,
+      loading,
+      finished,
+      value,
+      onClickRight,
+      tabIndex,
+      beforeClose,
+    };
+  },
+};
+</script>
 
-  </style>
+<style>
+body {
+  background: #f5f5f5;
+}
+.nav_tab {
+  width: 100vw;
+  display: flex;
+  text-align: center;
+  background: #fff;
+  margin: 10px 0;
+}
+.tab {
+  flex: 1;
+  line-height: 40px;
+  font-size: 14px;
+}
+.active {
+  background: #36a7f3;
+  color: #fff;
+}
+.van-list {
+  height: 80%;
+  margin-top: 5px;
+}
+.list_item {
+  display: flex;
+  background: #fff;
+}
+.item-left {
+  text-align: center;
+  width: 30%;
+  font-size: 12px;
+  border-right: 1px solid #eee;
+}
+.button {
+  height: 100%;
+}
+</style>

+ 301 - 373
src/views/activityMan/siteInspection/siteInspectionView.vue

@@ -1,383 +1,311 @@
 <template>
-    <van-nav-bar
-      title="信息上报中心"
-      left-text=""
-      left-arrow
-      @click-left="onClickLeft"
-    />
-    <div class="main">
-      <p class="title">场所检查情况上报</p>
-      <div class="formArea">
-        <p class="miniTitle">基础信息</p>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.activity"
-            center
-            label="活动名称:"
-            placeholder="请填写活动名称"
-            input-align="right"
-          />
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.place"
-            readonly
-            required
-            label="场所名称:"
-            placeholder="请选择"
-            input-align="right"
-            right-icon="arrow-down"
-            @click="showPlace = true"
-          />
-          <van-popup v-model:show="showPlace" round position="bottom">
-            <van-picker
-              title="活动场所"
-              :columns="places"
-              @cancel="showPlace = false"
-              @confirm="getPlace"
-            />
-          </van-popup>
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.activityTime"
-            center
-            readonly
-            label="活动时间:"
-            placeholder="请选择时间"
-            input-align="right"
-            right-icon="arrow-down"
-            @click="showAct = true"
-          />
-          <van-popup v-model:show="showAct" round position="bottom">
-            <van-picker-group
-              title="活动时间"
-              :tabs="['选择日期', '选择时间']"
-              next-step-text="下一步"
-              @confirm="getTime"
-              @cancel="showAct = false"
-            >
-              <van-date-picker v-model="currentDate" />
-              <van-time-picker v-model="currentTime" />
-            </van-picker-group>
-          </van-popup>
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.countPerson"
-            center
-            label="参会人数:"
-            placeholder="请填写参会人数"
-            input-align="right"
-            type="digit"
+  <van-nav-bar
+    title="信息上报中心"
+    left-text=""
+    left-arrow
+    @click-left="onClickLeft"
+  />
+  <div class="main">
+    <p class="title">场所检查情况上报</p>
+    <div class="formArea">
+      <p class="miniTitle">基础信息</p>
+      <van-cell-group>
+        <van-field
+          v-model="siteInspection.siteName.name"
+          readonly
+          required
+          label="场所名称:"
+          placeholder="请选择"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="showPlace = true"
+        />
+        <van-popup v-model:show="showPlace" round position="bottom">
+          <van-picker
+            title="场所选择"
+            :columns="places"
+            :columns-field-names="customFieldName"
+            @cancel="showPlace = false"
+            @confirm="getPlace"
           />
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.list"
-            center
-            required
-            label="已知名单:"
-            placeholder="请选择参会已知名单"
-            input-align="right"
-            right-icon="arrow-down"
-            @click="showPerson = true"
+        </van-popup>
+      </van-cell-group>
+
+      <van-cell-group>
+        <!-- <van-field
+          v-model="siteInspection.place"
+          center
+          readonly
+          label="地点:"
+          placeholder="请填写地点"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="showArea = true"
+        /> -->
+        <van-field
+          v-model="siteInspection.place"
+          center
+          readonly
+          label="地点:"
+          placeholder="请填写地点"
+          input-align="right"
+          right-icon="arrow-down"
+        />
+        <van-popup v-model:show="showArea" round position="bottom">
+          <van-cascader
+            v-model="cascaderValue"
+            title="请选择所在地区"
+            :options="options"
+            @close="showArea = false"
+            @finish="onFinish"
+            :field-names="fieldNames"
           />
-          <van-dialog
-            v-model:show="showPerson"
-            title="选择人员名单"
-            show-cancel-button
-            @confirm="reselected"
+        </van-popup>
+      </van-cell-group>
+
+      <van-cell-group>
+        <van-field
+          v-model="siteInspection.placeDel"
+          center
+          label="详细地点:"
+          placeholder="请填写详细地点"
+          input-align="right"
+          right-icon="location"
+        />
+      </van-cell-group>
+      <van-cell-group>
+        <van-field
+          v-model="siteInspection.supervisionTime"
+          center
+          readonly
+          label="督查时间:"
+          placeholder="请选择督查时间"
+          input-align="right"
+          right-icon="arrow-down"
+          @click="showAct = true"
+        />
+        <van-popup v-model:show="showAct" round position="bottom">
+          <van-picker-group
+            title="督查时间"
+            :tabs="['选择日期', '选择时间']"
+            next-step-text="下一步"
+            @confirm="getTime"
+            @cancel="showAct = false"
           >
-            <person-list @selected="selected"></person-list>
-          </van-dialog>
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.portname"
-            center
-            label="报告人:"
-            placeholder="请选择报告人"
-            input-align="right"
-            right-icon="arrow-down"
-          />
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.area"
-            center
-            label="参加范围:"
-            placeholder="请填写参加范围"
-            input-align="right"
-          />
-        </van-cell-group>
-        <van-cell-group>
+            <van-date-picker v-model="currentDate" />
+            <van-time-picker v-model="currentTime" :columns-type="columnsType" />
+          </van-picker-group>
+        </van-popup>
+      </van-cell-group>
+
+      <van-cell-group>
+        <van-field name="uploader" label="附件:">
+          <template #input>
+            <van-uploader>
+              <van-button icon="plus">上传文件</van-button>
+            </van-uploader>
+          </template>
+        </van-field>
+      </van-cell-group>
+      <van-cell-group>
+        <div class="rowTextArea">
           <van-field
-            v-model="placeActivity.activityPlace"
+            v-model="siteInspection.supervisionContent"
             center
-            readonly
-            label="活动地点:"
-            placeholder="请填写参加地点"
-            input-align="right"
-            right-icon="arrow-down"
-            @click="showArea = true"
+            rows="2"
+            type="textarea"
+            label="督查内容:"
+            label-align="top"
           />
-          <van-popup v-model:show="showArea" round position="bottom">
-            <van-cascader
-              v-model="cascaderValue"
-              title="请选择所在地区"
-              :options="options"
-              @close="showArea = false"
-              @finish="onFinish"
-            />
-          </van-popup>
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.address"
-            center
-            label="详细地址:"
-            placeholder="请填写活参加地点"
-            input-align="right"
-            right-icon="location"
-          />
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.money"
-            center
-            label="经费来源:"
-            placeholder="请选择"
-            input-align="right"
-          />
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.activityName"
-            center
-            label="活动负责人:"
-            placeholder="请选择活动负责人"
-            input-align="right"
-            right-icon="arrow-down"
-            @click="showReport = true"
-          />
-          <van-dialog
-            v-model:show="showReport"
-            title="选择活动负责人"
-            show-cancel-button
-          >
-            <person-list></person-list>
-          </van-dialog>
-        </van-cell-group>
-        <van-cell-group>
-          <van-field
-            v-model="placeActivity.tel"
-            center
-            type="tel"
-            label="联系方式:"
-            placeholder="请填写联系方式"
-            input-align="right"
-          />
-        </van-cell-group>
-        <van-cell-group>
-          <van-field name="uploader" label="安全预案:">
-            <template #input>
-              <van-uploader>
-                <van-button icon="plus">上传文件</van-button>
-              </van-uploader>
-            </template>
-          </van-field>
-        </van-cell-group>
-        <van-cell-group>
-          <div class="rowTextArea">
-            <van-field
-              v-model="placeActivity.into"
-              center
-              rows="2"
-              type="textarea"
-              label="主题内容:"
-              label-align="top"
-            />
-          </div>
-        </van-cell-group>
-      </div>
-      <div class="subbtn">
-        <van-button type="primary">提交</van-button>
-        <van-button type="default" hairline>取消</van-button>
-      </div>
+        </div>
+      </van-cell-group>
     </div>
-  </template>
-  
-  <script>
-  import { reactive, ref } from "vue";
-  import personList from "../personList.vue";
-  export default {
-    components: { personList },
-    setup() {
-      // 返回
-      const onClickLeft = () => {
-        history.back();
-      };
-      // 活动信息
-      const placeActivity = reactive({
-        activity: "",
-        place: "",
-        activityTime: "",
-        countPerson: "",
-        list: "",
-        portname: "",
-        area: "",
-        activityPlace: "",
-        address: "",
-        money: "",
-        activityName: "",
-        tel: "",
-        file: "",
-        into: "",
+    <div class="subbtn">
+      <van-button type="primary" @click="submit">提交</van-button>
+      <van-button type="default" hairline>取消</van-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { reactive, ref } from "vue";
+import personList from "../personList.vue";
+import siteInspectionServer from "@/api/siteInspection/siteInspectionServer";
+import tools from "@/api/sys/tools";
+export default {
+  components: { personList },
+  setup() {
+    const onClickLeft = () => {
+      history.back();
+    };
+    const siteInspection = reactive({
+      id: "",
+      siteName: {
+        id: "",
+      },
+      place: "",
+      placeDel: "",
+      supervisionTime: "",
+      supervisionContent: "",
+      //附件
+      enclosure: "",
+      state: "0",
+      assessment: "0",
+    });
+    // 场所名称
+    let places = ref([]);
+    const customFieldName = {
+      text: "name",
+      value: "id",
+    };
+    new tools()
+      .placeList({
+        current: 1,
+        size: 10000,
+      })
+      .then(({ records }) => {
+        places.value.push(...records);
       });
-      // 场所名称
-      const places = [
-        { text: "杭州", value: "Hangzhou" },
-        { text: "宁波", value: "Ningbo" },
-        { text: "温州", value: "Wenzhou" },
-        { text: "绍兴", value: "Shaoxing" },
-        { text: "湖州", value: "Huzhou" },
-      ];
-      let showPlace = ref(false);
-      const getPlace = ({ selectedOptions }) => {
-        showPlace.value = false;
-        placeActivity.place = selectedOptions[0].text;
-      };
-      // 获取活动时间
-      let showAct = ref(false);
-      let currentDate = ref(["" + new Date().getFullYear(), "01", "01"]);
-      let currentTime = ref(["00", "00"]);
-      const getTime = () => {
-        showAct.value = false;
-        placeActivity.activityTime = `${currentDate.value.join(
-          "-"
-        )} ${currentTime.value.join(":")}`;
-      };
-      // 已知名单
-      let showPerson = ref(false);
-      // 活动负责人
-      let showReport = ref(false);
-      const show = () => {
-        showPerson = true;
-      };
-      let list = "";
-      const selected = (val) => {
-        
-        list = val;
-      };
-      const reselected = () => {
-        placeActivity.list = list;
-      };
+    let showPlace = ref(false);
+    const getPlace = ({ selectedOptions }) => {
+      showPlace.value = false;
+      siteInspection.siteName = selectedOptions[0];
+      console.log(selectedOptions[0].placeSelectName);
+      siteInspection.place = selectedOptions[0].placeSelectName
+    };
+    // 获取督查时间
+    let showAct = ref(false);
+    let currentDate = ref(["" + new Date().getFullYear(), "01", "01"]);
+    let currentTime = ref(["00", "00"]);
+    const columnsType = ['hour', 'minute', 'second'];
+    const getTime = () => {
+      showAct.value = false;
+      siteInspection.supervisionTime = `${currentDate.value.join(
+        "-"
+      )} ${currentTime.value.join(":")}`;
+    };
+    let list = {
+      value: [],
+      type: "",
+    };
+
+    // 地区选择
+    let showArea = ref(false);
+    const cascaderValue = ref("");
+    const fieldNames = {
+      text: "name",
+      value: "code",
+      children: "children",
+    };
+    // 选项列表,children 代表子选项,支持多级嵌套
+    let options = ref([]);
+    new tools().treeData().then((res) => {
+      options.value.push(res[0]);
+    });
+    // 全部选项选择完毕后,会触发 finish 事件
+    const onFinish = ({ selectedOptions }) => {
+      showArea.value = false;
+      siteInspection.place = selectedOptions
+        .map((option) => option.name)
+        .join("/");
+    };
+    // 提交数据
+    const submit = () => {
+      //添加保存前判断
+
+      new siteInspectionServer().save(siteInspection).then((res) => {
+        if(res.data=="保存场所检查情况成功"){
+          console.log("保存成功");
+          //添加保存后跳转
+        }
+
+      });
+    };
+    return {
+      siteInspection,
+      // 场所
+      customFieldName,
+      showPlace,
+      places,
+      getPlace,
+      // 时间
+      showAct,
+      currentDate,
+      currentTime,
+      columnsType,
+      getTime,
+      // 返回
+      onClickLeft,
       // 地区选择
-      let showArea = ref(false);
-      const cascaderValue = ref("");
-      // 选项列表,children 代表子选项,支持多级嵌套
-      const options = [
-        {
-          text: "浙江省",
-          value: "330000",
-          children: [{ text: "杭州市", value: "330100" }],
-        },
-        {
-          text: "江苏省",
-          value: "320000",
-          children: [{ text: "南京市", value: "320100" }],
-        },
-      ];
-      // 全部选项选择完毕后,会触发 finish 事件
-      const onFinish = ({ selectedOptions }) => {
-        showArea.value = false;
-        placeActivity.activityPlace = selectedOptions
-          .map((option) => option.text)
-          .join("/");
-      };
-      return {
-        placeActivity,
-        // 活动场所
-        showPlace,
-        places,
-        getPlace,
-        // 活动时间
-        showAct,
-        currentDate,
-        currentTime,
-        getTime,
-        // 返回
-        onClickLeft,
-        // 人员选择
-        showPerson,
-        showReport,
-        selected,
-        reselected,
-        // 地区选择
-        showArea,
-        options,
-        onFinish,
-        cascaderValue,
-      };
-    },
-  };
-  </script>
-  
-  <style scoped>
-  * {
-    margin: 0;
-    padding: 0;
-  }
-  .main p {
-    height: 40px;
-    line-height: 40px;
-    color: #36a7f3;
-    border-bottom: 1px solid #eee;
-  }
-  .title {
-    font-size: 20px;
-    font-weight: 700;
-    padding-left: 20px;
-  }
-  .miniTitle {
-    font-size: 16px;
-  }
-  .formArea {
-    padding: 0px 20px;
-  }
-  .formArea .van-cell-group .van-field__label {
-    height: 40px;
-  }
-  .formArea .van-cell-group .van-cell {
-    line-height: 40px;
-  }
-  .van-cell__value .van-field__right-icon .van-icon-location {
-    color: #36a7f3!important;
-  }
-  .rowTextArea::v-deep .van-field__value {
-    width: 98%;
-    border: 2px solid #ccc;
-    border-radius: 10px;
-  }
-  .rowTextArea::v-deep .van-cell {
-    display: flow-root;
-  }
-  .subbtn {
-    margin: 20px;
-    text-align: center;
-  }
-  .subbtn .van-button {
-    width: 40%;
-    margin: 5px;
-  }
-  .van-uploader .van-button {
-    border: none;
-    color: #36a7f3;
-    top: -4px;
-  }
-  .van-dialog {
-    width: 80%;
-    top: 50%;
-  }
-  </style>
+      showArea,
+      fieldNames,
+      options,
+      onFinish,
+      cascaderValue,
+      submit,
+    };
+  },
+};
+</script>
+
+<style scoped>
+* {
+  margin: 0;
+  padding: 0;
+}
+.main {
+  background: #fff;
+}
+.main p {
+  height: 40px;
+  line-height: 40px;
+  color: #36a7f3;
+  border-bottom: 1px solid #eee;
+}
+.title {
+  font-size: 20px;
+  font-weight: 700;
+  padding-left: 20px;
+}
+.miniTitle {
+  font-size: 16px;
+}
+.formArea {
+  padding: 0px 20px;
+}
+.formArea .van-cell-group .van-field__label {
+  height: 40px;
+}
+.formArea .van-cell-group .van-cell {
+  line-height: 40px;
+}
+.van-cell__value .van-field__right-icon .van-icon-location {
+  color: #36a7f3 !important;
+}
+.rowTextArea::v-deep .van-field__value {
+  width: 94%;
+  border: 2px solid #ccc;
+  border-radius: 10px;
+  padding: 10px;
+}
+.rowTextArea::v-deep .van-cell {
+  display: flow-root;
+}
+.subbtn {
+  margin: 20px;
+  text-align: center;
+}
+.subbtn .van-button {
+  width: 40%;
+  margin: 5px;
+}
+.van-uploader .van-button {
+  border: none;
+  color: #36a7f3;
+  top: -4px;
+}
+.van-dialog {
+  width: 80%;
+  top: 50%;
+}
+</style>

+ 54 - 26
src/views/tab_a/tabAll.vue

@@ -73,7 +73,7 @@
 <script>
 import tool from "@/tool";
 import  qs  from "qs";
-import onlineXm from "../../utils/onlineXm"
+import userSets from "@/api/sys/userSets";
 
 	export default {
 		data() {
@@ -90,7 +90,7 @@ import onlineXm from "../../utils/onlineXm"
 
 		created(){
 			let id=this.$route.query.id;
-			this.TokenLogin();
+			this.TokenLogin2();
 			this.getBannerImg();//获取轮播图
 			this.getSelectColor();//获取主题颜色
 		},
@@ -133,9 +133,7 @@ import onlineXm from "../../utils/onlineXm"
 				this.$router.push("/abnormalCrowd")
 			},
 			async TokenLogin(){
-
 				let that=this;
-
 				//添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
 				if(this.$store.state.pctoken==""||this.$store.state.pctoken==undefined){
 
@@ -157,38 +155,68 @@ import onlineXm from "../../utils/onlineXm"
 
 			},
 
-			//获取轮播图
-			async getBannerImg(){
-				const inputForm =qs.stringify({
+			TokenLogin2(){
+				let that=this;
+				//添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
+				if(this.$store.state.pctoken==""||this.$store.state.pctoken==undefined){
+
+					//SDK中 getToken() 方法获取免登token
+					//window.xm.getToken().then(async function(token){//上线取消注释
+					let token="test";//上线注释
+
+
+					new userSets()
+					.TokenLogin({
+						token: token
+					})
+					.then((res) => {
+						that.$store.commit('setPcToken',res.PcToken);
+						that.$store.commit('setUser',res.account);
+					});
+
+					//})//上线取消注释
+
+				}
+
+
+			},
+
+			getBannerImg(){
+				new userSets()
+				.BannerImg({
 					'current': 1,
 					'size': 5,
 					'orders':[],
-					},  { allowDots: true, arrayFormat: 'indices' })
-				var res = await this.$API.my.BannerImg.get(inputForm);
-				let bs=[];
-				for(let i=0;i<res.records.length;i++){
-					bs.push(res.records[i].bannerImg);
-				}
-				//需添加url拼接
-				//this.BannerImgurls=bs;
-				//console.log(this.BannerImgurls);
+				})
+				.then((res) => {
+					let bs=[];
+					for(let i=0;i<res.records.length;i++){
+						bs.push(res.records[i].bannerImg);
+					}
+					//需添加url拼接
+					//this.BannerImgurls=bs;
+					//console.log(this.BannerImgurls);
+				});
 			},
 
-			//获取主题颜色
-			async getSelectColor(){
-				const inputForm =qs.stringify({
+			getSelectColor(){
+				let that=this;
+				new userSets()
+				.SelectColor({
 					'current': 1,
 					'size': 5,
 					'orders':[],
-					},  { allowDots: true, arrayFormat: 'indices' })
-				var res = await this.$API.my.SelectColor.get(inputForm);
-				//默认取出列表第一条的色值使用,注意轻应用文档中(后面直接跟6位十六进制色值,不需要#)
-				console.log(res.records[0].selectColor.substring(1, 7));
-				//存PCtoken
-				this.$store.commit('setSelectColor',res.records[0].selectColor.substring(1, 7));
+				})
+				.then((res) => {
+					//console.log(res.records[0].selectColor.substring(1, 7));
+					//存PCtoken
+					that.$store.commit('setSelectColor',res.records[0].selectColor.substring(1, 7));
+				});
+			},
+
+
 
 
-			},
 
 			//测试接口,可删除
 			async gettest(){

Some files were not shown because too many files changed in this diff