index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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. console.log(response, 'sddddddddd');
  178. })
  179. },
  180. monthChange(monthInfo) { // 切换月份
  181. console.log("切换月份", JSON.parse(JSON.stringify(monthInfo)));
  182. },
  183. shrinkClick(type) {
  184. console.log("当前状态", type);
  185. },
  186. addSign() { // 添加标记
  187. let addList = [{
  188. date: "2023-2-28",
  189. title: "休息"
  190. }, {
  191. date: "2023-2-25",
  192. title: "上班"
  193. }];
  194. // 调用 addSignList 方法,传入需要添加的标记数组
  195. this.$refs.calendar.addSignList(addList);
  196. },
  197. deleteSign() { // 删除标记
  198. let deleteList = [{
  199. date: "2023-2-28",
  200. title: "休息"
  201. }];
  202. // 调用 deleteSignList 方法,传入需要删除的标记数组
  203. this.$refs.calendar.deleteSignList(deleteList);
  204. },
  205. // ================================================================
  206. //查看详情
  207. addClickDetail(val) {
  208. this.isLoaded = false
  209. uni.navigateTo({
  210. url: `/pagesA/fire/check_active/check_list/check_list?id=${val.id}&current=${this.current}`,
  211. success: function(res) {
  212. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  213. }
  214. })
  215. },
  216. //去完成
  217. addClickModify(val) {
  218. this.isLoaded = false
  219. uni.navigateTo({
  220. url: `/pagesA/fire/check_active/check_implement/check_implement?broadId=${val.broadId}`,
  221. success: function(res) {
  222. res.eventChannel.emit('acceptDataFromOpenerPage', val);
  223. }
  224. })
  225. },
  226. //转发
  227. forward(val) { //展示转发的弹出层
  228. this.ids = val.id //当前点击任务的id
  229. this.checkboxShow2 = true
  230. this.FormDataTask.broadId = val.broadId
  231. this.FormDataTask.id = this.ids
  232. this.FormDataTask.taskName = val.taskName
  233. this.FormDataTask.taskStatus = val.taskStatus
  234. this.FormDataTask.taskContent = val.taskContent
  235. this.FormDataTask.orgId.push(val.orgId)
  236. checkGetPerson({
  237. orgId: val.orgId
  238. }).then(response => {
  239. this.personInfo = response.data
  240. })
  241. },
  242. //popup检查单位确定============
  243. checkboxConfirm2() {
  244. checkSubmitForwardTask(JSON.stringify(this.FormDataTask)).then(response => {
  245. if (response.data) {
  246. this.$modal.msg('转发成功')
  247. this.checkboxShow2 = false
  248. } else {
  249. this.$modal.msgError(response.msg)
  250. }
  251. })
  252. },
  253. //popup取消
  254. checkboxCancel2() {
  255. this.checkboxShow2 = false
  256. },
  257. // =====================================================
  258. onClick(val) {
  259. console.log('val', val);
  260. this.isLoaded = false
  261. uni.navigateTo({
  262. url: '/pagesA/fire/inspection_active/inspection_details/inspection_details?id=' + val.id,
  263. })
  264. }
  265. },
  266. // 触底的事件
  267. onReachBottom() {
  268. // 判断是否还有下一页数据
  269. if (this.formData.pageNo * this.formData.pageSize >= this.total) return;
  270. // if (this.pageNo * this.pageSize >= this.total) return uni.showToast({
  271. // title: `数据加载完毕`
  272. // })
  273. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  274. if (this.loading) return;
  275. this.formData.pageNo += 1;
  276. this.getData(this.formData.pageNo);
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .content {
  282. display: flex;
  283. flex-direction: column;
  284. align-items: center;
  285. justify-content: center;
  286. }
  287. body {
  288. background-color: #f5f7f9;
  289. }
  290. page {
  291. background-color: #f5f7f9 !important;
  292. }
  293. .uni-container {
  294. height: 100%;
  295. background-color: #f5f7f9;
  296. }
  297. ::v-deep .u-list {
  298. height: auto !important;
  299. }
  300. ::v-deep .u-list-item {
  301. background: #fff !important;
  302. margin: 0px !important;
  303. padding: 0px !important;
  304. border-radius: 12px !important;
  305. box-shadow: 0px 0px 3px 0px #FFFFFF !important;
  306. }
  307. .btn-box button {
  308. margin: 0rpx 6rpx;
  309. }
  310. //转发任务
  311. /deep/.u-checkbox__icon-wrap--square[data-v-532d01c7],
  312. /deep/.u-checkbox__icon-wrap--square.data-v-532d01c7,
  313. /deep/.u-checkbox__icon-wrap--square {
  314. //转发复选框的颜色
  315. border-color: #4CB2B6 !important;
  316. }
  317. /deep/.u-button[data-v-3bf2dba7],
  318. /deep/.u-button.data-v-3bf2dba7,
  319. /deep/.u-button {
  320. //按钮大小
  321. width: 33% !important;
  322. }
  323. /deep/ .u-checkbox-group {
  324. width: 33%;
  325. // justify-content: flex-end;
  326. }
  327. .person-forward {
  328. padding-top: 40rpx;
  329. display: flex;
  330. flex-wrap: wrap;
  331. }
  332. .conts {
  333. display: -webkit-box;
  334. -webkit-line-clamp: 2;
  335. -webkit-box-orient: vertical;
  336. overflow: hidden;
  337. text-overflow: ellipsis;
  338. }
  339. /deep/.uni-card {
  340. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  341. border-radius: 30rpx;
  342. }
  343. .content-item{
  344. width: 100%;
  345. }
  346. </style>