zhaoxiaohai 2 years ago
parent
commit
a77af43bef

+ 66 - 0
packageA/invoice/detail.js

@@ -0,0 +1,66 @@
+// packageA/invoice/detail.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
packageA/invoice/detail.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
packageA/invoice/detail.scss

@@ -0,0 +1 @@
+/* packageA/invoice/detail.wxss */

+ 2 - 0
packageA/invoice/detail.wxml

@@ -0,0 +1,2 @@
+<!--packageA/invoice/detail.wxml-->
+<text>packageA/invoice/detail.wxml</text>

+ 91 - 2
packageA/invoice/index.js

@@ -1,8 +1,97 @@
+const _Http = getApp().globalData.http;
+
 Page({
   data: {
-
+    loading: true,
+    active: "新建",
+    "content": {
+      nocache: true,
+      "pageNumber": 1,
+      "pageTotal": 1,
+      "pageSize": 20,
+      total: 0,
+      "where": {
+        "condition": "",
+      },
+      sort: []
+    },
+    filter: [{
+      label: "品牌",
+      index: null,
+      showName: "brandname", //显示字段
+      valueKey: "brandname", //返回Key
+      selectKey: "brandname", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: []
+    }, {
+      label: "领域",
+      index: null,
+      showName: "tradefield", //显示字段
+      valueKey: "tradefield", //返回Key
+      selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: []
+    }]
   },
   onLoad(options) {
-
+    this.getList(true)
+  },
+  /* 处理筛选 */
+  handleFilter({
+    detail
+  }) {
+    console.log(detail)
+  },
+  getList(init = false) {
+    if (init.detail != undefined) init = init.detail;
+    let content = this.data.content;
+    if (init) content.pageNumber = 1;
+    if (content.pageNumber > content.pageTotal) return;
+    content.where.status = this.data.active;
+    _Http.basic({
+      "id": 20221219133703,
+      "version": 1,
+      content
+    }).then(res => {
+      console.log("开票申请列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      this.setData({
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+        "content.pageNumber": res.pageNumber + 1,
+        "content.pageTotal": res.pageTotal,
+        "content.sort": res.sort,
+        "content.total": res.total,
+        loading: false
+      })
+    })
+  },
+  /* 去新增 */
+  toAdd(){
+    wx.navigateTo({
+      url: '/packageA/invoice/update'
+    })
+  },
+  /* 搜索 */
+  onSearch({
+    detail
+  }) {
+    this.setData({
+      "content.where.condition": detail
+    });
+    this.getList(true)
+  },
+  /* 切换tabs */
+  tabsChange(e) {
+    this.setData({
+      "content.status": e.detail.name
+    });
+    this.getList(true);
+  },
+  onReady() {
+    this.setListHeight()
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".total", this);
   },
 })

+ 3 - 1
packageA/invoice/index.json

@@ -1,3 +1,5 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "List": "./modules/list/index"
+  }
 }

+ 16 - 0
packageA/invoice/index.wxml

@@ -0,0 +1,16 @@
+<import src="index.skeleton.wxml" />
+<template is="skeleton" wx:if="{{loading}}" />
+<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<van-tabs active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+	<van-tab title="新建" name='新建' />
+	<van-tab title="提交" name='提交' />
+	<van-tab title="审核" name='审核' />
+</van-tabs>
+<view class="total" style="height: 20rpx;" />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<List list="{{list}}" />
+</Yl_ListBox>
+<!-- 新建浮动按钮 -->
+<Yl_FloatingButton bindtap="toAdd" />
+<!-- 筛选条件 -->
+<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />

+ 5 - 0
packageA/invoice/modules/list/index.js

@@ -0,0 +1,5 @@
+Component({
+  properties: {
+    list: Array
+  },
+})

+ 4 - 0
packageA/invoice/modules/list/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 54 - 0
packageA/invoice/modules/list/index.scss

@@ -0,0 +1,54 @@
+.item {
+    width: 100vw;
+
+    margin-bottom: 20rpx;
+    background-color: #ffffff;
+
+
+    .top {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        height: 80rpx;
+        width: 100%;
+        border-bottom: 1rpx solid #ddd;
+        box-sizing: border-box;
+        padding-right: 30rpx;
+        font-size: 28rpx;
+        padding-left: 30rpx;
+        box-sizing: border-box;
+
+        text{
+            color: var(--assist);
+        }
+    }
+
+    .content {
+        position: relative;
+        padding-bottom: 20rpx;
+        padding-left: 30rpx;
+        box-sizing: border-box;
+
+        .num {
+            height: 40rpx;
+            line-height: 40rpx;
+            font-size: 28rpx;
+            color: #333333;
+            padding: 20rpx 0;
+        }
+
+        .exp {
+            height: 34rpx;
+            font-size: 24rpx;
+            margin-bottom: 8rpx;
+            color: #999999;
+        }
+    }
+}
+
+/* 文本行数限制 */
+.line-1 {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}

