index.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  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. // 取到用户对应的单位名称与id
  136. response.data.map(v => {
  137. this.actions.push({
  138. id: v.dwid,
  139. name: v.orgName
  140. });
  141. });
  142. this.formData.orgName = response.data[0].orgName ? response.data[0].orgName : '';
  143. this.formData.orgId = response.data[0].dwid;
  144. this.tableData = []
  145. this.getData();
  146. });
  147. },
  148. onReady() {},
  149. mixins: [uni.$u.mixin],
  150. methods: {
  151. processClick(ShenHeids) { //审核
  152. this.showShenHe=true
  153. this.ShenHeids=ShenHeids
  154. },
  155. //审核通过
  156. confirmShenHe() {
  157. this.showShenHe = false
  158. fireWorkShenHe({ids:this.ShenHeids
  159. }).then(response => {
  160. this.tableData = []
  161. this.getData()
  162. })
  163. },
  164. //审核不通过
  165. cancelShenHe() {
  166. this.showShenHe = false
  167. },
  168. search(val) {
  169. this.tableData = []
  170. this.getData()
  171. },
  172. async init() {
  173. var t = this;
  174. t.$.getlocation()
  175. .then(res => {
  176. })
  177. .catch(err => {
  178. });
  179. },
  180. // 模态框内容
  181. showModal(val) {
  182. this.show = true;
  183. this.id = val;
  184. },
  185. confirm() {
  186. this.show = false;
  187. fireWorkDelete({
  188. id: this.id
  189. }).then(response => {
  190. this.loading = true;
  191. this.isLoaded = false
  192. this.tableData = []
  193. this.getData();
  194. });
  195. },
  196. close() {
  197. this.show = false;
  198. },
  199. cancel() {
  200. this.show = false;
  201. },
  202. //查看详情
  203. addClickDetail(val) {
  204. uni.navigateTo({
  205. url: `/pagesA/fire/architecture/add_architecture/add_architecture?item=${JSON.stringify(val)}`
  206. });
  207. },
  208. // 获取数据
  209. getData() {
  210. this.loading = true;
  211. // 获取建筑信息详细信息
  212. let arrOrg = []
  213. arrOrg.push(this.formData.orgId)
  214. fireWorkPage({
  215. pageNo: this.pageNo,
  216. pageSize: this.pageSize,
  217. orgIds: arrOrg,
  218. executor: this.keyword
  219. }).then(response => {
  220. this.isLoaded = true
  221. this.tableData = response.data ? [...this.tableData, ...response.data.list] : []
  222. this.total = response.data ? response.data.total : 0
  223. this.loading = false
  224. });
  225. },
  226. // 传递数据
  227. onClick(val) {
  228. this.isLoaded = false
  229. uni.navigateTo({
  230. url: `/pagesB/fire/fireWork/addWork/index?title=查看动火审批&&viewData=${val}`
  231. })
  232. },
  233. editClick(val) {
  234. this.isLoaded = false
  235. uni.navigateTo({
  236. url: `/pagesB/fire/fireWork/addWork/index?title=编辑动火审批&&editData=${val}&&orgaction=${JSON.stringify(this.actions)}`
  237. })
  238. },
  239. addClick() {
  240. this.isLoaded = false
  241. uni.navigateTo({
  242. url: `/pagesB/fire/fireWork/addWork/index?title=新增动火审批&&orgName=${this.formData.orgName}&&orgId=${this.formData.orgId}&&orgaction=${JSON.stringify(this.actions)}`
  243. });
  244. },
  245. sexSelect(e) {
  246. this.formData.orgId = e.id;
  247. this.formData.orgName = e.name;
  248. this.getData()
  249. },
  250. // 触底的事件
  251. onReachBottom() {
  252. // 判断是否还有下一页数据
  253. if (this.pageNo * this.pageSize >= this.total)
  254. return uni.showToast({
  255. title: `数据加载完毕`
  256. });
  257. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  258. if (this.loading) return;
  259. this.pageNo += 1;
  260. this.getData(this.pageNo);
  261. },
  262. // 隐藏键盘
  263. hideKeyboard() {
  264. uni.hideKeyboard();
  265. },
  266. }
  267. };
  268. </script>
  269. <style lang="scss" scoped>
  270. body {
  271. background-color: #f5f7f9;
  272. }
  273. page {
  274. background-color: #f5f7f9;
  275. }
  276. /deep/ .u-tabs__wrapper[data-v-0de61367],
  277. .u-tabs__wrapper.data-v-0de61367 {
  278. width: 99%;
  279. }
  280. .uni-container {
  281. height: 100vh;
  282. padding-right: 20upx;
  283. }
  284. .addInsp {
  285. width: 40px;
  286. position: fixed;
  287. right: 4px;
  288. z-index: 99999;
  289. }
  290. ::v-deep .u-icon__icon {
  291. margin-right: 0px !important;
  292. }
  293. .an-niu {
  294. float: right;
  295. font-size: 10px;
  296. text-align: center;
  297. display: flex;
  298. margin-top: -64upx;
  299. padding-bottom: 30rpx;
  300. // margin-top: 50rpx;
  301. color: #fff;
  302. .detail {
  303. width: 60px;
  304. height: 60rpx;
  305. padding: 0 20rpx;
  306. border-radius: 30px;
  307. background-color: #f7c41e;
  308. margin-right: 20rpx;
  309. text-align: center;
  310. line-height: 60rpx;
  311. font-size: 27upx;
  312. }
  313. .detailDel {
  314. width: 60px;
  315. height: 60rpx;
  316. // padding: 0 20rpx;
  317. border-radius: 30px;
  318. background-color: #ff2e31;
  319. color: white;
  320. margin-right: 20rpx;
  321. text-align: center;
  322. line-height: 60rpx;
  323. font-size: 30upx;
  324. }
  325. .solve {
  326. width: 62px;
  327. height: 60rpx;
  328. margin-right: 20rpx;
  329. border-radius: 30px;
  330. background-color: #4cb2b6;
  331. line-height: 60rpx;
  332. }
  333. /deep/ .padding-tb-sm {
  334. padding-top: 0px;
  335. padding-bottom: 10px;
  336. }
  337. .deletes {
  338. width: 62px;
  339. height: 60rpx;
  340. border-radius: 60rpx;
  341. background-color: red;
  342. color: #fff;
  343. line-height: 60rpx;
  344. }
  345. }
  346. /deep/.segmented-control__item--button {
  347. background-color: rgb(76, 178, 182) !important;
  348. }
  349. /deep/.segmented-control__item--button--active {
  350. background-color: #ffffff !important;
  351. }
  352. /deep/.uni-card {
  353. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  354. border-radius: 30rpx;
  355. }
  356. .tiantupian {
  357. width: 110rpx;
  358. height: 110rpx;
  359. position: fixed;
  360. right: 15px;
  361. bottom: 30rpx;
  362. }
  363. //列表样式
  364. .titles {
  365. font-weight: 600;
  366. margin-bottom: 10rpx;
  367. color: black;
  368. font-size: 32rpx;
  369. }
  370. /deep/ .u-form-item__body__left__content__label {
  371. font-size: 28upx !important;
  372. }
  373. .conts {
  374. max-width: 470upx;
  375. display: -webkit-box;
  376. /*弹性伸缩盒子模型显示*/
  377. -webkit-box-orient: vertical;
  378. /*排列方式*/
  379. -webkit-line-clamp: 1;
  380. /*显示文本行数*/
  381. overflow: hidden;
  382. /*溢出隐藏*/
  383. color: #274647;
  384. text-overflow: ellipsis;
  385. }
  386. .max-width {
  387. max-width: 180upx;
  388. }
  389. /deep/.u-action-sheet {
  390. overflow-y: auto;
  391. height: 1000rpx;
  392. background-color: #fff;
  393. }
  394. .example {
  395. overflow-y: auto;
  396. }
  397. </style>