index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <view class="content uni-container">
  3. <view class="content-item">
  4. <!-- <lunc-calendar ref="calendar" :showLunar="true" :showMonthBg="true" :showShrink="true" :signList="signList"
  5. @dayChange="dayChange" weekType="星期" @monthChange="monthChange" @shrinkClick="shrinkClick">
  6. </lunc-calendar> -->
  7. <u-list v-if="tableDatas.length>0 && isLoaded">
  8. <!-- <u-list-item v-for="(item, index) in tableData.daySign" :key="index" @click.native="onClick(item)" link>
  9. <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  10. <uni-col :span="12"><text class="text-df ">{{ item.title }}</text></uni-col>
  11. <uni-col :span="12">
  12. <text class="justify-end flex">{{item.date}}</text>
  13. </uni-col>
  14. </uni-row>
  15. </u-list-item> -->
  16. <!-- <uni-card v-for="(item, index) in tableData.daySign" :key="index" @click="onClick(item)">
  17. <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  18. <uni-col :span="24"><text class="text-df ">{{ item.title }}</text></uni-col>
  19. </uni-row>
  20. <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  21. <uni-col :span="24">任务说明:
  22. <rich-text :nodes="item.taskContent?item.taskContent:''"
  23. class="conts"></rich-text>
  24. </uni-col>
  25. </uni-row>
  26. </uni-card> -->
  27. <uni-card v-for="(item, index) in tableDatas" :key="index">
  28. <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  29. <uni-col :span="24"><text class="text-df name-align-daily"
  30. style="font-weight:600">任务名称:</text><text>{{ item.taskName }}</text></uni-col>
  31. <uni-col :span="24" style="display: flex;"><text style="font-weight:600" class="name-align-daily">任务说明:</text><rich-text
  32. :nodes="item.taskContent?item.taskContent:''" class="conts"></rich-text>
  33. </uni-col>
  34. <uni-col :span="24"><text style="font-weight:600" class="name-align-daily">任务发布者:</text><text>{{item.senderName}}</text>
  35. </uni-col>
  36. </uni-row>
  37. <!-- <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  38. <uni-col :span="24">任务说明:{{item.taskContent}}
  39. </uni-col>
  40. </uni-row> -->
  41. <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  42. <uni-col :span="24">
  43. <view class="flex btn-box" style="width: 80%;float: right;">
  44. <u-button shape="circle" size="small" color="#F7C41E" text="查看详情"
  45. @click="addClickDetail(item.broadId)"></u-button>
  46. <u-button shape="circle" size="small" color="#4CB2B6" text="去完成"
  47. @click="addClickModify(item)"></u-button>
  48. <u-button shape="circle" size="small" color="#4CB2B6" text="转发任务"
  49. @click="forward(item)"></u-button>
  50. </view>
  51. </uni-col>
  52. </uni-row>
  53. </uni-card>
  54. </u-list>
  55. <view v-else-if="tableDatas.length==0 && isLoaded" style="text-align: center;">
  56. <view class="text-gray" style="padding-top: 20px;">
  57. <img :src="tan90" alt="暂无数据" />
  58. </view>
  59. </view>
  60. <!-- <view class="button" @click="addSign">新增标记</view>
  61. <view class="button" @click="deleteSign">修改标记</view> -->
  62. </view>
  63. <!-- 单位进来转发任务显示人员 -->
  64. <u-popup :show="checkboxShow2" :round="10" @close="checkboxShow2=false" style="position: relative;"
  65. mode="center">
  66. <view style="width: 90vw;padding: 10px;">
  67. <text class="text-xl">检查人员</text>
  68. <view class="" class="person-forward">
  69. <u-checkbox-group v-model="item.checkboxValue1" v-for="(item, index) in personInfo" :key="index"
  70. placement="column" @change="checkboxChange2(item.id,$event)">
  71. <u-checkbox :customStyle="{marginBottom: '8px'}" :label="item.nickname" :name="item.id">
  72. </u-checkbox>
  73. </u-checkbox-group>
  74. </view>
  75. <view class="flex flex-direction-row " style="margin: 30rpx 0;">
  76. <u-button shape="circle" type="primary" color="#4CB2B6" text="确定" @click="checkboxConfirm2"
  77. customStyle="margin-right:20px;padding:0 30px">
  78. </u-button>
  79. <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle" @click="checkboxCancel2"
  80. customStyle="padding:0 30px">
  81. </u-button>
  82. </view>
  83. </view>
  84. </u-popup>
  85. <!-- 加载中 -->
  86. <isLodingModel></isLodingModel>
  87. </view>
  88. </template>
  89. <script>
  90. import luncCalendar from "@/components/calendar/calendar.vue"
  91. import {
  92. getCheckActiveList,
  93. getCheckActivePendList, // 主动检查提交历史列表
  94. draftTask, //获取草稿箱任务列表
  95. taskList, //获取除草稿箱以外的列表 //获取当前日期的任务列表
  96. saveCheckRelease, //发布任务
  97. deleteTask, //删除任务
  98. addCheckActiveCompany, //获取单位
  99. checkSubmitForwardTask, //确认转发任务
  100. checkGetPerson, //单位转发任务获取人员
  101. verifytask //审核
  102. } from "@/api/check_active";
  103. import config from '@/config'
  104. const baseUrlImg = config.baseUrlImg
  105. export default {
  106. components: {
  107. luncCalendar
  108. },
  109. data() {
  110. return {
  111. tan90: `${baseUrlImg}/tan90.png`,
  112. isLoaded: false,
  113. tableData: [],
  114. is_loading: false,
  115. ids: '', //当前点击转发任务的id
  116. FormDataTask: {
  117. "broadId": 0,
  118. "deptId": [],
  119. "id": 0,
  120. "orgId": [],
  121. "sender": this.$store.state.user.id,
  122. "receiver": [],
  123. "status": 0,
  124. "taskContent": "",
  125. "taskName": "",
  126. "taskStatus": 0,
  127. "taskType": "1" //任务类型 1对应主动检查
  128. },
  129. checkboxShow2: false, //待完成转发弹窗
  130. personInfo: [], //转发任务的人员信息
  131. loading: false,
  132. tableDatas: [], //任务数据
  133. formData: {
  134. pageNo: 1,
  135. pageSize: 10,
  136. receivDate: '',
  137. receiver: this.$store.state.user.id,
  138. taskType: "3"
  139. }
  140. }
  141. },
  142. onShow() {
  143. this.tableDatas = []
  144. // this.tableD
  145. const date = new Date()
  146. this.formData.receivDate = uni.$u.timeFormat(date, 'yyyy-mm-dd')
  147. this.getData(this.formData.pageNo)
  148. },
  149. watch: {
  150. loading: {
  151. handler(newLength, oldLength) {
  152. this.$modal.isLoadingModel(this.loading)
  153. },
  154. immediate: true
  155. }
  156. },
  157. methods: {
  158. // dayChange(dayInfo) { // 点击日期
  159. // // this.is_loading=true
  160. // this.tableData = JSON.parse(JSON.stringify(dayInfo))
  161. // this.formData.receivDate = this.tableData.date
  162. // // console.log("点击日期", JSON.parse(JSON.stringify(dayInfo)));
  163. // // console.log(this.formData.receivDate,);
  164. // this.getData(this.formData.pageNo)
  165. // // uni.navigateTo({
  166. // // url: '/pagesA/fire/check_active/check_implement/check_implement',
  167. // // })
  168. // },
  169. getData(pageNo) {
  170. this.loading = true
  171. this.pageNo = pageNo
  172. taskList(JSON.stringify(this.formData)).then(response => {
  173. this.isLoaded = true
  174. this.tableDatas = [...this.tableDatas, ...response.data.list]
  175. this.loading = false
  176. // this.tableDatas = response.data.list
  177. })
  178. },
  179. monthChange(monthInfo) { // 切换月份
  180. },
  181. shrinkClick(type) {
  182. },
  183. addSign() { // 添加标记
  184. let addList = [{
  185. date: "2023-2-28",
  186. title: "休息"
  187. }, {
  188. date: "2023-2-25",
  189. title: "上班"
  190. }];
  191. // 调用 addSignList 方法,传入需要添加的标记数组
  192. this.$refs.calendar.addSignList(addList);
  193. },
  194. deleteSign() { // 删除标记
  195. let deleteList = [{
  196. date: "2023-2-28",
  197. title: "休息"
  198. }];
  199. // 调用 deleteSignList 方法,传入需要删除的标记数组
  200. this.$refs.calendar.deleteSignList(deleteList);
  201. },
  202. // ================================================================
  203. //查看详情
  204. addClickDetail(val) {
  205. this.isLoaded = false
  206. uni.navigateTo({
  207. url: `/pagesA/fire/check_active/check_list/check_list?id=${val.id}&current=${this.current}`,
  208. success: function(res) {
  209. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  210. }
  211. })
  212. },
  213. //去完成
  214. addClickModify(val) {
  215. this.isLoaded = false
  216. uni.navigateTo({
  217. url: `/pagesA/fire/check_active/check_implement/check_implement?broadId=${val.broadId}`,
  218. success: function(res) {
  219. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  220. }
  221. })
  222. },
  223. //转发
  224. forward(val) { //展示转发的弹出层
  225. this.ids = val.id //当前点击任务的id
  226. this.checkboxShow2 = true
  227. this.FormDataTask.broadId = val.broadId
  228. this.FormDataTask.id = this.ids
  229. this.FormDataTask.taskName = val.taskName
  230. this.FormDataTask.taskStatus = val.taskStatus
  231. this.FormDataTask.taskContent = val.taskContent
  232. this.FormDataTask.orgId.push(val.orgId)
  233. checkGetPerson({
  234. orgId: val.orgId
  235. }).then(response => {
  236. this.personInfo = response.data
  237. })
  238. },
  239. //popup检查单位确定============
  240. checkboxConfirm2() {
  241. checkSubmitForwardTask(JSON.stringify(this.FormDataTask)).then(response => {
  242. if (response.data) {
  243. this.$modal.msg('转发成功')
  244. this.checkboxShow2 = false
  245. } else {
  246. this.$modal.msgError(response.msg)
  247. }
  248. })
  249. },
  250. //popup取消
  251. checkboxCancel2() {
  252. this.checkboxShow2 = false
  253. },
  254. // =====================================================
  255. onClick(val) {
  256. this.isLoaded = false
  257. uni.navigateTo({
  258. url: '/pagesA/fire/inspection_active/inspection_details/inspection_details?id=' + val.id,
  259. })
  260. }
  261. },
  262. // 触底的事件
  263. onReachBottom() {
  264. // 判断是否还有下一页数据
  265. if (this.formData.pageNo * this.formData.pageSize >= this.total) return;
  266. // if (this.pageNo * this.pageSize >= this.total) return uni.showToast({
  267. // title: `数据加载完毕`
  268. // })
  269. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  270. if (this.loading) return;
  271. this.formData.pageNo += 1;
  272. this.getData(this.formData.pageNo);
  273. }
  274. }
  275. </script>
  276. <style lang="scss" scoped>
  277. .content {
  278. display: flex;
  279. flex-direction: column;
  280. align-items: center;
  281. justify-content: center;
  282. }
  283. body {
  284. background-color: #f5f7f9;
  285. }
  286. page {
  287. background-color: #f5f7f9 !important;
  288. }
  289. .uni-container {
  290. height: 100%;
  291. background-color: #f5f7f9;
  292. }
  293. ::v-deep .u-list {
  294. height: auto !important;
  295. }
  296. ::v-deep .u-list-item {
  297. background: #fff !important;
  298. margin: 0px !important;
  299. padding: 0px !important;
  300. border-radius: 12px !important;
  301. box-shadow: 0px 0px 3px 0px #FFFFFF !important;
  302. }
  303. .btn-box button {
  304. margin: 0rpx 6rpx;
  305. }
  306. //转发任务
  307. /deep/.u-checkbox__icon-wrap--square[data-v-532d01c7],
  308. /deep/.u-checkbox__icon-wrap--square.data-v-532d01c7,
  309. /deep/.u-checkbox__icon-wrap--square {
  310. //转发复选框的颜色
  311. border-color: #4CB2B6 !important;
  312. }
  313. /deep/.u-button[data-v-3bf2dba7],
  314. /deep/.u-button.data-v-3bf2dba7,
  315. /deep/.u-button {
  316. //按钮大小
  317. width: 33% !important;
  318. }
  319. /deep/ .u-checkbox-group {
  320. width: 33%;
  321. // justify-content: flex-end;
  322. }
  323. .person-forward {
  324. padding-top: 40rpx;
  325. display: flex;
  326. flex-wrap: wrap;
  327. }
  328. .conts {
  329. display: -webkit-box;
  330. -webkit-line-clamp: 2;
  331. -webkit-box-orient: vertical;
  332. overflow: hidden;
  333. text-overflow: ellipsis;
  334. }
  335. /deep/.uni-card {
  336. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  337. border-radius: 30rpx;
  338. }
  339. .content-item{
  340. width: 100%;
  341. }
  342. </style>