Explorar o código

增加dk-form-bill组件

zhoux %!s(int64=2) %!d(string=hai) anos
pai
achega
b4fa67b243

+ 1 - 0
app.json

@@ -289,6 +289,7 @@
         "dk-list": "components/dkbase/dk-list/dk-list",
         "dk-form": "components/dkbase/dk-form/dk-form",
         "dk-form-more-items": "components/dkbase/dk-form-more-items/dk-form-more-items",
+        "dk-form-bill": "components/dkbase/dk-form-bill/dk-form-bill",
         "loading": "components/dkbase/loading/loading"
     },
     "tabBar": {

+ 343 - 0
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -0,0 +1,343 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:表单-(开单)
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		周兴		  	2024-1-30    1.00		   	  新建
+ *******************************************************************************/
+const common = require('@/utils/common');
+const Constants = require('@/utils/Constants');
+const chooseLocation = requirePlugin('chooseLocation');
+const app = getApp();
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    // 区域
+    cardList: {
+      type: Array,
+      value: []
+    },
+    // 内容
+    contentObj: {
+      type: Object,
+    },
+    // 开单组件类型
+    type: {
+      type: String,
+    },
+    // 结果集
+    value: {
+      type: String,
+      observer: function (newVal) {
+        if (newVal) {
+          this.setData({
+            form: JSON.parse(newVal) || {}
+          })
+        }
+      }
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    // 是否显示pop
+    show: false,
+    $t: app.globalData.lang,
+    routeUrl: app.globalData['routeUrl'],
+    item: null,
+    index: null,
+    card: null,
+    // 下拉类型
+    dropType: null,
+    dropCode: null,
+    dropName: null,
+    form: {}
+  },
+  lifetimes: {
+    attached: function () {
+    },
+    detached: function () {
+      // 在组件实例被从页面节点树移除时执行
+    },
+  },
+  pageLifetimes: {
+    /**
+     * @desc :  生命周期函数--监听页面显示
+     * @author : 周兴
+     * @date : 2024/2/19 12:16
+     */
+    show: function () {
+      const location = chooseLocation.getLocation();
+      // console.log('loc', location);
+      let form = this.data.form
+      if (location) {
+        form['address'] = location;
+        // 如果有校验信息就清除掉
+        let card = this.data.card;
+        let index = this.data.index;
+        let contentObj = this.data.contentObj;
+        if (card && contentObj[card][index]?.errMsg) {
+          contentObj[card][index].errMsg = undefined;
+          this.setData({
+            contentObj: contentObj
+          })
+        }
+      }
+      this.setData({
+        value: JSON.stringify(form),
+        form: form
+      })
+    }
+  },
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    /**
+     * @desc   : 打开下拉/跳转选择页面
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    open(e) {
+      let item = e.currentTarget.dataset;
+      if (item.item.type == 'drop') {
+        this.setData({
+          show: true,
+          dropCode: item.key,
+          dropName: item.name,
+          dropType: item.type,
+          index: item.index,
+          card: item.card
+        })
+      } else if (item.item.type == 'choose') {
+        // 跳转链接
+        if (item.url) {
+          wx.navigateTo({
+            url: item.url,
+          })
+        }
+      }
+    },
+    /**
+     * @desc   : 非空校验
+     * @author : 周兴
+     * @date   : 2024/2/20 11:46
+     */
+    validData() {
+      let flag = true;
+      let cardList = this.data.cardList;
+      if (!cardList || cardList.length == 0) {
+        return flag;
+      }
+      let form = this.data.form;
+      let contentObj = this.data.contentObj;
+      cardList.forEach(card => {
+        if (contentObj[card]) {
+          contentObj[card].forEach(item => {
+            let title = this.$t(item.title ? item.title : item.code)
+            // 如果必须输入,就要进行判断
+            if (item.required && !form[item.code]) {
+              item.errMsg = title + '为空'
+              flag = false;
+            }
+          })
+        }
+      })
+      this.setData({
+        contentObj: contentObj
+      })
+      return flag;
+    },
+    /**
+     * @desc   : 展开页签
+     * @author : 周兴
+     * @date   : 2024/2/20 11:46
+     */
+    expandCard(e) {
+      console.log('e', e);
+      let cardList = this.data.cardList
+      let index = e.currentTarget.dataset.index
+      if (cardList[index]) {
+        // 收缩的时候需要展示信息
+        let unExpand = cardList[index].unExpand
+        cardList[index].info = undefined
+        console.log('f1', unExpand);
+        if (!unExpand) {
+          let form = this.data.form
+          let infoCols = e.currentTarget.dataset.item.infoCols
+          console.log('f2', infoCols, form);
+          if (infoCols && infoCols.length > 0) {
+            let info = ''
+            infoCols.forEach(it => {
+              if (form[it]) {
+                info += form[it] + '/'
+              }
+            })
+            if (info.length > 0) {
+              info = info.substring(0, info.length - 1);
+              cardList[index].info = info
+            }
+          }
+        }
+        cardList[index].unExpand = !unExpand
+        this.setData({
+          cardList: cardList
+        })
+      }
+    },
+    /**
+     * @desc   : 选择数据
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    chooseData(e) {
+      let contentObj = this.data.contentObj;
+      let form = this.data.form
+      form[this.data.dropCode] = e.detail.value;
+      form[this.data.dropName] = e.detail.text;
+      let card = this.data.card;
+      // 选择后清空校验提示信息
+      if (card && contentObj[card][this.data.index]?.errMsg && e.detail) {
+        contentObj[card][this.data.index].errMsg = undefined;
+      }
+      this.setData({
+        value: JSON.stringify(form),
+        form: form,
+        contentObj: contentObj
+      })
+      // 如果处理id,name还需要赋值其他,需要在页面事件中自行处理
+      this.triggerEvent("chooseData", { code: this.data.dropCode, item: e.detail.item })
+    },
+    /**
+     * @desc   : 修改输入框的值
+     * @author : 周兴
+     * @date   : 2024/2/2 11:46
+     */
+    changeField(e) {
+      let ds = e.currentTarget.dataset
+      let key = ds.key
+      let item = ds.item
+      let form = this.data.form
+      form[key] = e.detail
+      let contentObj = this.data.contentObj;
+      // 输入值后清空校验提示信息
+      if (item.errMsg && e.detail) {
+        contentObj[ds.card][ds.index].errMsg = undefined;
+      }
+      this.setData({
+        value: JSON.stringify(form),
+        form: form,
+        contentObj: contentObj
+      })
+    },
+    /**
+     * @desc   : 修改数值输入框的值
+     * @author : 周兴
+     * @date   : 2024/2/2 11:46
+     */
+    changeNumberField(e) {
+      let ds = e.currentTarget.dataset
+      let key = ds.key
+      let item = ds.item
+      let form = this.data.form
+      form[key] = e.detail.value
+      let contentObj = this.data.contentObj;
+      // 输入值后清空校验提示信息
+      if (item.errMsg && e.detail) {
+        contentObj[ds.card][ds.index].errMsg = undefined;
+      }
+      this.setData({
+        value: JSON.stringify(form),
+        form: form,
+        contentObj: contentObj
+      })
+    },
+    /**
+     * @desc   : 修改电话的值
+     * @author : 周兴
+     * @date   : 2024/2/2 11:46
+     */
+    changePhone(e) {
+      let ds = e.currentTarget.dataset;
+      let key = ds.key;
+      let index = ds.index;
+      let card = ds.card;
+      let form = this.data.form
+      form[key] = e.detail.detail
+      let contentObj = this.data.contentObj;
+      if (card && contentObj[card][index]?.errMsg && e.detail.detail) {
+        contentObj[card][index].errMsg = undefined;
+      }
+      this.setData({
+        value: JSON.stringify(form),
+        form: form,
+        contentObj: contentObj
+      })
+    },
+    /**
+     * @desc   : 给电话赋值错误信息
+     * @author : 周兴
+     * @date   : 2024/2/20 11:46
+     */
+    changePhoneblur(e) {
+      let ds = e.currentTarget.dataset
+      let errMsg = e.detail.errMsg;
+      let card = ds.card;
+      let index = ds.index;
+      let contentObj = this.data.contentObj;
+      if (errMsg && card && contentObj[card][index]) {
+        contentObj[card][index].errMsg = errMsg;
+        this.setData({
+          errMsg: errMsg
+        })
+      }
+    },
+    /**
+     * @desc : 小程序地图调用
+     * @author : 周兴
+     * @date : 2024/2/18 18:16
+     */
+    onClickWxchartAddress(e) {
+      // 跳转新建地图实例
+      common.onClickWxchartAddress();
+      let item = e.currentTarget.dataset;
+      this.setData({
+        index: item.index,
+        card: item.card
+      })
+    },
+    /**
+     * @desc   : 改变选择框内容
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    changeCheckBox(e) {
+      let key = e.currentTarget.dataset.key
+      let checkFlag = e.currentTarget.dataset.value
+      let form = this.data.form
+      form[key] = !checkFlag
+      this.setData({
+        value: JSON.stringify(form),
+        form: form
+      })
+    },
+    /**
+     * @desc : 获取语言的方法
+     * @author : 周兴
+     * @date : 2024/1/19
+     */
+    $t(name) {
+      if (this.data.$t[name]) {
+        return this.data.$t[name];
+      } else {
+        return name;
+      }
+    },
+  },
+})

