浏览代码

解决冲突

Qukatie 3 周之前
父节点
当前提交
f558923948
共有 5 个文件被更改,包括 286 次插入243 次删除
  1. 9 1
      api/home/claim.js
  2. 2 2
      http/api.js
  3. 270 237
      pages/home/claim/index.vue
  4. 3 3
      pages/home/insurance/details.vue
  5. 2 0
      pages/login/index.vue

+ 9 - 1
api/home/claim.js

@@ -48,4 +48,12 @@ export function fileRemove(ids) {
 			ids
 		}
 	})
-}
+}
+
+export function deleteAppClaim(data) {
+	return http.request({
+		url: '/gubersail-shop-app/appClaim/deleteAppClaim',
+		method: 'post',
+		data: data
+	})
+}

+ 2 - 2
http/api.js

@@ -81,7 +81,7 @@ http.interceptors.response.use((response) => {
 		return response.data
 	}
 	// 服务端返回的状态码不等于200,则reject()
-	if (response.data.code !== 200) {
+	if (response.data.code !== 200 && response.data.code !== 601) {
 		console.log(response.data.code)
 
 		if (response.data.code === 400) {
@@ -166,4 +166,4 @@ http.interceptors.response.use((response) => {
 	}
 	return Promise.reject(response.data)
 })
-export default http;
+export default http;

+ 270 - 237
pages/home/claim/index.vue

@@ -1,254 +1,287 @@
 <template>
-	<view class="container">
-		<view style="background-color: #fff;">
-			<uni-search-bar bgColor="#F6F6F6 " v-model="searchValue" placeholder="请输入保单信息" @confirm="searchChange"
-				cancelButton="none" @clear="searchChange">
-			</uni-search-bar>
-		</view>
-		<z-paging ref="paging" v-model="dataList" @query="getList" :fixed="false" :auto-show-back-to-top="true"
-			:empty-view-text="'暂无数据'" :hide-empty-view="false" :auto-show-system-loading="true"
-			class="z-paging-container">
-			<view class="list" v-for="(item, index) in dataList" :key="index">
-				<uni-swipe-action style="margin-top: 30rpx;">
-					<uni-swipe-action-item>
-						<view class="tab-bar-item" @click="inEdit(item)">
-							<view class="list-item">
-								<view style="font-weight: 800;">
-									{{item.claimNo}}
-								</view>
-								<view style="color: #B5B4B4;">
-									{{item.submitTime}}
-								</view>
-							</view>
-							<view class="list-item">
-								<view style="font-weight: 800;color: #03803B;">
-									{{item.vehicleNumber||'暂无车牌'}}
-								</view>
-								<view class="">
-									轮胎规格: {{item.tyreSpecs||'-'}}
-								</view>
-							</view>
-							<view class="list-item-end">
-								<view class="">
-									轮胎:{{item.tireQuantity||0}}条
-								</view>
-								<view style="display: flex;align-items: center;color: #03803B;">
-									<image style="width: 32rpx;height: 32rpx;margin-right: 18rpx;"
-										src="@/static/images/home/insurance/ap.png" />
-									<text v-if="item.auditStatus==0" style="color:#e6a23c">
-										待审核
-									</text>
-									<text v-if="item.auditStatus==1" style="color:#409EFF">
-										审核中
-									</text>
-									<text v-if="item.auditStatus==2" style="color:#67c23a">
-										已通过
-									</text>
-									<text v-if="item.auditStatus==3" style="color:#f56c6c">
-										已拒绝
-									</text>
-								</view>
-							</view>
-						</view>
-
-						<template v-slot:right>
-							<view @click.stop="onClick(item)"
-								style="width: 120rpx;background-color:#e43d33;display: flex;justify-content: center;align-items: center;color: #fff;">
-								<text>删除</text>
-							</view>
-						</template>
-					</uni-swipe-action-item>
-				</uni-swipe-action>
-			</view>
-		</z-paging>
-	</view>
+  <view class="container">
+    <view style="background-color: #fff">
+      <uni-search-bar
+        bgColor="#F6F6F6 "
+        v-model="searchValue"
+        placeholder="请输入保单信息"
+        @confirm="searchChange"
+        cancelButton="none"
+        @clear="searchChange"
+      >
+      </uni-search-bar>
+    </view>
+    <z-paging
+      ref="paging"
+      v-model="dataList"
+      @query="getList"
+      :fixed="false"
+      :auto-show-back-to-top="true"
+      :empty-view-text="'暂无数据'"
+      :hide-empty-view="false"
+      :auto-show-system-loading="true"
+      class="z-paging-container"
+    >
+      <view class="list">
+        <uni-swipe-action>
+          <uni-swipe-action-item
+            v-for="(item, index) in dataList"
+            :key="index"
+            :right-options="rightOption"
+            :disabled="isSwipeDisabled(item)"
+            @click="handleDelete(item, index)"
+          >
+            <view class="tab-bar-item" @click="inEdit(item)">
+              <view class="list-item">
+                <view style="font-weight: 800">{{ item.claimNo }}</view>
+                <view style="color: #b5b4b4">{{ item.submitTime }}</view>
+              </view>
+              <view class="list-item">
+                <view style="font-weight: 800; color: #03803b">{{
+                  item.vehicleNumber || "暂无车牌"
+                }}</view>
+                <view>轮胎规格: {{ item.tyreSpecs || "-" }}</view>
+              </view>
+              <view class="list-item-end">
+                <view>轮胎:{{ item.tireQuantity || 0 }}条</view>
+                <view
+                  style="display: flex; align-items: center; color: #03803b"
+                >
+                  <image
+                    style="width: 32rpx; height: 32rpx; margin-right: 18rpx"
+                    src="@/static/images/home/insurance/ap.png"
+                  />
+                  <text v-if="item.auditStatus == 0" style="color: #e6a23c"
+                    >待审核</text
+                  >
+                  <text v-if="item.auditStatus == 1" style="color: #409eff"
+                    >审核中</text
+                  >
+                  <text v-if="item.auditStatus == 2" style="color: #67c23a"
+                    >已通过</text
+                  >
+                  <text v-if="item.auditStatus == 3" style="color: #f56c6c"
+                    >已拒绝</text
+                  >
+                </view>
+              </view>
+            </view>
+          </uni-swipe-action-item>
+        </uni-swipe-action>
+      </view>
+    </z-paging>
+  </view>
 </template>
 
 <script>
-	import {
-		getList,
-		revokeApproval
-	} from '@/api/home/claim.js'
-	export default {
-		data() {
-			return {
-				searchValue: "",
-				dataList: [],
-			}
-		},
-		onLoad() {},
-		onShow() {
-			if (uni.getStorageSync('isUpdate')) {
-				this.$nextTick(() => {
-					if (this.$refs.paging) {
-						this.$refs.paging.reload();
-					}
-				});
-				uni.removeStorageSync('isUpdate')
-			}
-		},
-		filters: {
-			statusMap(value) {
-				const statusList = ['待审核', '审核中', '已通过', '已拒绝']
-				return statusList[value] || '未知状态'
-			}
-		},
-		methods: {
-			onClick(row) {
-				if(row.auditStatus!=0){
-					uni.showToast({
-						title: '非待审核状态不允许删除',
-						icon: 'none',
-						duration: 2000
-					});
-					return
-				}
-				let _this = this
-				uni.showModal({
-					title: '提示',
-					content: '是否确认删除?',
-					success: function(res) {
-						if (res.confirm) {
-							let obj = {
-								id: row.id
-							}
-							uni.showLoading({
-								title: '加载中',
-								mask: true
-							});
-							revokeApproval(obj).then(res => {
-									uni.showToast({
-										title: '操作成功',
-										icon: 'none',
-										duration: 2000
-									});
-									_this.$refs.paging.reload();
-								})
-								.finally(() => {
-									uni.hideLoading()
-								});
-						}
-					}
-				});
-			},
-			addDetails() {
-				uni.navigateTo({
-					url: '/pages/home/claim/details'
-				});
-			},
-			inEdit(row) {
-				uni.navigateTo({
-					url: '/pages/home/claim/details?id=' + row.id,
-				});
-			},
-			searchChange() {
-				this.$refs.paging.reload()
-			},
-			async getList(pageNo, pageSize) {
-				try {
-					const obj = {
-						current: pageNo,
-						size: pageSize,
-						claimType: 2,
-						searchCriteria: this.searchValue
-					}
-					const res = await getList(obj)
-					this.$refs.paging.complete(res.data.records)
-				} catch (e) {
-					this.$refs.paging.complete(false)
-					uni.showToast({
-						title: '加载失败',
-						icon: 'none'
-					})
-				}
-			},
-			goBack() {
-				uni.navigateBack({
-					delta: 1,
-				});
-			}
-		}
-	}
+import { getList, deleteAppClaim } from "@/api/home/claim.js";
+export default {
+  data() {
+    return {
+      searchValue: "",
+      dataList: [],
+      rightOption: [{ text: "删除", style: { backgroundColor: "#f56c6c" } }],
+    };
+  },
+  onLoad() {
+    // this.getList(1, 10);
+  },
+  onShow() {
+    console.info("1111111");
+    if (uni.getStorageSync("isUpdate")) {
+      this.$nextTick(() => {
+        if (this.$refs.paging) {
+          this.$refs.paging.reload();
+        }
+      });
+      uni.removeStorageSync("isUpdate");
+    }
+  },
+  filters: {
+    statusMap(value) {
+      const statusList = ["待审核", "审核中", "已通过", "已拒绝"];
+      return statusList[value] || "未知状态";
+    },
+  },
+  methods: {
+    onClick(row) {
+      if (row.auditStatus != 0) {
+        uni.showToast({
+          title: "非待审核状态不允许删除",
+          icon: "none",
+          duration: 2000,
+        });
+        return;
+      }
+      let _this = this;
+      uni.showModal({
+        title: "提示",
+        content: "是否确认删除?",
+        success: function (res) {
+          if (res.confirm) {
+            let obj = {
+              id: row.id,
+            };
+            uni.showLoading({
+              title: "加载中",
+              mask: true,
+            });
+            revokeApproval(obj)
+              .then((res) => {
+                uni.showToast({
+                  title: "操作成功",
+                  icon: "none",
+                  duration: 2000,
+                });
+                _this.$refs.paging.reload();
+              })
+              .finally(() => {
+                uni.hideLoading();
+              });
+          }
+        },
+      });
+    },
+    addDetails() {
+      uni.navigateTo({
+        url: "/pages/home/claim/details",
+      });
+    },
+    inEdit(row) {
+      uni.navigateTo({
+        url: "/pages/home/claim/details?id=" + row.id,
+      });
+    },
+    searchChange() {
+      this.$refs.paging.reload();
+    },
+    async getList(pageNo, pageSize) {
+      try {
+        const obj = {
+          current: pageNo,
+          size: pageSize,
+          claimType: 2,
+          searchCriteria: this.searchValue,
+        };
+        const res = await getList(obj);
+        this.$refs.paging.complete(res.data.records);
+      } catch (e) {
+        this.$refs.paging.complete(false);
+        uni.showToast({
+          title: "加载失败",
+          icon: "none",
+        });
+      }
+    },
+    goBack() {
+      uni.navigateBack({
+        delta: 1,
+      });
+    },
+    handleDelete(item, index) {
+      console.info(item, index);
+      if (this.isSwipeDisabled(item)) {
+        return;
+      }
+      uni.showModal({
+        title: "提示",
+        content: "确定要删除该保单记录吗?",
+        success: async (res) => {
+          if (res.confirm) {
+            deleteAppClaim(item).then((res) => {
+              console.info(res);
+              uni.showToast({ title: res.msg, icon: "success" });
+              this.getList(1, 10);
+            });
+          }
+        },
+      });
+    },
+    isSwipeDisabled(item) {
+      return item.auditStatus === 1 || item.auditStatus === 2;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.z-paging-container {
-		width: 100%;
-		height: 100vh;
-		background: transparent;
-	}
+.z-paging-container {
+  width: 100%;
+  height: 100vh;
+  background: transparent;
+}
 
-	.scroll-view {
-		flex: 1;
-		height: 100%;
-		/* 关键样式:防止内容被裁剪 */
-		overflow-anchor: none;
-	}
+.scroll-view {
+  flex: 1;
+  height: 100%;
+  /* 关键样式:防止内容被裁剪 */
+  overflow-anchor: none;
+}
 
-	.container {
-		height: 100vh;
-		display: flex;
-		flex-direction: column;
-	}
+.container {
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+}
 
-	.loading,
-	.no-more {
-		text-align: center;
-		padding: 20px;
-		color: #999;
-	}
+.loading,
+.no-more {
+  text-align: center;
+  padding: 20px;
+  color: #999;
+}
 
-	.uni-lastmsg {
-		width: 80rpx;
-		white-space: nowrap;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: block;
-		/* 需明确设置display */
-	}
+.uni-lastmsg {
+  width: 80rpx;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: block;
+  /* 需明确设置display */
+}
 
-	.uni-lastmsg2 {
-		width: 140rpx;
-		white-space: nowrap;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: block;
-		/* 需明确设置display */
-	}
+.uni-lastmsg2 {
+  width: 140rpx;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: block;
+  /* 需明确设置display */
+}
 
-	.nav-right {
-		width: 37rpx;
-		height: 42rpx;
-	}
+.nav-right {
+  width: 37rpx;
+  height: 42rpx;
+}
 
-	.list {
-		width: 100%;
+.list {
+  width: 100%;
 
-		.tab-bar-item {
-			background-color: #fff;
-			margin-top: 30rpx;
-			padding: 0rpx 62rpx;
-			font-size: 28rpx;
-			line-height: 32rpx;
-			color: #5F5F5F;
-			font-weight: 400;
+  .tab-bar-item {
+    background-color: #fff;
+    margin-top: 30rpx;
+    padding: 0rpx 62rpx;
+    font-size: 28rpx;
+    line-height: 32rpx;
+    color: #5f5f5f;
+    font-weight: 400;
 
-			.list-item {
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-				width: 100%;
-				height: 100rpx;
-				border-bottom: 2px solid #F6F6F6;
-			}
+    .list-item {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      width: 100%;
+      height: 100rpx;
+      border-bottom: 2px solid #f6f6f6;
+    }
 
-			.list-item-end {
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-				width: 100%;
-				height: 100rpx;
-			}
-		}
-	}
-</style>
+    .list-item-end {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      width: 100%;
+      height: 100rpx;
+    }
+  }
+}
+</style>

+ 3 - 3
pages/home/insurance/details.vue

@@ -789,13 +789,13 @@
 							submitApproval(_this.form).then(res => {
 									setTimeout(() => {
 										uni.showToast({
-											title: '操作成功',
+											title: res.msg,
 											icon: 'none',
 											duration: 2000
 										});
 									}, 10);
 									uni.setStorageSync('isUpdate', true)
-									_this.getDetail(res.data.id)
+									_this.getDetail(res.code === 601 ? _this.form.id : res.data.id)
 								})
 								.catch(() => {
 									uni.hideLoading()
@@ -1024,4 +1024,4 @@
 		pointer-events: none !important;
 		touch-action: none !important;
 	}
-</style>
+</style>

+ 2 - 0
pages/login/index.vue

@@ -56,6 +56,8 @@
 			}
 		},
 		onLoad(options) {
+      alert(JSON.stringify(options))
+      console.info('options----', options)
 			if (options) {
 				uni.setStorageSync('QRcodeDate', options);
 			}