zhaoxiaohai 3 years ago
parent
commit
f3720b1f63

+ 30 - 5
pages/submission/details.js

@@ -1,23 +1,48 @@
-// pages/submission/details.js
+const _Http = getApp().globalData.http;
 Page({
 
     /**
      * 页面的初始数据
      */
     data: {
-
+        detailsData: {},
+        butText: false,
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-        const item = JSON.parse(options.item);
-        console.log(item)
+        console.log(options)
+        let detailsData = JSON.parse(options.item);
         this.setData({
-            detailsData: item
+            detailsData,
+            butText: options.type
+        })
+
+        console.log("是否一事一报", detailsData.oneToOne)
+
+        /* 详情计数 */
+        if (options.type == '开始提报') _Http.basic({
+            "classname": "saletool.submitedit.submitedit",
+            "method": "select_submitdetailed",
+            "content": {
+                "sat_submiteditmodelid": detailsData.sat_submiteditmodelid
+            }
+        }).then(res => {
+            console.log("提报详情", res)
         })
+    },
 
+    /* 去详情 */
+    toDetails() {
+        if (this.data.butText == '开始提报') {
+            wx.navigateTo({
+                url: './details?type=保存&item=' + JSON.stringify(this.data.detailsData),
+            })
+        } else {
+            
+        }
     },
 
     /**

+ 23 - 0
pages/submission/details.scss

@@ -5,10 +5,20 @@
     background-color: #ffffff;
 
     .title {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
         font-size: 30rpx;
         font-family: PingFang SC-Bold, PingFang SC;
         font-weight: bold;
         color: #333333;
+
+        text {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #999999;
+            font-weight: 400;
+        }
     }
 
     .time {
@@ -19,6 +29,19 @@
     }
 }
 
+/* 文本域 */
+.textarea {
+    width: 690rpx;
+    height: 160rpx;
+    background-color: #ffffff;
+    border-radius: 16rpx;
+    font-size: 24rpx !important;
+    overflow: hidden;
+    margin: 20rpx auto 30rpx;
+    padding: 20rpx;
+    box-sizing: border-box;
+}
+
 .footer {
     position: fixed;
     width: 100%;

+ 20 - 3
pages/submission/details.wxml

@@ -3,8 +3,25 @@
     <view class="time">有效期:{{detailsData.begdate}} ~ {{detailsData.enddate}}</view>
     <view class="time multi-line" style="margin-top: 10rpx;">提报要求:{{detailsData.notes}}</view>
     <view class="title" style="margin-top: 30rpx;">附件下载</view>
-    <My_accessory></My_accessory>
+    <My_accessory />
 </view>
-<view class="footer">
-    <van-button round custom-class='button'>开始提报</van-button>
+
+<!-- 提报记录 -->
+<block wx:if="{{butText=='开始提报'}}">
+    <view class="box" style="background: none;">
+        <view class="title multi-line">提报记录</view>
+    </view>
+    <My_empty />
+</block>
+
+<!-- 提报详情 -->
+<view class="box" wx:elif="{{butText=='保存'}}" style="background: none;">
+    <view class="title multi-line">提报内容</view>
+    <textarea class="textarea" placeholder="请输入提报内容" />
+    <view class="title multi-line">提报附件<text>已上传2个</text></view>
+    <My_accessory />
+</view>
+
+<view class="footer" wx:if="{{butText!='false'}}">
+    <van-button round custom-class='button' bindtap="toDetails">{{butText}}</van-button>
 </view>

+ 4 - 2
pages/submission/index.js

@@ -9,6 +9,7 @@ Page({
     data: {
         listHeight: 0,
         timeRangeShow: false,
+        activeIndex: 0,
         whereType: {
             value: "begdate",
             list: {
@@ -165,9 +166,10 @@ Page({
         const {
             item
         } = e.currentTarget.dataset;
+        item.oneToOne = this.data.activeIndex === 0;
         wx.navigateTo({
-            url: './details?item=' + JSON.stringify(item),
-        })
+            url: './details?type=保存&item=' + JSON.stringify(item),
+        })/* 开始提报 */
     },
     /**
      * 生命周期函数--监听页面初次渲染完成

+ 1 - 1
pages/submission/index.wxml

@@ -25,8 +25,8 @@
             </view>
         </view>
     </navigator>
+    <My_empty wx:if="{{!list.length}}" />
 </My_listBox>
-
 <van-action-sheet show="{{  timeRangeShow }}" bind:close='timeRangeClose'>
     <view class="detePickerHeader">
         <text catchtap="toSeeAll">所有日期</text>