+ 26 - 0
packageA/invoice/modules/list/index.wxml

@@ -0,0 +1,26 @@
+<navigator url="/packageA/shipment/detail?id={{item.sa_logisticsid}}" class="item" wx:for="{{list}}" wx:key="billno">
+    <view class="top">
+        提交日期:{{item.submitdate || ' --'}} <text>{{item.status}}</text>
+    </view>
+    <view class="content">
+        <view class="num">
+            申请单号:{{item.billno}}
+        </view>
+        <view class="exp">
+            税号:{{item.taxno || ' --'}}
+        </view>
+        <view class="exp">
+            开票单位:{{item.enterprisename || ' --'}}
+        </view>
+        <view class="exp">
+            开票地址:{{item.address || ' --'}}
+        </view>
+        <view class="exp">
+            开票订单金额:{{item.suminvoiceamount || ' --'}}
+        </view>
+        <view class="exp">
+            审核时间:{{item.checkdate || ' --'}}
+        </view>
+    </view>
+</navigator>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 79 - 0
packageA/invoice/update.js

@@ -0,0 +1,79 @@
+const _Http = getApp().globalData.http,
+    getTime = require("../../utils/getTime");
+
+Page({
+    data: {
+        showAll: false,
+        disabled: true,
+        form: [{
+                label: "开票抬头",
+                error: false,
+                errMsg: "",
+                type: "route",
+                url: "/select/finance/index",
+                params: {
+                    "id": 20221013160602,
+                    "content": {
+                        nocache: true,
+                        sys_enterpriseid: 1,
+                        "pageNumber": 1,
+                        "pageTotal": 1,
+                        "pageSize": 20,
+                        "where": {
+                            "condition": "",
+                        },
+                    },
+                },
+                interrupt: true,
+                query: '&radio=true',
+                value: "",
+                placeholder: "选择开票抬头信息",
+                valueName: "principal",
+                checking: "base",
+                required: true
+            },
+            {
+                label: "备注",
+                error: false,
+                errMsg: "",
+                type: "textarea",
+                value: "",
+                placeholder: "备注",
+                valueName: "remarks",
+                required: false
+            },
+        ]
+    },
+    onLoad(options) {
+        console.log(wx.getStorageSync('userMsg').usertype == 1)
+    },
+    /* 选择财务信息 
+    selectFinance() {
+        if (this.isEdit()) return;
+        wx.navigateTo({
+            url: `?params=${JSON.stringify()}&radio=true`,
+        });
+        getApp().globalData.handleSelect = this.setFinance.bind(this);
+    },*/
+    /* 打断处理form */
+    interrupt(e) {
+        console.log("打断", e)
+    },
+    submit() {},
+    // 是否显示全部
+    onChange({
+        detail
+    }) {
+        this.setData({
+            showAll: detail
+        })
+    },
+    /* 表单必填项是否完成 */
+    onConfirm({
+        detail
+    }) {
+        this.setData({
+            disabled: detail
+        })
+    }
+})

+ 5 - 0
packageA/invoice/update.json

@@ -0,0 +1,5 @@
+{
+	"usingComponents": {
+		"Yl_Headline": "/components/Yl_Headline/index"
+	}
+}

+ 26 - 0
packageA/invoice/update.scss

@@ -0,0 +1,26 @@
+.footer {
+	display: flex;
+	justify-content: center;
+	padding: 0 30rpx;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	box-sizing: border-box;
+	z-index: 9999;
+	padding-top: 10rpx;
+
+	.but {
+			width: 690rpx;
+			height: 90rpx;
+			background: var(--warning);
+			border-radius: 16rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC-Bold, PingFang SC;
+			font-weight: bold;
+			color: #fff;
+	}
+
+}

+ 7 - 0
packageA/invoice/update.wxml

@@ -0,0 +1,7 @@
+<Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
+<Yl_Field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm' bind:interrupt="interrupt">
+	<view slot='discountrate' style="margin-right: 36rpx;">%</view>
+</Yl_Field>
+<view class="footer">
+	<van-button custom-class='but' disabled="{{disabled}}" bind:click="submit">申请开票</van-button>
+</view>