index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <view class="uni-container uni-container-bg">
  3. <view class="example container" :style="'height: ' + (screenHeight - 100) + 'px'">
  4. <!-- 搜索框 -->
  5. <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  6. <uni-col :span="24">
  7. <view class="u-page__tag-item">
  8. <u-search placeholder="请输入人员姓名" bgColor="#edf6f9" borderColor="#4cb2b6" v-model="keyword"
  9. :show-action="true" @custom="search"></u-search>
  10. </view>
  11. </uni-col>
  12. </uni-row>
  13. <!-- 下拉框 -->
  14. <view class="u-page__tag-item"
  15. style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;background-color: #f5f7fa;">
  16. <u-form>
  17. <u-form-item prop="orgName" @click="
  18. showOrg = true;
  19. hideKeyboard();
  20. " label="单位选择:" labelWidth="100px">
  21. <u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
  22. <u-icon slot="right" name="arrow-down"></u-icon>
  23. </u-form-item>
  24. </u-form>
  25. </view>
  26. <!-- 卡片栏 -->
  27. <view v-if="tableData.length>0 && isLoaded" style="margin-bottom: 120rpx">
  28. <view v-for="(item, index) in tableData" :key="index"
  29. v-if="formData.orgName === item.orgName || formData.orgId === item.orgId">
  30. <uni-card>
  31. <!-- 简要内容 -->
  32. <view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
  33. <text class="name-align-drill">动火执行人:</text>
  34. <text class="conts">{{ item.executor }}</text>
  35. </view>
  36. <view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
  37. <text class="name-align-drill">动火事由:</text>
  38. <text class="conts">{{ item.workReason }}</text>
  39. </view>
  40. <view style="margin-top: 80rpx;">
  41. <view @click.native="onClick(item.id)" link class="an-niu" ><text class="detail">查看详情</text>
  42. </view>
  43. </view>
  44. </uni-card>
  45. </view>
  46. </view>
  47. <!-- tableData为空时显示 -->
  48. <view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
  49. <view class="text-gray" style="padding-top: 20px;">
  50. <img :src="tan90" alt="暂无数据" />
  51. </view>
  52. </view>
  53. <u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false"
  54. @select="sexSelect"></u-action-sheet>
  55. <u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
  56. showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
  57. <u-modal title="审核" :show="showShenHe" showCancelButton closeOnClickOverlay confirmText="审核通过"
  58. cancelText="取消" @confirm="confirmShenHe" :closeOnClickOverlay="true" @cancel="cancelShenHe" @close="close">
  59. </u-modal>
  60. <!-- 加载中 -->
  61. <isLodingModel></isLodingModel>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. var that = '';
  67. import {
  68. getOrgId //获取orgId
  69. } from '@/api/architecture';
  70. import {
  71. fireWorkPage,
  72. fireWorkUpdate,
  73. fireWorkDelete,
  74. fireWorkShenHe
  75. } from '@/api/fireSpecial';
  76. import config from '@/config'
  77. const baseUrlImg = config.baseUrlImg
  78. export default {
  79. data() {
  80. return {
  81. showShenHe:false,
  82. screenHeight: this.$screenHeight,
  83. wheight: '',
  84. keyword: '',
  85. isLoaded: false,
  86. Group: `${baseUrlImg}/checkActive/Group.png`,
  87. showOrg: false,
  88. actions: [],
  89. // 数据
  90. tableData: {},
  91. title: '是否删除该数据项?',
  92. content: '确认删除?',
  93. id: '',
  94. tan90: `${baseUrlImg}/tan90.png`,
  95. // 每页数据量
  96. pageSize: 5,
  97. // 当前页
  98. pageNo: 1,
  99. // 数据总量
  100. total: 0,
  101. // tableData数据加载中
  102. loading: false,
  103. // 初始化时搜索框的值
  104. keyword: '',
  105. // 存放orgid,orgname
  106. formData: {},
  107. show: false,
  108. showtimeStart: false,
  109. showtimeEnd: false,
  110. juese: {},
  111. ShenHeids:''
  112. };
  113. },
  114. // 在 vue页面,向起始页通过事件传递数据
  115. onLoad: function(option) {
  116. // this.init();
  117. },
  118. watch: {
  119. loading: {
  120. handler(newLength, oldLength) {
  121. this.$modal.isLoadingModel(this.loading)
  122. },
  123. immediate: true
  124. }
  125. },
  126. mounted() {
  127. this.actions = []
  128. that = this;
  129. this.juese=uni.getStorageSync('getUserInfo_key').userRoles.appRoles[0].role_lable
  130. getOrgId({
  131. pageNo: this.pageNo,
  132. pageSize: this.pageSize,
  133. userId: this.$store.state.user.id
  134. }).then(response => {
  135. console.log(response, 'response');
  136. // 取到用户对应的单位名称与id
  137. response.data.map(v => {
  138. this.actions.push({
  139. id: v.dwid,
  140. name: v.orgName
  141. });
  142. });
  143. console.log(response.data, '21321312');
  144. this.formData.orgName = response.data[0].orgName ? response.data[0].orgName : '';
  145. this.formData.orgId = response.data[0].dwid;
  146. this.tableData = []
  147. this.getData();
  148. });
  149. },
  150. onReady() {},
  151. mixins: [uni.$u.mixin],
  152. methods: {
  153. processClick(ShenHeids) { //审核
  154. this.showShenHe=true
  155. this.ShenHeids=ShenHeids
  156. },
  157. //审核通过
  158. confirmShenHe() {
  159. this.showShenHe = false
  160. fireWorkShenHe({ids:this.ShenHeids
  161. }).then(response => {
  162. this.tableData = []
  163. this.getData()
  164. })
  165. },
  166. //审核不通过
  167. cancelShenHe() {
  168. this.showShenHe = false
  169. },
  170. search(val) {
  171. console.log(val, 'valvals', this.formData);
  172. this.tableData = []
  173. this.getData()
  174. },
  175. async init() {
  176. var t = this;
  177. t.$.getlocation()
  178. .then(res => {
  179. console.log(res, 'res');
  180. })
  181. .catch(err => {
  182. console.log(err, 'err');
  183. });
  184. },
  185. // 模态框内容
  186. showModal(val) {
  187. this.show = true;
  188. this.id = val;
  189. console.log(val, 'val.id');
  190. },
  191. confirm() {
  192. this.show = false;
  193. fireWorkDelete({
  194. id: this.id
  195. }).then(response => {
  196. this.loading = true;
  197. this.isLoaded = false
  198. this.tableData = []
  199. this.getData();
  200. console.log(this.tableData, '获取建筑信息详细信息获取建筑信息详细信息获取建筑信息详细信息获取建筑信息详细信息');
  201. });
  202. },
  203. close() {
  204. this.show = false;
  205. console.log('close');
  206. },
  207. cancel() {
  208. this.show = false;
  209. console.log('cancel');
  210. },
  211. //查看详情
  212. addClickDetail(val) {
  213. uni.navigateTo({
  214. url: `/pagesA/fire/architecture/add_architecture/add_architecture?item=${JSON.stringify(val)}`
  215. });
  216. },
  217. // 获取数据
  218. getData() {
  219. this.loading = true;
  220. // 获取建筑信息详细信息
  221. let arrOrg = []
  222. arrOrg.push(this.formData.orgId)
  223. fireWorkPage({
  224. pageNo: this.pageNo,
  225. pageSize: this.pageSize,
  226. orgIds: arrOrg,
  227. executor: this.keyword
  228. }).then(response => {
  229. console.log(response, 'sdsdsd');
  230. this.isLoaded = true
  231. this.tableData = response.data ? [...this.tableData, ...response.data.list] : []
  232. this.total = response.data ? response.data.total : 0
  233. this.loading = false
  234. });
  235. },
  236. // 传递数据
  237. onClick(val) {
  238. this.isLoaded = false
  239. uni.navigateTo({
  240. url: `/pagesB/fire/fireWork/addWork/index?title=查看动火审批&&viewData=${val}`
  241. })
  242. },
  243. editClick(val) {
  244. this.isLoaded = false
  245. uni.navigateTo({
  246. url: `/pagesB/fire/fireWork/addWork/index?title=编辑动火审批&&editData=${val}&&orgaction=${JSON.stringify(this.actions)}`
  247. })
  248. },
  249. addClick() {
  250. this.isLoaded = false
  251. uni.navigateTo({
  252. url: `/pagesB/fire/fireWork/addWork/index?title=新增动火审批&&orgName=${this.formData.orgName}&&orgId=${this.formData.orgId}&&orgaction=${JSON.stringify(this.actions)}`
  253. });
  254. },
  255. sexSelect(e) {
  256. this.formData.orgId = e.id;
  257. this.formData.orgName = e.name;
  258. this.getData()
  259. },
  260. // 触底的事件
  261. onReachBottom() {
  262. // 判断是否还有下一页数据
  263. if (this.pageNo * this.pageSize >= this.total)
  264. return uni.showToast({
  265. title: `数据加载完毕`
  266. });
  267. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  268. if (this.loading) return;
  269. this.pageNo += 1;
  270. this.getData(this.pageNo);
  271. },
  272. // 隐藏键盘
  273. hideKeyboard() {
  274. uni.hideKeyboard();
  275. },
  276. }
  277. };
  278. </script>
  279. <style lang="scss" scoped>
  280. body {
  281. background-color: #f5f7f9;
  282. }
  283. page {
  284. background-color: #f5f7f9;
  285. }
  286. /deep/ .u-tabs__wrapper[data-v-0de61367],
  287. .u-tabs__wrapper.data-v-0de61367 {
  288. width: 99%;
  289. }
  290. .uni-container {
  291. height: 100vh;
  292. padding-right: 20upx;
  293. }
  294. .addInsp {
  295. width: 40px;
  296. position: fixed;
  297. right: 4px;
  298. z-index: 99999;
  299. }
  300. ::v-deep .u-icon__icon {
  301. margin-right: 0px !important;
  302. }
  303. .an-niu {
  304. float: right;
  305. font-size: 10px;
  306. text-align: center;
  307. display: flex;
  308. margin-top: -64upx;
  309. padding-bottom: 30rpx;
  310. // margin-top: 50rpx;
  311. color: #fff;
  312. .detail {
  313. width: 60px;
  314. height: 60rpx;
  315. padding: 0 20rpx;
  316. border-radius: 30px;
  317. background-color: #f7c41e;
  318. margin-right: 20rpx;
  319. text-align: center;
  320. line-height: 60rpx;
  321. font-size: 27upx;
  322. }
  323. .detailDel {
  324. width: 60px;
  325. height: 60rpx;
  326. // padding: 0 20rpx;
  327. border-radius: 30px;
  328. background-color: #ff2e31;
  329. color: white;
  330. margin-right: 20rpx;
  331. text-align: center;
  332. line-height: 60rpx;
  333. font-size: 30upx;
  334. }
  335. .solve {
  336. width: 62px;
  337. height: 60rpx;
  338. margin-right: 20rpx;
  339. border-radius: 30px;
  340. background-color: #4cb2b6;
  341. line-height: 60rpx;
  342. }
  343. /deep/ .padding-tb-sm {
  344. padding-top: 0px;
  345. padding-bottom: 10px;
  346. }
  347. .deletes {
  348. width: 62px;
  349. height: 60rpx;
  350. border-radius: 60rpx;
  351. background-color: red;
  352. color: #fff;
  353. line-height: 60rpx;
  354. }
  355. }
  356. /deep/.segmented-control__item--button {
  357. background-color: rgb(76, 178, 182) !important;
  358. }
  359. /deep/.segmented-control__item--button--active {
  360. background-color: #ffffff !important;
  361. }
  362. /deep/.uni-card {
  363. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  364. border-radius: 30rpx;
  365. }
  366. .tiantupian {
  367. width: 110rpx;
  368. height: 110rpx;
  369. position: fixed;
  370. right: 15px;
  371. bottom: 30rpx;
  372. }
  373. //列表样式
  374. .titles {
  375. font-weight: 600;
  376. margin-bottom: 10rpx;
  377. color: black;
  378. font-size: 32rpx;
  379. }
  380. /deep/ .u-form-item__body__left__content__label {
  381. font-size: 28upx !important;
  382. }
  383. .conts {
  384. max-width: 470upx;
  385. display: -webkit-box;
  386. /*弹性伸缩盒子模型显示*/
  387. -webkit-box-orient: vertical;
  388. /*排列方式*/
  389. -webkit-line-clamp: 1;
  390. /*显示文本行数*/
  391. overflow: hidden;
  392. /*溢出隐藏*/
  393. color: #274647;
  394. text-overflow: ellipsis;
  395. }
  396. .max-width {
  397. max-width: 180upx;
  398. }
  399. /deep/.u-action-sheet {
  400. overflow-y: auto;
  401. height: 1000rpx;
  402. background-color: #fff;
  403. }
  404. .example {
  405. overflow-y: auto;
  406. }
  407. </style>