Browse Source

复制工具借用单

xiaohaizhao 11 months ago
parent
commit
6f2252bb84

+ 30 - 0
packageA/borrow/detail.js

@@ -31,6 +31,36 @@ Page({
         });
         this.getDetail(true);
     },
+    onCopy() {
+        let that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确定复制该借用单',
+            complete: (a) => {
+                if (a.confirm) _Http.basic({
+                    "id": "20240315131202",
+                    "content": {
+                        "sa_orderid": that.data.sa_orderid
+                    }
+                }).then(res => {
+                    console.log("借用单复制", res)
+                    if (res.msg != '成功') return wx.showToast({
+                        title: res.msg,
+                        icon: "none"
+                    })
+                    wx.showModal({
+                        title: '提示',
+                        content: '复制成功,是否立即前往',
+                        complete: (s) => {
+                            if (s.confirm) wx.navigateTo({
+                                url: '/packageA/borrow/detail?id=' + res.data.sa_orderid,
+                            })
+                        }
+                    })
+                })
+            }
+        })
+    },
     /* 获取详情 */
     getDetail(init = false, show = true) {
         _Http.basic({

+ 12 - 0
packageA/borrow/detail.scss

@@ -1,4 +1,5 @@
 @import "./detail.skeleton.wxss";
+
 .intr {
     position: relative;
     width: 100vw;
@@ -39,6 +40,17 @@
         color: #666;
     }
 
+    .copy {
+        position: absolute;
+        top: 30rpx;
+        right: 20rpx;
+        color: #fff;
+        background-color: #3874F6;
+        padding: 14rpx 40rpx;
+        border-radius: 8rpx;
+        font-size: 24rpx;
+    }
+
 }
 
 .box {

+ 2 - 0
packageA/borrow/detail.wxml

@@ -13,6 +13,8 @@
     <view class="exp">订单状态:{{detail.status}}</view>
     <view wx:if="{{detail.sa_contractid}}" class="exp">借用套数:{{detail.toolcount}}套</view>
     <view class="exp">订单金额:{{detail.amount}}元</view>
+
+    <navigator class="copy" url="#" bind:tap="onCopy">复制</navigator>
 </view>
 <navigator url="#" class="box location" bindtap="selectConsignee">
     <van-icon custom-class='icon' name="location" />

+ 1 - 0
packageA/borrow/index.js

@@ -81,6 +81,7 @@ Page({
                         "pageTotal": 1,
                         "total": null,
                         "pageSize": 20,
+                        typemx:"合同借用",
                         "where": {
                             "condition": ""
                         }

+ 7 - 0
project.private.config.json

@@ -9,6 +9,13 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "工具借用",
+          "pathName": "packageA/borrow/detail",
+          "query": "id=55444",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "",
           "pathName": "packageA/orderForm/detail",

+ 1 - 1
utils/FormatTheAttachment.js

@@ -18,7 +18,7 @@ function fileList(list) {
         list[i].cover = `/static/image/file/unknown.png`
         const suffix = list[i].postfix.toLowerCase();
         if (suffix != "folder") {
-            for (var key in suffixList) {
+            for (let key in suffixList) {
                 if (suffixList[key].some(value => value == suffix)) {
                     list[i].fileType = key;
                     if (key == 'image') {