zhaoxiaohai 2 år sedan
förälder
incheckning
393a15e36e

+ 52 - 0
packageA/setclient/delete.js

@@ -0,0 +1,52 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        deletereason: "",
+    },
+
+    onLoad(options) {
+        if (options.item) this.setData({
+            ...JSON.parse(options.item)
+        })
+    },
+    onInput(e) {
+        this.setData({
+            deletereason: e.detail.value
+        })
+    },
+    handleDetele() {
+        _Http.basic({
+            "id": 20221010164402,
+            "content": {
+                ...this.data
+            }
+        }).then(res => {
+            console.log("作废", res);
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            wx.showToast({
+                title: '作废成功',
+                icon: "none"
+            })
+            getCurrentPages().forEach(v => {
+                switch (v.__route__) {
+                    //如果页面历史有详情,退出详情
+                    case 'packageA/setclient/detail':
+                        wx.navigateBack();
+                        break;
+                        //如果页面历史有列表页 刷新列表
+                    case 'packageA/setclient/index':
+                        v.setData({
+                            list: v.data.list.filter(s => s.sa_customersid != this.data.sa_customersids[0]),
+                            'content.total': v.data.content.total - 1
+                        })
+                        break;
+                }
+            });
+            wx.navigateBack();
+        })
+    }
+})

+ 4 - 0
packageA/setclient/delete.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "作废原因"
+}

+ 58 - 0
packageA/setclient/delete.scss

@@ -0,0 +1,58 @@
+.box {
+    width: 100vw;
+    padding: 20rpx 30rpx;
+    background-color: #fff;
+    box-sizing: border-box;
+
+    .title {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+
+        text {
+            color: #FF3B30;
+            margin-right: 8rpx;
+        }
+    }
+
+    .content {
+        width: 690rpx;
+        height: 200rpx;
+        background: #FFFFFF;
+        border-radius: 8rpx;
+        opacity: 1;
+        border: 2rpx solid #CCCCCC;
+        margin-top: 20rpx;
+        box-sizing: border-box;
+        padding: 20rpx;
+
+        textarea {
+            width: 100%;
+            height: 100%;
+        }
+    }
+}
+
+.footer {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    position: fixed;
+    width: 100vw;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+
+    .custom {
+        width: 156rpx;
+        height: 90rpx;
+        background: #3874F6;
+        border-radius: 8rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+        margin-right: 30rpx;
+    }
+}

+ 12 - 0
packageA/setclient/delete.wxml

@@ -0,0 +1,12 @@
+<view class="box">
+    <view class="title">
+        <text>*</text>请说明作废原因
+    </view>
+    <view class="content">
+        <textarea placeholder="请说明作废原因" value="{{deletereason}}" bindinput="onInput" />
+    </view>
+</view>
+
+<view class="footer">
+    <van-button custom-class='custom' deletereason disabled='{{!deletereason}}' bindclick="handleDetele">提交</van-button>
+</view>