index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
  3. <u-tabs :list="state.tabsList" :current="state.current" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }"></u-tabs>
  4. </u-sticky>
  5. <oa-scroll
  6. customClass="scroll-height"
  7. :isSticky="true"
  8. :refresherLoad="false"
  9. :refresherLoadTitle="false"
  10. :refresherEnabled="false"
  11. :refresherEnabledTitle="false"
  12. :refresherDefaultStyle="'none'"
  13. :refresherThreshold="44"
  14. :refresherBackground="'#f5f6f7'"
  15. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  16. >
  17. <template #default>
  18. <oa-touch class="needMatter" @change="touchChange">
  19. <template #content>
  20. <u-empty v-if="classifyData.length <= 0" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
  21. <u-collapse v-else>
  22. <u-collapse-item v-for="(cl, index) in classifyData" :key="index">
  23. <template #title>
  24. <view class="collapse-header-area">
  25. <u--image class="collapse-header-area-image" src="/static/images/needMatter/icon1.png" width="13px" height="14px"></u--image>
  26. <view class="collapse-header-area-lable">
  27. <view>待办通知</view>
  28. <view>建议完成限期:</view>
  29. <view style="color: #666666">{{ cl.reformId }}</view>
  30. </view>
  31. <view class="collapse-header-area-value">
  32. <view
  33. :style="{
  34. color:
  35. cl.reformStatus == 1
  36. ? '#0887F8'
  37. : cl.reformStatus == 2
  38. ? '#23DEDC'
  39. : cl.reformStatus == 3
  40. ? '#16BF00'
  41. : cl.reformStatus == 4
  42. ? '#F94343'
  43. : cl.reformStatus == 5
  44. ? '#9D40F3'
  45. : '',
  46. }"
  47. >
  48. {{
  49. cl.reformStatus == 1
  50. ? "已接收"
  51. : cl.reformStatus == 2
  52. ? "进行中"
  53. : cl.reformStatus == 3
  54. ? "待办完成"
  55. : cl.reformStatus == 4
  56. ? "审核不通过"
  57. : cl.reformStatus == 5
  58. ? "审核通过"
  59. : ""
  60. }}
  61. </view>
  62. <view style="text-align: left">{{ cl.limitTime }}</view>
  63. <view style="color: #666666">{{ cl.sendTime }}</view>
  64. </view>
  65. </view>
  66. </template>
  67. <view class="collapse-center-area">
  68. <view class="tableType1 mb10">
  69. <u-row>
  70. <u-col span="2">
  71. <view>序号</view>
  72. </u-col>
  73. <u-col span="5.5">
  74. <view>待办项</view>
  75. </u-col>
  76. <u-col span="4.5">
  77. <view>原因</view>
  78. </u-col>
  79. </u-row>
  80. <u-row v-for="(co, index) in cl.reformPart.data" :key="index">
  81. <u-col span="2">
  82. <view>{{ index + 1 }}</view>
  83. </u-col>
  84. <u-col span="5.5">
  85. <view>{{ co.item }}</view>
  86. </u-col>
  87. <u-col span="4.5">
  88. <view>{{ co.reason }}</view>
  89. </u-col>
  90. </u-row>
  91. </view>
  92. <view class="collapse-center-area-item" v-if="cl.reformStatus == 1">
  93. <u-steps current="0" dot>
  94. <u-steps-item style="text-align: center" title="已接收" :desc="cl.sendTime ? cl.sendTime.replace(' ', '\n') : ''"> </u-steps-item>
  95. <u-steps-item style="text-align: center" title="进行中" :desc="cl.reformTime ? cl.reformTime.replace(' ', '\n') : ''"></u-steps-item>
  96. <u-steps-item style="text-align: center" title="待审核" :desc="cl.reviewTime ? cl.reviewTime.replace(' ', '\n') : ''"></u-steps-item>
  97. </u-steps>
  98. <view class="collapse-center-area-item-child">
  99. <u-button type="primary" text="去整改" shape="circle" @click="handleSubmit(cl, '去整改')" customStyle="width: 60px; height: 23px"></u-button>
  100. </view>
  101. </view>
  102. <view class="collapse-center-area-item" v-if="cl.reformStatus == 2">
  103. <u-steps current="1" dot>
  104. <u-steps-item style="text-align: center" title="已接收" :desc="cl.sendTime ? cl.sendTime.replace(' ', '\n') : ''"> </u-steps-item>
  105. <u-steps-item style="text-align: center" title="进行中" :desc="cl.reformTime ? cl.reformTime.replace(' ', '\n') : ''"></u-steps-item>
  106. <u-steps-item style="text-align: center" title="待审核" :desc="cl.reviewTime ? cl.reviewTime.replace(' ', '\n') : ''"></u-steps-item>
  107. </u-steps>
  108. <view class="collapse-center-area-item-child">
  109. <u-button type="primary" text="填报" shape="circle" @click="handleSubmit(cl, '填报')" customStyle="width: 60px; height: 23px"></u-button>
  110. </view>
  111. </view>
  112. <view class="collapse-center-area-item" v-if="cl.reformStatus == 3">
  113. <u-steps current="1" dot>
  114. <u-steps-item style="text-align: center" title="已接收" :desc="cl.sendTime ? cl.sendTime.replace(' ', '\n') : ''"> </u-steps-item>
  115. <u-steps-item style="text-align: center" title="待办完成" :desc="cl.reformTime ? cl.reformTime.replace(' ', '\n') : ''"></u-steps-item>
  116. <u-steps-item style="text-align: center" title="待审核" :desc="cl.reviewTime ? cl.reviewTime.replace(' ', '\n') : ''"></u-steps-item>
  117. </u-steps>
  118. </view>
  119. <view class="collapse-center-area-item" v-if="cl.reformStatus == 4">
  120. <u-steps current="2" dot>
  121. <u-steps-item style="text-align: center" title="已接收" :desc="cl.sendTime ? cl.sendTime.replace(' ', '\n') : ''"> </u-steps-item>
  122. <u-steps-item style="text-align: center" title="待办完成" :desc="cl.reformTime ? cl.reformTime.replace(' ', '\n') : ''"></u-steps-item>
  123. <u-steps-item style="text-align: center" title="审核不通过" :desc="cl.reviewTime ? cl.reviewTime.replace(' ', '\n') : ''" error></u-steps-item>
  124. </u-steps>
  125. <view class="collapse-center-area-item-child">
  126. <view>备注:{{ cl.reviewRemark ? cl.reviewRemark : "无" }}</view>
  127. </view>
  128. <view class="collapse-center-area-item-child">
  129. <u-button type="primary" text="去整改" shape="circle" @click="handleSubmit(cl, '去整改')" customStyle="width: 60px; height: 23px"></u-button>
  130. </view>
  131. </view>
  132. <view class="collapse-center-area-item" v-if="cl.reformStatus == 5">
  133. <u-steps current="2" dot>
  134. <u-steps-item style="text-align: center" title="已接收" :desc="cl.sendTime ? cl.sendTime.replace(' ', '\n') : ''"> </u-steps-item>
  135. <u-steps-item style="text-align: center" title="待办完成" :desc="cl.reformTime ? cl.reformTime.replace(' ', '\n') : ''"></u-steps-item>
  136. <u-steps-item style="text-align: center" title="审核通过" :desc="cl.reviewTime ? cl.reviewTime.replace(' ', '\n') : ''"></u-steps-item>
  137. </u-steps>
  138. <view class="collapse-center-area-item-child">
  139. <view style="display: flex">
  140. <view style="white-space: nowrap">整改资料:</view>
  141. <view style="width: 100%">
  142. <view style="display: flex" v-for="(i, index) in 5" :key="index">
  143. <view>{{ cl["reformPathName" + (index + 1)] }}</view>
  144. <!-- <view style="margin: auto 0 auto auto">
  145. <u--image src="/static/images/needMatter/icon2.png" width="15px" height="15px"></u--image>
  146. </view> -->
  147. </view>
  148. </view>
  149. </view>
  150. <u-line style="margin: 5px 0" color="#E5E5E5"></u-line>
  151. <view>备注:{{ cl.reviewRemark ? cl.reviewRemark : "无" }}</view>
  152. </view>
  153. </view>
  154. </view>
  155. </u-collapse-item>
  156. </u-collapse>
  157. <view>
  158. <u-modal
  159. :show="state.modalShow"
  160. title="填报(火灾报警系统)"
  161. :showCancelButton="true"
  162. :showConfirmButton="true"
  163. :closeOnClickOverlay="true"
  164. @close="state.modalShow = false"
  165. @cancel="state.modalShow = false"
  166. @confirm="handleConfirm"
  167. >
  168. <view style="width: 100%">
  169. <uni-section class="block mb20" title="图片上传:" type="line">
  170. <u-upload :fileList="state.fileList" name="6" @afterRead="afterRead" multiple :maxCount="5" width="80" height="80"> </u-upload>
  171. </uni-section>
  172. <uni-section class="block mb20" title="备注:" type="line">
  173. <u-textarea v-model="state.textValue" placeholder="请输入内容"></u-textarea>
  174. </uni-section>
  175. </view>
  176. </u-modal>
  177. </view>
  178. </template>
  179. </oa-touch>
  180. </template>
  181. </oa-scroll>
  182. </template>
  183. <script setup>
  184. /*----------------------------------依赖引入-----------------------------------*/
  185. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  186. import { ref, toRefs, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance } from "vue";
  187. /*----------------------------------接口引入-----------------------------------*/
  188. import { mobileScheduleList, updateMobileReformStatus, uploadAvatar, addReformMaterial } from "@/api/business/mhxf/needMatter";
  189. /*----------------------------------组件引入-----------------------------------*/
  190. /*----------------------------------store引入-----------------------------------*/
  191. import { useStores, commonStores } from "@/store/modules/index";
  192. /*----------------------------------公共方法引入-----------------------------------*/
  193. /*----------------------------------公共变量-----------------------------------*/
  194. const { proxy } = getCurrentInstance();
  195. const useStore = useStores();
  196. const commonStore = commonStores(); //全局公共Store
  197. /*----------------------------------变量声明-----------------------------------*/
  198. const state = reactive({
  199. current: 0,
  200. classifyData: [],
  201. modalShow: false,
  202. arrList: {},
  203. fileList: [],
  204. textValue: "",
  205. tabsList: [
  206. { id: 0, name: "全部" },
  207. { id: 1, name: "已接收" },
  208. { id: 2, name: "进行中" },
  209. { id: 3, name: "待办完成" },
  210. { id: 4, name: "审核不通过" },
  211. { id: 5, name: "审核通过" },
  212. ],
  213. });
  214. const { classifyData } = toRefs(state);
  215. /**
  216. * @填报
  217. * @去整改
  218. */
  219. function handleSubmit(el, type) {
  220. if (type === "去整改") {
  221. proxy.$modal.loading("加载中");
  222. updateMobileReformStatus({ reformId: el.reformId }).then((res) => {
  223. if (res.status === "SUCCESS") {
  224. goSearch();
  225. proxy.$modal.closeLoading();
  226. }
  227. });
  228. } else if (type === "填报") {
  229. state.arrList = el;
  230. state.fileList = [];
  231. state.textValue = "";
  232. state.modalShow = true;
  233. }
  234. }
  235. /**
  236. * @填报
  237. * @提交按钮点击事件
  238. */
  239. function handleConfirm() {
  240. proxy.$modal.loading("加载中");
  241. let params = {
  242. reformId: state.arrList.reformId, //整改单编号
  243. reformPerson: useStore.nickName, //整改提交人
  244. reformRemark: state.textValue, //整改备注
  245. reformPath1: "", //整改相关图片或文件路径1
  246. reformPath2: "", //整改相关图片或文件路径2
  247. reformPath3: "", //整改相关图片或文件路径3
  248. reformPath4: "", //整改相关图片或文件路径4
  249. reformPath5: "", //整改相关图片或文件路径5
  250. };
  251. state.fileList.forEach((el, index) => {
  252. params[`reformPath${index + 1}`] = el.url;
  253. });
  254. addReformMaterial(params).then((res) => {
  255. if (res.status === "SUCCESS") {
  256. proxy.$modal.closeLoading();
  257. proxy.$modal.msgSuccess("提交成功");
  258. state.modalShow = false;
  259. goSearch();
  260. }
  261. });
  262. }
  263. /**
  264. * @图片上传成功回调
  265. */
  266. function afterRead(event) {
  267. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  268. let lists = [].concat(event.file);
  269. let fileListLen = [`fileList${event.name}`].length;
  270. lists.map((item) => {
  271. [`fileList${event.name}`].push({
  272. ...item,
  273. status: "uploading",
  274. message: "上传中",
  275. });
  276. });
  277. for (let i = 0; i < lists.length; i++) {
  278. const result = uploadFilePromise(lists[i]);
  279. let item = [`fileList${event.name}`][fileListLen];
  280. [`fileList${event.name}`].splice(
  281. fileListLen,
  282. 1,
  283. Object.assign(item, {
  284. status: "success",
  285. message: "",
  286. url: result,
  287. })
  288. );
  289. fileListLen++;
  290. }
  291. }
  292. /**
  293. * @调用上传图片接口
  294. */
  295. function uploadFilePromise(el) {
  296. let data = { name: "file", filePath: el.url };
  297. uploadAvatar(data).then((res) => {
  298. state.fileList.push(res.data);
  299. });
  300. }
  301. /**
  302. * @滑动change事件
  303. */
  304. function touchChange(e) {
  305. if (e == "右滑") {
  306. if (state.current >= 1) {
  307. state.current--;
  308. } else {
  309. state.current = state.tabsList.length - 1;
  310. }
  311. goSearch();
  312. } else if (e == "左滑") {
  313. if (state.current < state.tabsList.length - 1) {
  314. state.current++;
  315. } else {
  316. state.current = 0;
  317. }
  318. goSearch();
  319. }
  320. }
  321. /**
  322. * @tabs点击事件
  323. */
  324. function tabsClick(e) {
  325. state.current = e.index;
  326. goSearch();
  327. }
  328. /**
  329. * @列表查询
  330. */
  331. function goSearch() {
  332. classifySearch({
  333. companyId: "", // 单位Id
  334. reformId: "", //整改单编号
  335. reformStatus: state.current, //整改状态(1 已接收、2 整改中、3 整改完成、4 审核不通过、5 审核通过)
  336. pageNum: 1, //当前页
  337. pageSize: 20, //每页条数
  338. });
  339. }
  340. /**
  341. * @列表查询
  342. */
  343. async function classifySearch(params) {
  344. proxy.$modal.loading("加载中");
  345. classifyData.value = [];
  346. mobileScheduleList(params).then((res) => {
  347. if (res.status === "SUCCESS") {
  348. res.data.records.forEach((el) => {
  349. el.reformPart = JSON.parse(el.reformPart);
  350. el.limitTime = el.limitTime ? el.limitTime.split("T")[0] : "";
  351. el.reviewTime = el.reviewTime ? el.reviewTime.replace("T", " ") : "";
  352. el.reformTime = el.reformTime ? el.reformTime.replace("T", " ") : "";
  353. for (let i = 1; i <= 5; i++) {
  354. el["reformPathName" + i] =
  355. el["reformPath" + i] && el["reformPath" + i].indexOf("/") != -1 ? el["reformPath" + i].split("/")[el["reformPath" + i].split("/").length - 1] : el["reformPath" + i];
  356. }
  357. classifyData.value.push(el);
  358. });
  359. proxy.$modal.closeLoading();
  360. }
  361. });
  362. }
  363. // 自定义导航事件
  364. onNavigationBarButtonTap((e) => {
  365. if (e.float == "right") {
  366. uni.navigateTo({
  367. url: "/pages/business/zhaf/xunJian/collect/components/collectRecord",
  368. });
  369. } else {
  370. }
  371. });
  372. onLoad((options) => {
  373. goSearch();
  374. });
  375. onShow(() => {
  376. //调用系统主题颜色
  377. proxy.$settingStore.systemThemeColor([1]);
  378. });
  379. onReady(() => {});
  380. onMounted(() => {});
  381. </script>
  382. <style lang="scss">
  383. .needMatter {
  384. height: calc(100vh - 88px);
  385. .u-collapse {
  386. .u-collapse-item {
  387. background: #ffffff;
  388. margin-bottom: 10px;
  389. .collapse-header-area {
  390. display: flex;
  391. line-height: 25px;
  392. font-size: 14px;
  393. &-image {
  394. padding-top: 2px;
  395. }
  396. &-lable {
  397. padding: 0 10px;
  398. white-space: nowrap;
  399. }
  400. &-value {
  401. width: 100%;
  402. text-align: center;
  403. }
  404. }
  405. .collapse-center-area {
  406. &-item {
  407. &-child {
  408. font-size: 14px;
  409. line-height: 20px;
  410. margin-top: 10px;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. .uni-section {
  417. :deep(.uni-section-header) {
  418. padding: 12px 0px;
  419. }
  420. }
  421. }
  422. </style>