index.vue 11 KB

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