+ 4 - 0
components/dkbase/dk-form-bill/dk-form-bill.json

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

+ 98 - 0
components/dkbase/dk-form-bill/dk-form-bill.wxml

@@ -0,0 +1,98 @@
+<wxs src='../../../utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+
+<!-- 销售订单  -->
+<view style="display:flex;" wx:if="{{type == 'sale'}}">
+  <!-- 主从业务员  -->
+  <view style="width: 50%;">
+    <van-cell id="staffItem" catchtap="openStaffDropdown" title="{{ form[staff].text?form[staff].text:'选择业务员' }}" value-width="1rpx" title-class="cell-value-staff-org" arrow-direction="down" is-link value="" />
+  </view>
+  <!-- 主从业务部门 -->
+  <view style="width: 50%;">
+    <van-cell id="orgItem" catchtap="openOrgDropdown" title="{{form[org].text ? form[org].text : '选择业务部门' }}" value-width="1rpx" title-class="cell-value-staff-org" arrow-direction="down" is-link value="" />
+  </view>
+</view>
+
+<view class="dk-card-outer-class">
+  <!-- 单据信息 -->
+  <view class="dk-card-class" wx:for="{{cardList}}" wx:for-item="card" data-item="{{card}}" wx:for-index="cardIndex">
+    <view wx:if="{{card.title}}" class="item-class">
+      <view class="item-title-class">{{card.title}}</view>
+      <view class="item-info-class">{{card.info}}</view>
+      <view style="width: 15%;text-align: right;">
+        <dk-tag  wx:if="{{card.expandFlag}}" type="primary" padding="0 20rpx" height="40rpx" color="#9FAEE5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{card.unExpand?'展开':'收起'}}" catchtap="expandCard" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
+      </view>
+    </view>
+    <view wx:if="{{!card.unExpand}}">
+      <!--明细card-->
+      <view wx:if="{{card.name == 'items'}}" wx:for="{{itemsCount}}" wx:key="indext">
+        <view wx:for="{{contentObj[card.name]}}" wx:for-item="item" data-item="{{item}}" wx:key="index">
+          <!--文本框-->
+          <van-field wx:if="{{item.type=='str'}}" label-class="{{item.required?'red-label':'nomal-label' }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:50}}" right-icon="{{item.rightIcon}}" bind:change="changeField" errorMessage="{{item.errMsg}}">
+          </van-field>
+          <!--下拉-->
+          <van-field wx:if="{{item.type=='drop'}}" label-class="{{item.required?'red-label':'nomal-label' }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{item.errMsg}}">
+          </van-field>
+          <!--选择框-->
+          <van-field wx:if="{{item.type=='checkbox'}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="nomal-label" input-align="left" value="{{ form[item.code] ? '  需要' : '  不需要' }}" label="{{item.title?item.title:$t[item.code]}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{item.errMsg}}">
+            <view slot="inputbefor" style="text-align: left;padding-left: 10rpx;" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" data-value="{{form[item.code]}}" data-key="{{item.code}}" catchtap="changeCheckBox">
+              <van-checkbox shape="round" value="{{form[item.code]}}" />
+            </view>
+          </van-field>
+          <!--数字类-->
+          <dk-number-input wx:if="{{item.type=='number'}}" fontSize="14" left="30rpx" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" center="left" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" errorMessage="{{item.errMsg}}" titleValue="{{item.title?item.title:$t[item.code]}}" inputColor="#CAA977" titleFontWeight="bold" titleColor="{{item.required?'#E4002B':'#95A8CB'}}" inputValue="{{form[item.code]}}" bind:triggerBindValue="changeNumberField"></dk-number-input>
+          <!--备注-->
+          <van-field wx:if="{{item.type=='textarea'}}" type="textarea" label-class="{{item.required?'red-label':'nomal-label' }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:500}}" right-icon="{{item.rightIcon}}" bind:change="changeField" errorMessage="{{item.errMsg}}">
+          </van-field>
+        </view>
+        <view class="item-add-btn-class" bind:tap="chooseBill">
+          <van-icon name="plus" color="#606EB2" size="26rpx" custom-style="font-weight:bold" />
+        </view>
+      </view>
+      <!--非明细card-->
+      <view wx:if="{{card.name != 'items'}}" wx:for="{{contentObj[card.name]}}" wx:for-item="item" data-item="{{item}}" wx:key="index">
+        <!--文本框-->
+        <van-field wx:if="{{item.type=='str'}}" label-class="{{item.required?'red-label':'nomal-label' }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:50}}" right-icon="{{item.rightIcon}}" bind:change="changeField" errorMessage="{{item.errMsg}}">
+        </van-field>
+        <!--选单-->
+        <van-field wx:if="{{item.type=='choose'}}" label-class="{{item.required?'red-label':'nomal-label' }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" data-url="{{item.url}}" value="{{ form[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{item.errMsg}}">
+        </van-field>
+        <!--下拉-->
+        <van-field wx:if="{{item.type=='drop'}}" label-class="{{item.required?'red-label':'nomal-label' }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{item.errMsg}}">
+        </van-field>
+        <!--选择框-->
+        <van-field wx:if="{{item.type=='checkbox'}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="nomal-label" input-align="left" value="{{ form[item.code] ? '  需要' : '  不需要' }}" label="{{item.title?item.title:$t[item.code]}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{item.errMsg}}">
+          <view slot="inputbefor" style="text-align: left;padding-left: 10rpx;" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" data-value="{{form[item.code]}}" data-key="{{item.code}}" catchtap="changeCheckBox">
+            <van-checkbox shape="round" value="{{form[item.code]}}" />
+          </view>
+        </van-field>
+        <!--客户地址-->
+        <van-field wx:if="{{item.type=='address'}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="{{item.required?'red-label':'nomal-label' }}" input-align="left" data-key="address" type="textarea" value="{{ wxmlUtil.addressToIndexOf(form.address.address) }}" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" right-icon="location" data-type='address' catchtap="onClickWxchartAddress" readonly="{{true}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" errorMessage="{{item.errMsg}}">
+        </van-field>
+        <!--联系电话-->
+        <dk-number-phone-input wx:if="{{item.type=='phone'}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" labelClass="{{item.required?'red-label':'nomal-label' }}" rightIcon="phone" model:value="{{ form[item.code]}}" bind:changeField="changePhone" bind:changeFieldblur="changePhoneblur" errorMessage="{{item.errMsg}}" id="{{item.code}}" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.code)}}"></dk-number-phone-input>
+        <!--数字类-->
+        <dk-number-input wx:if="{{item.type=='number'}}" fontSize="14" left="30rpx" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" center="left" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" errorMessage="{{item.errMsg}}" titleValue="{{item.title?item.title:$t[item.code]}}" inputColor="#CAA977" titleFontWeight="bold" titleColor="{{item.required?'#E4002B':'#95A8CB'}}" inputValue="{{form[item.code]}}" bind:triggerBindValue="changeNumberField"></dk-number-input>
+        <!--备注-->
+        <van-field wx:if="{{item.type=='textarea'}}" type="textarea" label-class="{{item.required?'red-label':'nomal-label' }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:500}}" right-icon="{{item.rightIcon}}" bind:change="changeField" errorMessage="{{item.errMsg}}">
+        </van-field>
+        <!--附件-->
+        <view style="display:flex;width:100%;margin: 1vw; padding-top: 20rpx;" wx:if="{{item.type=='uploader'}}">
+          <view style="width: 168rpx; flex:1;color: #95A8CB;font-size: 28rpx;padding-left: 27rpx;">附件</view>
+          <view style="width: calc(100% - 168rpx);text-align: left;">
+            <van-uploader max-count="5" accept="image" style="margin-left: 4%;border-radius: 15rpx;" preview-size="160rpx;" file-list="{{ fileList }}" bind:delete="deleteImg" bind:after-read="afterRead" multiple="true" imageFit="aspectFit" />
+            <view style="margin-left: 27rpx;color: #C8C9CC;font-size: 12px;">
+              图片最多上传5张
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</view>
+<!--弹出-->
+<dk-single-dropdown-item show="{{show}}" typeName='{{dropType}}' bind:commit='chooseData' bind:muticlose='muticlose'></dk-single-dropdown-item>
+
+
+<van-popup show="{{ showDate }}" custom-style="border-radius:30rpx 30rpx 0 0;" position="bottom" bind:close="cancelDatePop">
+  <van-datetime-picker type="date" bind:confirm="chooseDate" bind:cancel="cancelDatePop" loading="{true}" value="{{ form[dateCol + '_time']}}" />
+</van-popup>

