tabAll.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <div class="bg">
  3. <!-- <van-nav-bar
  4. title="智慧“和顺”"
  5. left-text="民宗干事"
  6. left-arrow
  7. @click-left="onClickLeft"
  8. /> -->
  9. <!-- <van-image
  10. width="100%"
  11. height="10rem"
  12. fit="cover"
  13. src="https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400"
  14. /> -->
  15. <van-swipe :autoplay="3000" lazy-render>
  16. <van-swipe-item v-for="image in BannerImgurls" :key="image">
  17. <van-image width="100%" height="10rem" fit="cover" :src="image" />
  18. </van-swipe-item>
  19. </van-swipe>
  20. <div class="tabtitlelay" @click="goToBeDone">
  21. <div class="tabtitle1"></div>
  22. <div class="tabtitle">我的待办</div>
  23. <div class="tabtitle2">(</div>
  24. <div class="tabtitle3">{{ sum }}</div>
  25. <div class="tabtitle4">)</div>
  26. <van-icon name="ellipsis" class="tabtitle5" />
  27. </div>
  28. <div class="flexll">
  29. <div class="ffl2" id="0" @click="goToBeDone($event)">
  30. <div class="textRegular">待处理</div>
  31. <div class="textRed">{{ sum1 ? sum1 : 0 }}</div>
  32. </div>
  33. <div class="verticalLine"></div>
  34. <div class="ffl2" id="1" @click="goToBeDone($event)">
  35. <div class="textRegular">已处理</div>
  36. <div class="textBlue">{{ sum2 ? sum2 : 0 }}</div>
  37. </div>
  38. </div>
  39. <div class="hLine"></div>
  40. <div class="tabtitlelay">
  41. <div class="tabtitle1"></div>
  42. <div class="tabtitle">场所管理</div>
  43. </div>
  44. <van-grid :border="false">
  45. <van-grid-item icon="./loginbg/csdj.png" text="场所登记" @click="goPlaceRegister" />
  46. <van-grid-item icon="./loginbg/csry.png" text="场所人员信息" @click="goPlacePerson" />
  47. <van-grid-item icon="./loginbg/cspw.png" text="牌位管理" @click="goPlaceTablet" />
  48. </van-grid>
  49. <div class="hLine"></div>
  50. <div class="tabtitlelay">
  51. <div class="tabtitle1"></div>
  52. <div class="tabtitle">{{ testshow }}</div>
  53. </div>
  54. <van-grid :border="false">
  55. <van-grid-item icon="./loginbg/hd_cshd.png" @click="placeActivity" text="场所活动" />
  56. <van-grid-item icon="./loginbg/hd_ssjhd.png" @click="selfMeetingList" text="私设聚会点" />
  57. <van-grid-item icon="./loginbg/hd_xjqz.png" @click="abnormalCrowd" text="信教群众异常" />
  58. <van-grid-item icon="./loginbg/hd_jc.png" text="场所检查" @click="tohd_jc" />
  59. <van-grid-item icon="./loginbg/hd_af.png" text="安防设施异常" @click="tohd_af" />
  60. <van-grid-item icon="./loginbg/hd_hy.png" text="负责人会议" @click="tohd_hy" />
  61. <van-grid-item icon="./loginbg/hd_qt.png" text="其他" @click="tohd_qt" />
  62. </van-grid>
  63. </div>
  64. </template>
  65. <script>
  66. import tool from "@/tool";
  67. import qs from "qs";
  68. import userSets from "@/api/sys/userSets";
  69. import toBeDone from '@/api/toBeDone/toBeDone';
  70. import $base from "@/utils/config";
  71. export default {
  72. data() {
  73. return {
  74. title: '民宗干事',
  75. username: "",
  76. sms: "",
  77. password: "",
  78. password2: "",
  79. con1: 0,
  80. con2: 0,
  81. testshow: "活动管理",
  82. sum: "0",
  83. sum1: "0",
  84. sum2: "0",
  85. BannerImgurls: ['https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400', 'https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400']
  86. }
  87. },
  88. created() {
  89. let id = this.$route.query.id;
  90. window.xm.setNavigationBarTitle({ title: '智慧“和顺”' })
  91. this.TokenLogin2();
  92. this.$dictUtils.refreshDictList();
  93. },
  94. methods: {
  95. // 待办跳转
  96. goToBeDone(e) {
  97. let value = JSON.stringify(e.currentTarget.id)
  98. // console.log(e.currentTarget.id);
  99. this.$router.push({
  100. path: "/toBeDone",
  101. query: { "name": value }
  102. });
  103. },
  104. // 场所登记跳转
  105. goPlaceRegister() {
  106. this.$router.push("/placeRegisterList");
  107. },
  108. // 人员档案跳转
  109. goPlacePerson() {
  110. this.$router.push("/placePerson");
  111. },
  112. // 牌位管理跳转
  113. goPlaceTablet() {
  114. this.$router.push("/placeTablet");
  115. },
  116. //待办数据获取
  117. dataNumber() {
  118. new toBeDone().list().then((res) => {
  119. this.sum1 = res.records.length;
  120. this.sum = this.sum1 + this.sum2;
  121. })
  122. new toBeDone().list2().then((res1) => {
  123. this.sum2 = res1.records.length;
  124. this.sum = this.sum1 + this.sum2;
  125. })
  126. },
  127. onClickLeft() {
  128. history.back();
  129. },
  130. tohd_jc() {
  131. //this.onlineXm.xmNavTo("../activityMan\siteInspection\siteInspectionList");
  132. this.$router.push("/siteInspectionList");
  133. },
  134. tohd_af() {
  135. this.$router.push("/securityFacilitiesErrList");
  136. },
  137. tohd_hy() {
  138. this.$router.push("/religiousConferenceList");
  139. },
  140. tohd_qt() {
  141. this.$router.push("/nonReligiousInformationList");
  142. },
  143. // 活动场所
  144. placeActivity() {
  145. this.$router.push("/placeActivityList")
  146. },
  147. selfMeetingList() {
  148. this.$router.push("/selfMeetingList")
  149. },
  150. abnormalCrowd() {
  151. this.$router.push("/differentbelieversList")
  152. },
  153. async TokenLogin() {
  154. let that = this;
  155. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  156. if (this.$store.state.pctoken == "" || this.$store.state.pctoken == undefined) {
  157. //SDK中 getToken() 方法获取免登token
  158. //window.xm.getToken().then(async function(token){//上线取消注释
  159. let token = "test";//上线注释
  160. const inputForm = qs.stringify({
  161. 'token': token
  162. }, { allowDots: true, arrayFormat: 'indices' })
  163. var res = await this.$API.yin.TokenLogin.get(inputForm);
  164. //存PCtoken
  165. this.$store.commit('setPcToken', res.PcToken);
  166. this.$store.commit('setUser', res.account);
  167. //})//上线取消注释
  168. }
  169. },
  170. TokenLogin2() {
  171. let that = this;
  172. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  173. if (this.$store.state.pctoken == "" || this.$store.state.pctoken == undefined) {
  174. //SDK中 getToken() 方法获取免登token
  175. window.xm.getToken().then(async function (token) {//上线取消注释
  176. // let token = "test";//上线注释
  177. new userSets()
  178. .TokenLogin({
  179. token: token
  180. })
  181. .then((res) => {
  182. that.$store.commit('setPcToken', res.PcToken);
  183. that.$store.commit('setUser', res.account);
  184. that.getBannerImg();//获取轮播图
  185. that.getSelectColor();//获取主题颜色
  186. that.dataNumber();//获取待办事项数
  187. });
  188. })//上线取消注释
  189. } else {
  190. that.getBannerImg();//获取轮播图
  191. that.getSelectColor();//获取主题颜色
  192. that.dataNumber();//获取待办事项数
  193. }
  194. },
  195. getStatistics() {
  196. let that = this;
  197. new userSets()
  198. .Statistics()
  199. .then((res) => {
  200. if (res[0].sum != undefined && res[0].sum != null && res[0].sum != "") {
  201. that.sum = res[0].sum;
  202. }
  203. if (res[0].sum1 != undefined && res[0].sum1 != null && res[0].sum1 != "") {
  204. that.sum1 = res[0].sum1;
  205. }
  206. if (res[0].sum2 != undefined && res[0].sum2 != null && res[0].sum2 != "") {
  207. that.sum2 = res[0].sum2;
  208. }
  209. });
  210. },
  211. getBannerImg() {
  212. new userSets()
  213. .BannerImg({
  214. 'current': 1,
  215. 'size': 5,
  216. 'orders': [],
  217. })
  218. .then((res) => {
  219. let bs = [];
  220. res.records[0].bannerImg.split("|").forEach((item) => {
  221. if (item.trim().length > 0) {
  222. bs.push($base + item.replace('程序附件//', '程序附件/'),
  223. );
  224. }
  225. });
  226. this.BannerImgurls = bs;
  227. });
  228. },
  229. getSelectColor() {
  230. let that = this;
  231. new userSets()
  232. .SelectColor()
  233. .then((res) => {
  234. //console.log(res.records[0].selectColor.substring(1, 7));
  235. //存PCtoken
  236. that.$store.commit('setSelectColor', res.默认);
  237. });
  238. },
  239. //测试接口,可删除
  240. async gettest() {
  241. let that = this;
  242. //SDK中 getToken() 方法获取免登token
  243. // window.xm.getToken().then(function(token){
  244. // console.log(token);
  245. // that.con1="哈哈"+token;
  246. // window.xm.showToast({
  247. // message:that.con1
  248. // })
  249. // })
  250. //测试数据同步接口的
  251. const inputForm = {
  252. 'iamRequestId': '120010',
  253. 'iamRemoteUser': 'admin12022',
  254. 'iamRemotePwd': ''
  255. }
  256. var res = await this.$API.yin.SchemaService.post(inputForm);
  257. if (res.type == 1) {
  258. this.$router.replace({
  259. path: "/main",
  260. });
  261. } else {
  262. Toast.fail(res.message);
  263. }
  264. },
  265. //测试接口,可删除
  266. async gettest2() {
  267. var datas = {
  268. username: "admin",
  269. };
  270. var res = await this.$API.my.OrderDetails.get(datas);
  271. this.con1 = res;
  272. console.log(res);
  273. },
  274. //用户数据同步测试用(用户保存)
  275. async gettestUser1() {
  276. const inputForm = {
  277. 'iamRequestId': '120010',
  278. 'iamRemoteUser': 'admin',
  279. 'iamRemotePwd': '11',
  280. 'loginName': 'yzt2',
  281. 'name': '同步用户2',
  282. 'password': '111',
  283. 'idcard': '320911199010000002',
  284. 'email': '818166662@qq.com',
  285. 'phone': '88868882',
  286. 'mobile': '1829999992',
  287. 'loginFlag': '1',
  288. 'photo': '',
  289. 'sign': '个性签名2',
  290. }
  291. var res = await this.$API.yin.UserCreateService.post(inputForm);
  292. console.log(res);
  293. },
  294. //(用户更新)
  295. async gettestUser2() {
  296. const inputForm = {
  297. 'iamRequestId': '120010',
  298. 'iamRemoteUser': 'admin',
  299. 'iamRemotePwd': '11',
  300. 'uid': '1639158103696228354',
  301. 'loginName': 'yzt222',
  302. 'name': '11',
  303. // 'password': '',
  304. // 'idcard': '',
  305. // 'email': '',
  306. // 'phone': '',
  307. // 'mobile': '',
  308. // 'loginFlag': '',
  309. // 'photo': '',
  310. // 'sign': '',
  311. }
  312. var res = await this.$API.yin.UserUpdateService.post(inputForm);
  313. console.log(res);
  314. },
  315. //(用户删除)
  316. async gettestUser3() {
  317. const inputForm = {
  318. 'iamRequestId': '120010',
  319. 'iamRemoteUser': 'admin',
  320. 'iamRemotePwd': '111',
  321. 'uid': '1639158103696228354',
  322. }
  323. var res = await this.$API.yin.UserDeleteService.post(inputForm);
  324. console.log(res);
  325. },
  326. },
  327. };
  328. </script>
  329. <style>
  330. .bg {
  331. height: 100%;
  332. background: #ffffff;
  333. }
  334. </style>