progress.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <template>
  2. <view class="page-container">
  3. <!-- 承包信息卡片 -->
  4. <view class="card info-card">
  5. <view class="card-header">
  6. <text class="card-title">承包信息</text>
  7. </view>
  8. <view class="info-grid">
  9. <view class="info-row">
  10. <view class="info-label">承包方姓名</view>
  11. <view class="info-value">{{ cbfInfo.cbfmc }}</view>
  12. </view>
  13. <view class="info-row">
  14. <view class="info-label">证件号码</view>
  15. <view class="info-value">{{ cbfInfo.cbfzjhm }}</view>
  16. </view>
  17. <view class="info-row-group">
  18. <view class="info-col">
  19. <view class="info-label">家庭人口</view>
  20. <view class="info-value">{{ cbfInfo.cbfcysl }} 人</view>
  21. </view>
  22. <view class="info-col">
  23. <view class="info-label">地块数量</view>
  24. <view class="info-value">{{ dkNumber }} 块</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 上报进度区域 -->
  30. <view class="card progress-card">
  31. <view class="card-header">
  32. <text class="card-title">上报进度</text>
  33. </view>
  34. <view class="progress-container">
  35. <!-- 农户上报 -->
  36. <view class="progress-step">
  37. <view class="step-node-box">
  38. <view class="step-node done">
  39. <text class="icon">✓</text>
  40. </view>
  41. <view class="step-line done"></view>
  42. </view>
  43. <view class="step-content">
  44. <view class="step-head">
  45. <view class="step-name">农户上报</view>
  46. <view class="step-tag done">已上报</view>
  47. </view>
  48. <view class="step-desc">已完成电子签名</view>
  49. <button class="view-sign-btn" @click="handleStepBtn('查看签名')">
  50. 查看签名
  51. </button>
  52. </view>
  53. </view>
  54. <!-- 村干部审核 -->
  55. <view class="progress-step">
  56. <view class="step-node-box">
  57. <view class="step-node" :class="villageOfficialStatus.nodeClass">
  58. <text class="icon" v-if="villageOfficialStatus.icon">✓</text>
  59. <text class="icon" v-else>×</text>
  60. </view>
  61. <view class="step-line" :class="villageOfficialStatus.lineClass"></view>
  62. </view>
  63. <view class="step-content">
  64. <view class="step-head">
  65. <view class="step-name">村干部审核</view>
  66. <view class="step-tag" :class="villageOfficialStatus.tagClass">
  67. {{ villageOfficialStatus.text }}
  68. </view>
  69. </view>
  70. <view class="item-group" v-if="progressData.dkApprovalList.length">
  71. <view class="group-title">地块审核</view>
  72. <view class="item" v-for="(item, idx) in progressData.dkApprovalList" :key="idx">
  73. <view class="item-left">
  74. <text>地块编号:{{ item.data.dkbm }}</text>
  75. </view>
  76. <text :class="getCGBDkStatusClass(item.data.status)">
  77. {{ getDkStatusText(item.data.status) }}
  78. </text>
  79. </view>
  80. </view>
  81. <view class="item-group" v-if="progressData.jtcyApprovalList.length">
  82. <view class="group-title">家庭成员审核</view>
  83. <view class="item" v-for="(item, idx) in progressData.jtcyApprovalList" :key="idx">
  84. <view class="item-left">
  85. <text>姓名:{{ item.data.cyxm }}</text>
  86. <text>理由:{{ item.data.changeReason }}</text>
  87. </view>
  88. <text :class="getCGBJtcyStatusClass(item.data.status)">
  89. {{ getCGBJtcyStatusText(item.data.status) }}
  90. </text>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <!-- 内业处理 -->
  96. <view class="progress-step" v-if="progressData.internalDkList.length">
  97. <view class="step-node-box">
  98. <view class="step-node" :class="internalStatus.nodeClass">
  99. <text class="icon" v-if="internalStatus.icon">✓</text>
  100. <text class="icon" v-else>×</text>
  101. </view>
  102. </view>
  103. <view class="step-content">
  104. <view class="step-head">
  105. <view class="step-name">内业处理</view>
  106. <view class="step-tag" :class="internalStatus.tagClass">
  107. {{ internalStatus.text }}
  108. </view>
  109. </view>
  110. <view class="item-group">
  111. <view class="group-title">地块审核</view>
  112. <view class="item" v-for="(item, idx) in progressData.internalDkList" :key="idx">
  113. <view class="item-left">
  114. <text>地块编号:{{ item.data.dkbm }}</text>
  115. </view>
  116. <text :class="getDkStatusClass(item.data.status)">
  117. {{ getDkStatusText(item.data.status) }}
  118. </text>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. <!-- 底部按钮 -->
  126. <view class="bottom-bar">
  127. <button class="action-btn" :class="hasRejected ? 'reject-btn' : 'normal-btn'" @click="handleActionBtn">
  128. {{ hasRejected ? '重新上报' : '查看当前详情' }}
  129. </button>
  130. </view>
  131. </view>
  132. </template>
  133. <script setup>
  134. import { ref, computed } from 'vue';
  135. import { onLoad } from '@dcloudio/uni-app';
  136. import { getCbfdkxxNumberData } from '@/api/farmerApi.js';
  137. const cbfInfo = ref({});
  138. const dkNumber = ref(0);
  139. const progressData = ref({
  140. dkApprovalList: [],
  141. jtcyApprovalList: [],
  142. internalDkList: []
  143. });
  144. const hasRejected = computed(() => {
  145. const dkRejected = progressData.value.dkApprovalList.some(i => i.data?.status === 4);
  146. const jtcyRejected = progressData.value.jtcyApprovalList.some(i => i.data?.status === 3);
  147. return dkRejected || jtcyRejected;
  148. });
  149. onLoad((options) => {
  150. try {
  151. cbfInfo.value = JSON.parse(decodeURIComponent(options.groupInfo || '{}'));
  152. const raw = JSON.parse(decodeURIComponent(options.index || '{}'));
  153. progressData.value.dkApprovalList = raw.dkApprovalList || [];
  154. progressData.value.jtcyApprovalList = raw.jtcyApprovalList || [];
  155. progressData.value.internalDkList = raw.dkApprovalList || [];
  156. if (cbfInfo.value.cbfbm) {
  157. getCbfdkNumberData(cbfInfo.value.cbfbm);
  158. }
  159. } catch (err) {
  160. console.error('参数解析失败', err);
  161. }
  162. });
  163. const villageOfficialStatus = computed(() => {
  164. const { dkApprovalList, jtcyApprovalList } = progressData.value;
  165. const allDkPass = dkApprovalList.every(i => i.data?.status === 2);
  166. const jtcyOk = jtcyApprovalList.length === 0 || jtcyApprovalList.every(i => i.data?.status === 2);
  167. const allJtcyReject = jtcyApprovalList.length > 0 && jtcyApprovalList.every(i => i.data?.status === 3);
  168. if (allDkPass && jtcyOk) return {
  169. nodeClass: 'done',
  170. lineClass: 'done',
  171. icon: true,
  172. text: '已通过',
  173. tagClass: 'done'
  174. };
  175. if (allJtcyReject) return {
  176. nodeClass: 'reject',
  177. lineClass: '',
  178. icon: false,
  179. text: '已驳回',
  180. tagClass: 'reject'
  181. };
  182. return {
  183. nodeClass: 'pending',
  184. lineClass: '',
  185. icon: false,
  186. text: '审核中',
  187. tagClass: 'pending'
  188. };
  189. });
  190. const internalStatus = computed(() => {
  191. const list = progressData.value.internalDkList;
  192. if (!list.length) return { nodeClass: 'pending', icon: false, text: '待处理', tagClass: 'pending' };
  193. const pass = list.every(i => i.data?.status === 3);
  194. const reject = list.every(i => i.data?.status === 4);
  195. if (pass) return { nodeClass: 'done', icon: true, text: '已通过', tagClass: 'done' };
  196. if (reject) return { nodeClass: 'reject', icon: false, text: '已驳回', tagClass: 'reject' };
  197. return { nodeClass: 'pending', icon: false, text: '处理中', tagClass: 'pending' };
  198. });
  199. function getCGBJtcyStatusText(s) {
  200. return { 0: '暂存', 1: '待审核', 2: '已通过', 3: '已驳回' }[s] || '未知';
  201. }
  202. function getDkStatusText(s) {
  203. return {
  204. 0: '暂存', 1: '待审核', 2: '待调查员审核',
  205. 3: '已通过', 4: '已驳回'
  206. }[s] || '未知';
  207. }
  208. function getCGBJtcyStatusClass(s) {
  209. return { 0: 'wait', 1: 'wait', 2: 'pass', 3: 'reject' }[s] || '';
  210. }
  211. function getDkStatusClass(s) {
  212. return { 0: 'wait', 1: 'wait', 2: 'wait', 3: 'pass', 4: 'reject' }[s] || '';
  213. }
  214. function getCGBDkStatusClass(s) {
  215. return { 0: 'wait', 1: 'wait', 2: 'progress', 3: 'pass', 4: 'reject' }[s] || '';
  216. }
  217. async function getCbfdkNumberData(cbfbm) {
  218. uni.showLoading({ title: '加载中...' });
  219. try {
  220. const res = await getCbfdkxxNumberData({ cbfbm });
  221. dkNumber.value = res.data?.length || 0;
  222. } catch (e) {
  223. uni.showToast({ title: '加载失败', icon: 'none' });
  224. } finally {
  225. uni.hideLoading();
  226. }
  227. }
  228. const handleStepBtn = (t) => {
  229. if (t === '查看签名') uni.showModal({ title: '签名详情', content: '展示电子签名', showCancel: false });
  230. };
  231. const handleActionBtn = () => {
  232. if (hasRejected.value) {
  233. uni.navigateTo({
  234. url: `/pages/Escalation/index?groupInfo=${encodeURIComponent(JSON.stringify(cbfInfo.value))}`
  235. });
  236. } else {
  237. uni.navigateTo({
  238. url: `/pages/investigator/Households/currentDetails?groupInfo=${encodeURIComponent(JSON.stringify(cbfInfo.value))}`
  239. });
  240. }
  241. };
  242. </script>
  243. <style scoped>
  244. /* 全局容器 */
  245. .page-container {
  246. padding: 20rpx;
  247. background: #f7f8fa;
  248. /* min-height: 100vh;
  249. padding-bottom: 140rpx; */
  250. }
  251. /* 卡片风格 */
  252. .card {
  253. background: #fff;
  254. border-radius: 24rpx;
  255. padding: 32rpx;
  256. margin-bottom: 24rpx;
  257. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  258. }
  259. .card-header {
  260. margin-bottom: 28rpx;
  261. }
  262. .card-title {
  263. font-size: 34rpx;
  264. font-weight: 700;
  265. color: #1d2129;
  266. }
  267. /* 承包信息 */
  268. .info-grid {
  269. gap: 24rpx;
  270. display: flex;
  271. flex-direction: column;
  272. }
  273. .info-row {
  274. display: flex;
  275. justify-content: space-between;
  276. align-items: center;
  277. padding: 12rpx 0;
  278. border-bottom: 1rpx solid #f2f3f5;
  279. }
  280. .info-row-group {
  281. display: flex;
  282. justify-content: space-between;
  283. padding-top: 12rpx;
  284. }
  285. .info-col {
  286. flex: 1;
  287. }
  288. .info-label {
  289. font-size: 26rpx;
  290. color: #86909c;
  291. margin-bottom: 6rpx;
  292. }
  293. .info-value {
  294. font-size: 30rpx;
  295. color: #1d2129;
  296. font-weight: 500;
  297. }
  298. /* 进度流程 */
  299. .progress-container {
  300. position: relative;
  301. }
  302. .progress-step {
  303. display: flex;
  304. margin-bottom: 48rpx;
  305. position: relative;
  306. }
  307. .step-node-box {
  308. margin-right: 32rpx;
  309. display: flex;
  310. flex-direction: column;
  311. align-items: center;
  312. position: relative;
  313. }
  314. .step-node {
  315. width: 44rpx;
  316. height: 44rpx;
  317. border-radius: 50%;
  318. display: flex;
  319. align-items: center;
  320. justify-content: center;
  321. font-size: 22rpx;
  322. font-weight: bold;
  323. z-index: 10;
  324. }
  325. .step-node.done {
  326. background: #00b42a;
  327. color: #fff;
  328. }
  329. .step-node.pending {
  330. background: #f2f3f5;
  331. color: #999;
  332. border: 2rpx solid #dcdee0;
  333. }
  334. .step-node.reject {
  335. background: #ff3333;
  336. color: #fff;
  337. }
  338. .step-line {
  339. width: 3rpx;
  340. height: 100%;
  341. background: #e5e6eb;
  342. margin-top: 8rpx;
  343. }
  344. .step-line.done {
  345. background: #00b42a;
  346. }
  347. .step-content {
  348. flex: 1;
  349. }
  350. .step-head {
  351. display: flex;
  352. align-items: center;
  353. justify-content: space-between;
  354. margin-bottom: 12rpx;
  355. }
  356. .step-name {
  357. font-size: 34rpx;
  358. font-weight: 600;
  359. color: #1d2129;
  360. }
  361. .step-tag {
  362. font-size: 24rpx;
  363. padding: 6rpx 18rpx;
  364. border-radius: 50rpx;
  365. font-weight: 500;
  366. }
  367. .step-tag.done {
  368. background: #e8ffef;
  369. color: #00b42a;
  370. }
  371. .step-tag.pending {
  372. background: #f7f8fa;
  373. color: #666;
  374. }
  375. .step-tag.reject {
  376. background: #fff1f0;
  377. color: #ff3333;
  378. }
  379. .step-desc {
  380. font-size: 26rpx;
  381. color: #888;
  382. margin-bottom: 16rpx;
  383. }
  384. .view-sign-btn {
  385. background: #f2f3f5;
  386. color: #333;
  387. font-size: 24rpx;
  388. padding: 10rpx 20rpx;
  389. border-radius: 12rpx;
  390. border: none;
  391. line-height: 1.2;
  392. }
  393. /* 子项组 */
  394. .item-group {
  395. background: #f9fafc;
  396. border-radius: 16rpx;
  397. padding: 20rpx;
  398. margin-top: 20rpx;
  399. }
  400. .group-title {
  401. font-size: 28rpx;
  402. color: #666;
  403. font-weight: 500;
  404. margin-bottom: 16rpx;
  405. }
  406. .item {
  407. display: flex;
  408. justify-content: space-between;
  409. align-items: center;
  410. padding: 14rpx 0;
  411. font-size: 26rpx;
  412. color: #333;
  413. border-bottom: 1rpx solid #eaf0fa;
  414. }
  415. .item:last-child {
  416. border-bottom: none;
  417. }
  418. .item-left {
  419. flex: 1;
  420. display: flex;
  421. flex-direction: column;
  422. gap: 6rpx;
  423. }
  424. /* 状态色 */
  425. .pass {
  426. color: #00b42a;
  427. font-weight: 600;
  428. }
  429. .wait {
  430. color: #ff7d00;
  431. font-weight: 600;
  432. }
  433. .progress {
  434. color: #1677ff;
  435. font-weight: 600;
  436. }
  437. .reject {
  438. color: #ff3333;
  439. font-weight: 600;
  440. }
  441. /* 底部按钮 */
  442. .bottom-bar {
  443. position: fixed;
  444. bottom: 0;
  445. left: 0;
  446. right: 0;
  447. padding: 20rpx;
  448. background: #fff;
  449. box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.05);
  450. }
  451. .action-btn {
  452. width: 100%;
  453. height: 88rpx;
  454. border-radius: 16rpx;
  455. font-size: 32rpx;
  456. font-weight: 500;
  457. color: #fff;
  458. border: none;
  459. }
  460. .normal-btn {
  461. background: #1677ff;
  462. }
  463. .reject-btn {
  464. background: #ff3333;
  465. }
  466. </style>