+ 179 - 0
components/dkbase/dk-form-bill/dk-form-bill.wxss

@@ -0,0 +1,179 @@
+/**card的外部样式*/
+.dk-card-outer-class {
+  margin: 10px 32rpx 10px 32rpx;
+  margin-top: 10px;
+  border-radius: 15rpx;
+  box-shadow: 2px 2px 5px #e5e5e6;
+}
+
+/**card的样式*/
+.dk-card-class {
+  background: #FFFFFF;
+  box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);
+  border-radius: 15rpx !important;
+  padding: 5rpx;
+  margin-bottom: 10rpx;
+}
+
+.dk-obj-class {
+  position: relative;
+  border: solid 3rpx #606EB2;
+  background: #FFFFFF;
+  box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);
+  border-radius: 15rpx;
+  padding: 5rpx;
+  height: 140rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.dk-obj-label-class {
+  color: #1B365D;
+  font-size: 14px;
+  font-weight: 600;
+  text-align: left;
+  margin-left: 40rpx;
+}
+
+.dk-obj-amount-class {
+  color: #1B365D;
+  font-size: 14px;
+  font-weight: 600;
+  text-align: right;
+  margin-right: 120rpx;
+}
+
+/**红色label**/
+.red-label,
+.red-label>view {
+  color: #E4002B !important;
+  font-style: normal;
+  font-weight: bold;
+  font-size: 14px;
+}
+
+.nomal-label,
+.nomal-label>view {
+  color: #95A8CB !important;
+  font-size: 14px;
+}
+
+/**普通label*/
+.nomal-label .van-field__label {
+  color: #95A8CB !important;
+  font-size: 14px !important;
+}
+
+/**普通label*/
+.nomal-label {
+  color: #95A8CB !important;
+  font-size: 14px !important;
+}
+
+/**cell值颜色**/
+.dk-cell-value-class {
+  text-align: left !important;
+  font-size: 13px !important;
+  color: #1B365D !important;
+  font-weight: normal;
+}
+
+/**cell值颜色**/
+.dk-cell-value-right-class {
+  text-align: right !important;
+  font-size: 13px !important;
+  color: #1B365D !important;
+  font-weight: normal;
+}
+
+/**cell空值颜色**/
+.dk-cell-value-empty-class {
+  text-align: left !important;
+  font-size: 13px !important;
+  color: #95A8CB !important;
+}
+
+.corner-view {
+  position: absolute;
+  /* 扇形弧度 */
+  border-radius: 0 0 0 100rpx;
+  /* 左上弧度 */
+  border-top-left-radius: 10rpx;
+  /* 位置 */
+  top: 0;
+  right: 0;
+
+  width: 86rpx;
+  height: 78rpx;
+  background-color: #95A8CB;
+
+}
+
+.corner-view-text {
+  transform: rotate(40deg);
+  position: absolute;
+  top: 16rpx;
+  right: 4rpx;
+  /* 字体颜色 */
+  color: #d5e4ff;
+  font-size: 24rpx;
+  /* font-weight: 600; */
+  font-size: 24rpx;
+}
+
+.sign-class {
+  padding-left: 10rpx;
+  padding-right: 5rpx;
+  font-size: 10px;
+  display: flex;
+  align-items: flex-end;
+}
+
+.amount-class {
+  font-size: 16px;
+}
+
+.item-class {
+  display: flex;
+  font-size: 14px;
+  padding: 20rpx;
+  justify-content: space-between;
+}
+
+.item-title-class {
+  font-size: 16px;
+  color: #1B365D;
+  font-weight: 600;
+  width: 26%;
+}
+
+.item-info-class {
+  color: #1B365D;
+  font-size: 14px;
+  display: flex;
+  align-items: flex-end;
+  width: 59%;
+}
+
+.item-add-btn-class {
+  margin: 20rpx;
+  border: solid 3rpx #606EB2;
+  height: 60rpx;
+  border-radius: 12rpx;
+  background-color: #F8F9FD;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+
+.cell-value-staff-org {
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+	text-align: center;
+	color: #1B365D !important;
+	font-size: 13px !important;
+	font-weight: bold !important;
+  }

+ 4 - 1
mixins/index.js

@@ -75,6 +75,9 @@ module.exports = {
       this.setData({
         loading: false
       })
+      if(res == null ){
+        return;
+      }
       // res.data.data = {
       //     code:200,
       //     list:[{name:'t1',label:'t1'},{name:'t2',label:'t2'}],
@@ -153,7 +156,7 @@ module.exports = {
         this.setData({
           loading: false
         })
-        return ({})
+        return (null)
       }
     })
   },

+ 8 - 0
utils/Constants.js

@@ -109,6 +109,14 @@ module.exports = {
     pay:'pay',
   },
 
+  // dk-form-bill组件类型
+  billType:{
+    // 销售订单
+    sale:'sale',
+    // 采购订单
+    porder:'porder',
+  },
+
   // 收款状态
   receiveStatus:{
     no:'未收款',