Handy_Cao %!s(int64=2) %!d(string=hai) anos
pai
achega
16684984b8

+ 138 - 0
GuangZuan/miniprogram/config/proto/mtp.proto

@@ -2495,4 +2495,142 @@ message AccountFundInfoRsp {
   optional double AvailableMargin = 6; // 可用保证金,查询位掩码:1
   optional double AvailableOutMoney = 7; // 可出资金,查询位掩码:2
   optional int32 IsCleanAccount = 8; // 是否是干净账户,查询位掩码:4
+}
+
+// 广钻预售申请请求
+message GZPresaleApplyReq {
+	optional MessageHead Header = 1;
+  optional uint32 SellUserID = 2; // 发行方用户,必填
+  optional uint64 SellAccountID = 3; // 发行方资金账户ID,必填
+  optional string WRStandardName = 4; // 现货商品名称,必填
+  optional uint64 PresaleQty = 5; // 预售总量,必填
+  optional uint64 MinBuyQty = 6; // 单人最小申购量,必填
+  optional uint64 MaxBuyQty = 7; // 单人最大申购量,必填
+  optional uint64 MinSuccessQty = 8; // 最低成团量,必填
+  optional double UnitPrice = 9; // 预售价格,小数,两位,必填
+  optional string StartDate = 10; // 预售开始日期,必填
+  optional string EndDate = 11; // 预售结束日期,必填
+  optional uint32 BuyMarginAlgorithm = 12; // 买方保证金方式,必填
+  optional double BuyMarginValue = 13; // 买方保证金设置值,小数,四位,必填
+  optional int64 PerformanceTemplateID = 14; // 履约计划模板ID,必填
+  optional uint32 MarketID = 15; // 市场ID,必填
+  optional uint32 YSZSCategory = 16; // 预售钻石分类
+  optional string ZSColorTypeStr = 17; // 颜色,最大允许64个字符
+  optional string ZSClarityTypeStr = 18; // 净度,最大允许64个字符
+  optional string SizeStr = 19; // 尺寸,最大允许64个字符
+  optional string YieldRate = 20; // 成品率,最大允许64个字符
+  optional string QtyDesc = 21; // 数量描述,最大允许64个字符
+  optional string WeightDesc = 22; // 重量描述,最大允许64个字符
+  optional uint32 YSProductionMode = 23; // 生产方式
+  optional string PictureUrls = 24; // 图片路径,CLOB,多张逗号分隔
+  optional string Remark = 25; // 备注,最大允许256个字符
+  optional uint32 ClientType = 26; // 终端类型
+  optional string ClientSerialNo = 27; // 客户端流水号
+}
+// 广钻预售申请响应
+message GZPresaleApplyRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+  optional uint32 SellUserID = 4; // 发行方用户
+  optional uint64 PresaleApplyID = 5; // 预售申请ID
+  optional string ClientSerialNo = 6; // 客户端流水号
+}
+// 广钻集采申请请求
+message GZCenterPurchaseApplyReq {
+	optional MessageHead Header = 1;
+  optional uint32 SellUserID = 2; // 发行方用户,必填
+  optional uint64 SellAccountID = 3; // 发行方资金账户ID,必填
+  optional string WRStandardName = 4; // 现货商品名称,必填
+  optional uint64 PresaleQty = 5; // 预售总量,必填
+  optional uint64 MinBuyQty = 6; // 单人最小申购量,必填
+  optional uint64 MaxBuyQty = 7; // 单人最大申购量,必填
+  optional uint64 MinSuccessQty = 8; // 最低成团量,必填
+  optional string StartDate = 9; // 预售开始日期,必填
+  optional string EndDate = 10; // 预售结束日期,必填
+  optional uint32 BuyMarginAlgorithm = 11; // 买方保证金方式,必填
+  optional double BuyMarginValue = 12; // 买方保证金设置值,小数,四位,必填
+  optional int64 PerformanceTemplateID = 13; // 履约计划模板ID,必填
+  repeated GZCenterPurchasePriceList GZCenterPurchasePriceLists = 14; // 价格列表,必填
+  optional uint32 MarketID = 15; // 市场ID,必填
+  optional uint32 YSZSCategory = 16; // 预售钻石分类
+  optional string ZSShapeTypeStr = 17; // 形状,最大允许64个字符
+  optional string ZSColorTypeStr = 18; // 颜色,最大允许64个字符
+  optional string ZSClarityTypeStr = 19; // 净度,最大允许64个字符
+  optional string ZSCutTypeStr = 20; // 切工,最大允许64个字符
+  optional string ZSSymmetryTypeStr = 21; // 对称,最大允许64个字符
+  optional string ZSPolishTypeStr = 22; // 抛光,最大允许64个字符
+  optional string ZSFluorescenceTypeStr = 23; // 荧光,最大允许64个字符
+  optional string SizeStr = 24; // 尺寸,最大允许64个字符
+  optional string YieldRate = 25; // 成品率,最大允许64个字符
+  optional string QtyDesc = 26; // 数量描述,最大允许64个字符
+  optional string WeightDesc = 27; // 重量描述,最大允许64个字符
+  optional uint32 YSProductionMode = 28; // 生产方式
+  optional string PictureUrls = 29; // 图片路径,CLOB,多张逗号分隔
+  optional string Remark = 30; // 备注,最大允许256个字符
+  optional uint32 ClientType = 31; // 终端类型
+  optional string ClientSerialNo = 32; // 客户端流水号
+}
+
+// 广钻集采申请响应
+message GZCenterPurchaseApplyRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+  optional uint32 SellUserID = 4; // 发行方用户
+  optional uint64 PresaleApplyID = 5; // 预售申请ID
+  optional string ClientSerialNo = 6; // 客户端流水号
+}
+
+// 广钻集采价格列表
+message GZCenterPurchasePriceList {
+  optional uint32 StepIndex = 1; // 档位序号,必填
+  optional uint64 Qty = 2; // 档位数量,必填
+  optional double Price = 3; // 档位价格,小数,两位,必填
+}
+
+// 广钻集采认购下单请求
+message GZCenterPurchaseOrderReq {
+	optional MessageHead Header = 1;
+  optional uint32 UserID = 2; // 用户ID,必填
+  optional uint64 AccountID = 3; // 资金账户ID,必填
+  optional uint64 WRTradeOrderID = 4; // 仓单贸易委托单ID,必填
+  optional uint64 OrderQty = 5; // 认购数量,必填
+  optional uint32 MarketID = 6; // 市场ID,必填
+  optional string ClientOrderTime = 7; // 委托时间,必填
+  optional uint32 ClientType = 8; // 终端类型
+  optional string ClientSerialNo = 9; // 客户端流水号
+}
+// 广钻集采认购下单响应
+message GZCenterPurchaseOrderRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+  optional uint32 UserID = 4; // 用户ID
+  optional uint64 AccountID = 5; // 资金账户ID
+  optional uint64 WRTradeOrderID = 6; // 仓单贸易委托单ID
+  optional string ClientSerialNo = 7; // 客户端流水号
+}
+
+// 广钻预售认购下单请求
+message GZPresaleOrderReq {
+	optional MessageHead Header = 1;
+  optional uint32 UserID = 2; // 用户ID,必填
+  optional uint64 AccountID = 3; // 资金账户ID,必填
+  optional uint64 WRTradeOrderID = 4; // 仓单贸易委托单ID,必填
+  optional uint64 OrderQty = 5; // 认购数量,必填
+  optional uint32 MarketID = 6; // 市场ID,必填
+  optional string ClientOrderTime = 7; // 委托时间,必填
+  optional uint32 ClientType = 8; // 终端类型
+  optional string ClientSerialNo = 9; // 客户端流水号
+}
+// 广钻预售认购下单响应
+message GZPresaleOrderRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+  optional uint32 UserID = 4; // 用户ID
+  optional uint64 AccountID = 5; // 资金账户ID
+  optional uint64 WRTradeOrderID = 6; // 仓单贸易委托单ID
+  optional string ClientSerialNo = 7; // 客户端流水号
 }

+ 13 - 0
GuangZuan/miniprogram/constants/enum/funcode.ts

@@ -77,4 +77,17 @@ export enum FunCode {
     CJJCMemberOperateRsp                = 1114118, // 出境检测会员操作响应(1114118)
     BSFWMemberOperateReq                = 1114119, // 保税服务会员操作请求(1114119)
     BSFWMemberOperateRsp                = 1114120, // 保税服务会员操作响应(1114120)
+    GZPresaleApplyReq                   = 1441879, /// 广钻预售申请请求(0, 22, 87)
+    GZPresaleApplyRsp                   = 1441880, /// 广钻预售申请响应(0, 22, 88)
+    GZPresaleApplyAuditReq              = 1441881, /// 广钻预售申请审核通过请求(0, 22, 89)
+    GZPresaleApplyAuditRsp              = 1441882, /// 广钻预售申请审核通过响应(0, 22, 90)
+    GZPresaleOrderReq                   = 1441883, // 广钻预售认购下单请求(0, 22, 91)
+    GZPresaleOrderRsp                   = 1441884, /// 广钻预售认购下单响应(0, 22, 92)
+    GZCenterPurchasePriceList           = 1441885, /// 广钻集采价格列表(0, 22, 93)
+    GZCenterPurchaseApplyReq            = 1441887, /// 广钻集采申请请求(0, 22, 95)
+    GZCenterPurchaseApplyRsp            = 1441888, /// 广钻集采申请响应(0, 22, 96)
+    GZCenterPurchaseApplyAuditReq       = 1441889, /// 广钻集采申请审核通过请求(0, 22, 97)
+    GZCenterPurchaseApplyAuditRsp       = 1441890, /// 广钻集采申请审核通过响应(0, 22, 98)
+    GZCenterPurchaseOrderReq            = 1441891, /// 广钻集采认购下单请求(0, 22, 99)
+    GZCenterPurchaseOrderRsp            = 1441892, /// 广钻集采认购下单响应(0, 22, 100)
 }

+ 2 - 2
GuangZuan/miniprogram/mHome/pages/presell/new/index.json

@@ -1,7 +1,7 @@
 {
   "usingComponents": {
-    "van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
-  "van-dropdown-item": "@vant/weapp/dropdown-item/index",
+    "van-radio": "@vant/weapp/radio/index",
+    "van-radio-group": "@vant/weapp/radio-group/index",
     "van-picker": "@vant/weapp/picker/index",
     "van-uploader": "@vant/weapp/uploader/index",
     "van-calendar": "@vant/weapp/calendar/index",

+ 0 - 13
GuangZuan/miniprogram/mHome/pages/presell/new/index.less

@@ -1,4 +1,3 @@
-/* mHome/pages/presell/new/index.wxss */
 
 .container {
 
@@ -116,18 +115,6 @@
     }
   }
 
-  .way-view {
-    display: flex;
-    flex-direction: row;
-    justify-content: flex-start;
-    align-items: center;
-    align-content: center;
-
-    &__title {
-      width: 105px;
-    }
-  }
-
   .button-view {
     display: flex;
     justify-content: space-between;

+ 153 - 4
GuangZuan/miniprogram/mHome/pages/presell/new/index.ts

@@ -1,8 +1,11 @@
 import { queryPermancePlanTmp } from "../../../../services/api/orders/index"
-import { marketid } from "../../../../services/utils"
-import { hideLoading, showLoading, showToast } from "../../../../utils/message/index"
+import { accountid, clientType, getErrorMsg, isEncrypted, marketid, protoHeader, timetample, userid } from "../../../../services/utils"
+import { hideLoading, showLoading, showModel, showToast } from "../../../../utils/message/index"
 import services from "../../../../services/index"
 import { formatDate } from "../../../../utils/util"
+import { sendMsgToMQ } from "../../../../services/api/common/index"
+import { encryptBody } from "../../../../utils/websocket/crypto"
+import { FunCode } from "../../../../constants/enum/funcode"
 
 Page({
 
@@ -35,9 +38,37 @@ Page({
     /// 上传的文件路径
     filePath: '',
     /// 生产方式条件
-    options: [{ text: 'HPHT', value: 0 }, { text: 'CVD', value: 1 }],
+    options: [{ text: 'HPHT', value: 1 }, { text: 'CVD', value: 2 }],
     /// 生产方式
-    way: 0
+    way: 1,
+    /// 商品名称
+    wrstandname: '',
+    /// 预售总量
+    pretotalqty: '0.0',
+    /// 预售价格
+    preprice: '0.0',
+    /// 最小采购单位
+    minbuyqty: '0.0',
+    /// 最大采购单位
+    maxbuyqty: '0.0',
+    /// 最低成团量
+    minsuccessqty: '0.0',
+    /// 采购保证金比例
+    buymarginvalue: '0.0',
+    /// 颜色
+    zscolor: '',
+    /// 净度
+    zsclarity: '',
+    /// 尺寸
+    zssize: '',
+    /// 成品率
+    zsyield: '',
+    /// 重量描述
+    weightdesc: '',
+    /// 数量描述
+    qtydesc: '',
+    /// 备注
+    remark: ''
   },
 
    /**
@@ -59,6 +90,9 @@ Page({
       case 'enddate':   /// 结束日期
         this.setData({ showCal: true, isstart: false })
         break
+      case 'submit':   /// 申请提交
+        this.doSubmit()
+        break  
       default:
         break;
     }
@@ -79,6 +113,52 @@ Page({
     }
   },
 
+  check(): boolean {
+    /// 请输入商品名称
+    if (this.data.wrstandname === '') {
+      showToast('请输入商品名称')
+      return false
+    }
+
+    /// 请输入预售总量
+    if ((this.data.pretotalqty === '') || (Number(this.data.pretotalqty) === 0.0) ) {
+      debugger
+      showToast('请输入预售总量')
+      return false
+    }
+
+    /// 请输入预售价格
+    if ((this.data.preprice === '') || (Number(this.data.preprice) === 0.0) ) {
+      showToast('请输入预售价格')
+      return false
+    }
+
+    /// 请输入最小采购单位
+    if ((this.data.minbuyqty === '') || (Number(this.data.minbuyqty) === 0.0) ) {
+      showToast('请输入最小采购单位')
+      return false
+    }
+
+    /// 请输入最大采购单位
+    if ((this.data.maxbuyqty === '') || (Number(this.data.maxbuyqty) === 0.0) ) {
+      showToast('请输入最大采购单位')
+      return false
+    }
+
+    /// 请输入最低成团量
+    if ((this.data.minsuccessqty === '') || (Number(this.data.minsuccessqty) === 0.0) ) {
+      showToast('请输入最低成团量')
+      return false
+    }
+
+    /// 请输入采购保证金比例
+    if ((this.data.buymarginvalue === '') || (Number(this.data.buymarginvalue) === 0.0) ) {
+      showToast('请输入采购保证金比例')
+      return false
+    }
+    return true
+  },
+
   /// 日期关闭触发
   onCloseCal() {
     this.setData({ showCal: false })
@@ -109,6 +189,10 @@ Page({
     this.setData({ fileList });
   },
 
+  onChange(e: any) {
+    this.setData({ way: e.detail });
+  },
+
   /// 照片上传
   afterRead(e: any) {
     const { file } = e.detail;
@@ -133,6 +217,71 @@ Page({
     });
   },
 
+  /// 申请提交
+  doSubmit() {
+    /// 校验不合规
+    if (!this.check()) { return }
+     /// showModel
+     showModel(() => {
+      /// showLoading
+      showLoading(() => {
+        /// 请求参数
+        const info = JSON.stringify({
+          Header: protoHeader(FunCode.GZPresaleApplyReq),
+          SellUserID: userid(),
+          SellAccountID: accountid(),
+          WRStandardName: this.data.wrstandname,
+          PresaleQty: Number(this.data.pretotalqty),
+          MinBuyQty: Number(this.data.minbuyqty),
+          MaxBuyQty: Number(this.data.maxbuyqty),
+          MinSuccessQty: Number(this.data.minsuccessqty),
+          UnitPrice: Number(this.data.preprice),
+          StartDate: this.data.startdate,
+          EndDate: this.data.enddate,
+          BuyMarginAlgorithm: 1,
+          BuyMarginValue: Number(this.data.buymarginvalue)/100.0,
+          ZSColorTypeStr: this.data.zscolor,
+          ZSClarityTypeStr: this.data.zsclarity,
+          SizeStr: this.data.zssize,
+          YieldRate: this.data.zsyield,
+          QtyDesc: this.data.qtydesc,
+          WeightDesc: this.data.weightdesc,
+          YSProductionMode: this.data.way,
+          PictureUrls: this.data.filePath,
+          Remark: this.data.remark,
+          PerformanceTemplateID: this.data.tmp.autoid,
+          MarketID: marketid(),
+          ClientType: clientType(),
+          ClientSerialNo: timetample().toString()
+        })
+        /// 发送请求
+        sendMsgToMQ({
+          data: {
+            data: encryptBody(info),
+            funCodeReq: FunCode.GZPresaleApplyReq,
+            funCodeRsp: FunCode.GZPresaleApplyRsp,
+            isEncrypted: isEncrypted()
+          },
+          success: (res) => {
+            /// 解析对象
+            const data = JSON.parse(res.data.data)
+            if (data.RetCode != 0) {
+              hideLoading(() => {}, getErrorMsg(data.RetCode))
+              return
+            }
+            /// 求购发布请求成功
+            hideLoading(() => {
+              wx.navigateBack()
+            }, '提交申请成功', 'success')
+          },
+          fail: (emsg) => {
+            hideLoading(()=>{}, emsg)
+          }
+        })
+      }, '提交申请请求中....')
+      }, '提示', '确认要提交申请吗?')
+  },
+
   /// 获取履约模板信息
   queryPermancePlanTmp() {
     /// showLoading

+ 25 - 27
GuangZuan/miniprogram/mHome/pages/presell/new/index.wxml

@@ -1,4 +1,4 @@
-<!--mHome/pages/presell/new/index.wxml-->
+
 <view class="container" style="padding-bottom: {{ safeBottom }}px;">
   <view class="nav-view" style="position: sticky; top: 0; z-index: 999;">
     <!-- 导航栏 -->
@@ -11,40 +11,40 @@
   <van-cell-group>
     <van-cell><view solt="title" class="sub-title">预售信息</view></van-cell>
     <view class="cell-item">
-      <van-field label="商品名称:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入商品名称" border="{{ false }}" bind:change="onChange" />
+      <van-field label="商品名称:" title-width="8em" size="large" required clearable model:value="{{ wrstandname }}" placeholder="请输入商品名称" border="{{ false }}" bind:change="onChange" />
     </view>
     <view class="cell-item">
-      <van-field label="预售总量:" size="large" required clearable value="{{ zsclarity }}" placeholder="请输入预售总量" border="{{ false }}" bind:change="onChange" />
+      <van-field label="预售总量:" title-width="8em" type="digit" size="large" required clearable model:value="{{ pretotalqty }}" placeholder="请输入预售总量" border="{{ false }}" bind:change="onChange" />
       <view class="unit">(克拉)</view>
     </view>
     <view class="cell-item">
-      <van-field label="预售价格:" size="large" required clearable value="{{ zssize }}" placeholder="请输入预售价格" border="{{ false }}" bind:change="onChange" />
+      <van-field label="预售价格:" title-width="8em" type="digit" size="large" required clearable model:value="{{ preprice }}" placeholder="请输入预售价格" border="{{ false }}" bind:change="onChange" />
       <view class="unit">(元/克拉)</view>
     </view>
     <view class="cell-item">
-      <van-field label="最小采购单位:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入最小采购单位" border="{{ false }}" bind:change="onChange" />
+      <van-field label="最小采购单位:" title-width="8em" type="digit" size="large" required clearable model:value="{{ minbuyqty }}" placeholder="请输入最小采购单位" border="{{ false }}" bind:change="onChange" />
       <view class="unit">(克拉)</view>
     </view>
     <view class="cell-item">
-      <van-field label="最大采购单位:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入最大采购单位" border="{{ false }}" bind:change="onChange" />
+      <van-field label="最大采购单位:" title-width="8em" type="digit" size="large" required clearable model:value="{{ maxbuyqty }}" placeholder="请输入最大采购单位" border="{{ false }}" bind:change="onChange" />
       <view class="unit">(克拉)</view>
     </view>
     <view class="cell-item">
-      <van-field label="最低成团量:" size="large" required clearable value="{{ zscolor }}" placeholder="请输入最低成团量" border="{{ false }}" bind:change="onChange" />
+      <van-field label="最低成团量:" title-width="8em" type="digit" size="large" required clearable model:value="{{ minsuccessqty }}" placeholder="请输入最低成团量" border="{{ false }}" bind:change="onChange" />
       <view class="unit">(克拉)</view>
     </view>
     <view class="cell-item">
-      <van-field label="采购保证金比例:" size="large" required readonly clearable value="{{ zscolor }}" placeholder="请输入采购保证金比例" border="{{ false }}" bind:change="onChange" />
+      <van-field label="采购保证金比例:" title-width="8em" type="digit" size="large" required clearable model:value="{{ buymarginvalue }}" placeholder="请输入采购保证金比例" border="{{ false }}" bind:change="onChange" />
       <view class="unit">%</view>
     </view>
     <view class="cell-item">
-      <van-field id="startdate" label="开始日期:" size="large" required readonly clearable value="{{ startdate }}" placeholder="请选择开始日期" border="{{ false }}" bind:click-input	="onButtonClick" />
+      <van-field id="startdate" title-width="8em" label="开始日期:" size="large" required readonly clearable value="{{ startdate }}" placeholder="请选择开始日期" border="{{ false }}" bind:click-input	="onButtonClick" />
     </view>
     <view class="cell-item">
-      <van-field id="enddate" label="结束日期:" size="large" required readonly clearable value="{{ enddate }}" placeholder="请选择结束日期" border="{{ false }}" bind:click-input	="onButtonClick" />
+      <van-field id="enddate" title-width="8em" label="结束日期:" size="large" required readonly clearable value="{{ enddate }}" placeholder="请选择结束日期" border="{{ false }}" bind:click-input	="onButtonClick" />
     </view>
     <view class="cell-item">
-      <van-field label="履约方式:" size="large" required readonly clearable value="{{ tmp.templatename }}" border="{{ false }}" bind:click-input="showPlanTmps" />
+      <van-field title-width="8em" label="履约方式:" size="large" required readonly clearable value="{{ tmp.templatename }}" border="{{ false }}" bind:click-input="showPlanTmps" />
       <view class="unit"><van-icon name="arrow"></van-icon></view>
     </view>
     <view class="content prestyle">
@@ -59,21 +59,19 @@
 
   <van-cell-group>
     <van-cell><view solt="title" class="sub-title">钻石参考信息</view></van-cell>
-    <van-field label="颜色:" size="large" clearable value="{{ zscolor }}" placeholder="请输入颜色" border="{{ false }}" bind:change="onChange" />
-    <van-field label="净度:" size="large" clearable value="{{ zsclarity }}" placeholder="请输入净度" border="{{ false }}" bind:change="onChange" />
-    <van-field label="尺寸:" size="large" clearable value="{{ zssize }}" placeholder="请输入尺寸" border="{{ false }}" bind:change="onChange" />
-    <van-field label="成品率:" size="large" clearable value="{{ zscolor }}" placeholder="请输入成品率" border="{{ false }}" bind:change="onChange" />
-    <van-field label="重量描述:" size="large" clearable value="{{ zscolor }}" placeholder="请输入重量描述" border="{{ false }}" bind:change="onChange" />
-    <van-field label="数量描述:" size="large" clearable value="{{ zscolor }}" placeholder="请输入数量描述" border="{{ false }}" bind:change="onChange" />
-    <van-field label="生产方式:" size="large" readonly clearable value="{{ zscolor }}" placeholder="请选择生产方式" border="{{ false }}" bind:change="onChange" />
-    <van-cell size="large">
-      <view solt="title" class="way-view">
-        <view class="way-view__title" style="font-size: 16px; color: #666; text-align: left;">生产方式:</view>
-        <van-dropdown-menu>
-          <van-dropdown-item value="{{ way }}" options="{{ options }}" />
-        </van-dropdown-menu>
+    <van-field label="颜色:" size="large" clearable model:value="{{ zscolor }}" placeholder="请输入颜色" border="{{ false }}" bind:change="onChange" />
+    <van-field label="净度:" size="large" clearable model:value="{{ zsclarity }}" placeholder="请输入净度" border="{{ false }}" bind:change="onChange" />
+    <van-field label="尺寸:" size="large" clearable model:value="{{ zssize }}" placeholder="请输入尺寸" border="{{ false }}" bind:change="onChange" />
+    <van-field label="成品率:" size="large" clearable model:value="{{ zsyield }}" placeholder="请输入成品率" border="{{ false }}" bind:change="onChange" />
+    <van-field label="重量描述:" size="large" clearable model:value="{{ weightdesc }}" placeholder="请输入重量描述" border="{{ false }}" bind:change="onChange" />
+    <van-field label="数量描述:" size="large" clearable model:value="{{ qtydesc }}" placeholder="请输入数量描述" border="{{ false }}" bind:change="onChange" />
+    <van-field label="生产方式:" size="large" readonly border="{{ false }}">
+      <view slot="input">
+        <van-radio-group solt="input" value="{{ way }}" bind:change="onChange" direction="horizontal" >
+          <van-radio wx:for="{{ options }}" wx:for-item="itm" wx:key="value" name="{{ itm.value }}">{{ itm.text }}</van-radio>
+        </van-radio-group>
       </view>
-    </van-cell>
+    </van-field>
     <!-- 凭证 -->
     <view class="credentials-info" style="padding-top: 10px;">
       <text style="padding-left: 15px; font-size: 15px; width: 130px;">*附件</text>
@@ -83,13 +81,13 @@
         <view class="upload"><van-uploader max-count="6" deletable="{{ true }}" file-list="{{ fileList }}" bind:after-read="afterRead" bind:delete="deleteImage" /></view> 
       </view>
     </view>
-    <van-field label="备注:" size="large" type="textarea" autosize maxlength="200" clearable value="{{ zscolor }}" placeholder="请选择请输入备注信息" border="{{ false }}" bind:change="onChange" />
+    <van-field label="备注:" size="large" type="textarea" autosize maxlength="200" clearable model:value="{{ remark }}" placeholder="请输入备注信息" border="{{ false }}" bind:change="onChange" />
   </van-cell-group>
 
   <!-- 操作按钮 -->
   <view class="button-view">
     <van-button custom-class="cancel" round bind:click="backToParent" block color="linear-gradient(to right, #999, #aaa)">取消</van-button>
-    <van-button custom-class="submit" round bind:click="onButtonClick" block color="linear-gradient(to right, #4bb0ff, #D91D34)">提交申请</van-button>
+    <van-button custom-class="submit" id="submit" round bind:click="onButtonClick" block color="linear-gradient(to right, #4bb0ff, #D91D34)">提交申请</van-button>
   </view>
 </view>
 

+ 1 - 1
GuangZuan/miniprogram/mHome/pages/purchase/list/index.wxml

@@ -16,7 +16,7 @@
       <van-tabs id="subCategory" active="{{ status-1 }}" bind:change="onTabChange" line-height="0px"	title-inactive-color="#333" title-active-color="#DC203D">
         <van-tab wx:for="{{ subtabs }}" wx:for-item="itm" wx:key="id" id="{{ itm.id }}" title="{{ itm.name }}"/>
       </van-tabs>
-      <van-icon name="add-o" size="25px" color="#387BDC" bind:click="addPreSell"/>
+      <van-icon name="add-o" size="25px" color="#387BDC" bind:click="addPurchase"/>
     </view>
   </view> 
 </view>

+ 9 - 1
GuangZuan/miniprogram/mHome/pages/purchase/new/index.json

@@ -1,3 +1,11 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "van-radio": "@vant/weapp/radio/index",
+    "van-radio-group": "@vant/weapp/radio-group/index",
+    "van-picker": "@vant/weapp/picker/index",
+    "van-uploader": "@vant/weapp/uploader/index",
+    "van-calendar": "@vant/weapp/calendar/index",
+    "van-popup": "@vant/weapp/popup/index"
+  },
+  "navigationStyle": "custom"
 }

+ 167 - 1
GuangZuan/miniprogram/mHome/pages/purchase/new/index.less

@@ -1 +1,167 @@
-/* mHome/pages/purchase/new/index.wxss */
+.container {
+
+  .sub-title {
+    font-size: 20px;
+    color: #333;
+    text-align: left;
+    font-weight: bold;
+  }
+
+  .cell-item {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-content: center;
+    align-items: center;
+    
+    .unit {
+      font-size: 14px;
+      color: #666;
+      padding-right: 10px;
+    }
+  }
+
+  .column-title, .row {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    align-content: center;
+    margin: 0px 15px;
+
+    &__item {
+      width: 100%;
+      height: 100%;
+      background-color: #ddd;
+      color: #333;
+      font-size: 13px;
+      text-align: center;
+      padding: 7.5px 0px;
+      border-right: 1px solid #aaa;
+    }
+  }
+
+  .row {
+    border: 1px solid #999;
+    border-top: 0px solid #aaa;
+
+    &__item {
+      background-color: #fff;
+      padding: 0px;
+      height: 45px;
+      align-items: center;
+      align-content: center;
+      display: flex;
+      flex-direction: row;
+      justify-content: center;
+    }
+  }
+
+  .row:last-child {
+    border-right: 0px solid #fff;
+  }
+
+  .prestyle {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    align-content: center;
+    justify-content: center;
+    width: 100%;
+    padding-left: 10px;
+
+    .content__item__step {
+      display: flex;
+      flex-direction: row;
+      justify-content: start;
+      align-items: center;
+      align-content: center;
+      width: 100%;
+
+      &__item {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        align-content: center;
+        margin-bottom: 5px;
+
+        text {
+          font-size: 12px;
+          padding: 2.5px 5px;
+          text-align: center;
+        }
+      }
+    }
+
+    .plantmp {
+      color: #333;
+      font-size: 14px;
+      width: 100%;
+      height: 30px;
+    }
+  }
+
+  .credentials-info {
+    display: flex;
+    flex-direction: row;
+    justify-content: start;
+    align-content: center;
+    align-items: center;
+    margin-bottom: 10px;
+    width: 95%;
+
+    text:nth-child(1) {
+      width: 80px;
+      color: #333;
+      font-size: 14px;
+    }
+
+    text:nth-child(2) {
+      width: 100%;
+      color: #333;
+      font-size: 14px;
+      margin-left: 15px;
+    }
+
+    textarea {
+      border: 1px solid #f0f0f0;
+      border-radius: 10px;
+      color: #333;
+      padding: 10px;
+      margin-right: 5px;
+      font-size: 14px;
+    }
+
+    .credentials-top-view {
+      display: flex;
+      flex-direction: column;
+      width: 80%;
+      height: 120px;
+      border-radius: 10px;
+
+      .value {
+        width: 100%;
+        height: 30px;
+        color: #888;
+      }
+
+      .upload {
+        padding-top: 10px 0px 0px 0px;
+        display: flex;
+        justify-content: left;
+        align-items: center;
+      }
+    }
+  }
+
+  .button-view {
+    display: flex;
+    justify-content: space-between;
+    margin: 10px 10px 10px 10px;
+
+    van-button {
+      width: 48%;
+      height: 40px;
+    }
+  }
+}

+ 365 - 3
GuangZuan/miniprogram/mHome/pages/purchase/new/index.ts

@@ -1,11 +1,79 @@
-// mHome/pages/purchase/new/index.ts
+import { queryPermancePlanTmp } from "../../../../services/api/orders/index"
+import { accountid, clientType, getErrorMsg, isEncrypted, marketid, protoHeader, timetample, userid } from "../../../../services/utils"
+import { hideLoading, showLoading, showModel, showToast } from "../../../../utils/message/index"
+import services from "../../../../services/index"
+import { formatDate } from "../../../../utils/util"
+import { FunCode } from "../../../../constants/enum/funcode"
+import { sendMsgToMQ } from "../../../../services/api/common/index"
+import { encryptBody } from "../../../../utils/websocket/crypto"
+
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    /// 底部安全区域
+    safeBottom: getApp().globalData.safeBottom,
+    /// 履约模板信息
+    tmps: <GuangZuan.PermancePlanTmp[]>[],
+    /// 选中履约模板
+    tmp: <GuangZuan.PermancePlanTmp>({}),
+    /// 是否显示
+    show: false,
+    /// 是否显示日历
+    showCal: false,
+    /// 颜色
+    tcolors: ['rebeccapurple', 'green', 'hotpink', 'orange', 'darkgoldenrod'],
+    /// 最小日期
+    minDate: new Date(2010, 10, 1).getTime(),
+    /// 是否开始日期
+    isstart: true,
+    /// 开始日期
+    startdate: formatDate(new Date()),
+    /// 结束日期
+    enddate: formatDate(new Date()),
+    /// 文件上传列表
+    fileList: [],
+    /// 上传的文件路径
+    filePath: '',
+    /// 商品名称
+    wrstandname: '',
+    /// 预售总量
+    pretotalqty: '0.0',
+    /// 最小采购单位
+    minbuyqty: '0.0',
+    /// 最大采购单位
+    maxbuyqty: '0.0',
+    /// 最低成团量
+    minsuccessqty: '0.0',
+    /// 采购保证金比例
+    buymarginvalue: '0.0',
+    /// 形状
+    zsshape: '',
+    /// 颜色
+    zscolor: '',
+    /// 净度
+    zsclarity: '',
+    /// 尺寸
+    zssize: '',
+    /// 抛光
+    zspolish: '',
+    /// 对称
+    zssymmetry: '',
+    /// 切工
+    zscut: '',
+    /// 荧光
+    zsfluorescence: '',
+    /// 备注
+    remark: '',
+    /// 钻石分类
+    categorys: [{ text: '单颗裸钻', value: 2 }, { text: '单颗彩钻', value: 5 }],
+    category: 2,
+    /// 列头
+    columns: ['序号', '数量 >=', '价格/(元/克拉)', '操作'],
+    /// 数据信息
+    datas: [{ price: 0.0, qty: 0.0, step: 1 }]
   },
 
    /**
@@ -17,10 +85,304 @@ Page({
   },
 
   /**
+   * 按钮点击响应事件
+   */
+  onButtonClick(e: any) {
+    switch (e.target.id) {
+      case 'startdate':  /// 开始日期
+        this.setData({ showCal: true, isstart: true })
+        break;
+      case 'enddate':   /// 结束日期
+        this.setData({ showCal: true, isstart: false })
+        break
+      case 'submit':   /// 申请提交
+        this.doSubmit()
+        break  
+      default:
+        break;
+    }
+  },
+
+  check(): boolean {
+    /// 请输入商品名称
+    if (this.data.wrstandname === '') {
+      showToast('请输入商品名称')
+      return false
+    }
+
+    /// 请输入预售总量
+    if ((this.data.pretotalqty === '') || (Number(this.data.pretotalqty) === 0.0) ) {
+      showToast('请输入预售总量')
+      return false
+    }
+
+    /// 请输入最小采购单位
+    if ((this.data.minbuyqty === '') || (Number(this.data.minbuyqty) === 0.0) ) {
+      showToast('请输入最小采购单位')
+      return false
+    }
+
+    /// 请输入最大采购单位
+    if ((this.data.maxbuyqty === '') || (Number(this.data.maxbuyqty) === 0.0) ) {
+      showToast('请输入最大采购单位')
+      return false
+    }
+
+    /// 请输入最低成团量
+    if ((this.data.minsuccessqty === '') || (Number(this.data.minsuccessqty) === 0.0) ) {
+      showToast('请输入最低成团量')
+      return false
+    }
+
+    /// 请输入采购保证金比例
+    if ((this.data.buymarginvalue === '') || (Number(this.data.buymarginvalue) === 0.0) ) {
+      showToast('请输入采购保证金比例')
+      return false
+    }
+    return true
+  },
+
+  /// 日期确定触发
+  onConfirm(e: any) {
+    this.setData({ showCal: false })
+    /// 开始日期
+    if (this.data.isstart) {
+      this.setData({
+        startdate: formatDate(e.detail)
+      })
+    } else {
+      this.setData({
+        enddate: formatDate(e.detail)
+      })
+    }
+  },
+
+  /// 日期关闭触发
+  onCloseCal() {
+    this.setData({ showCal: false })
+  },
+
+  /// 显示履约模板
+  showPlanTmps() {
+    this.setData({ show: true })
+  },
+
+  /// 关闭
+  onClose() {
+    this.setData({ show: false })
+  },
+
+  onSelect(e: any) {
+    /// 默认显示项
+    const { index } = e.detail;
+    this.setData({ tmp: this.data.tmps[index], show: false })
+  },
+
+   /// 删除图片
+   deleteImage(e: any) {
+    const {index} = e.detail.index
+    // 上传完成需要更新 fileList
+    const { fileList = [] } = this.data;
+    fileList.splice(index, 1)
+    this.setData({ fileList });
+  },
+
+  onChange(e: any) {
+    this.setData({ category: e.detail });
+  },
+
+  /// 照片上传
+  afterRead(e: any) {
+    const { file } = e.detail;
+    // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+    wx.uploadFile({
+      url: services.config.uploadUrl,
+      filePath: file.url,
+      name: 'file',
+      formData: { user: 'test' },
+      success: (res) => {
+        if (res.statusCode != 200) {
+          showToast('图片上传失败,原因:'+res.errMsg)
+          return
+        }
+        // 上传完成需要更新 fileList
+        const { fileList = [] } = this.data;
+        fileList.push({ ...file, url: res.data});
+        this.setData({ fileList });
+        /// 设置文件路径
+        this.setData({ filePath: JSON.parse(res.data)[0].filePath })
+      },
+    });
+  },
+
+  /// 申请提交
+  doSubmit() {
+    /// 校验不合规
+    if (!this.check()) { return }
+
+    /// showModel
+    showModel(() => {
+      /// showLoading
+      showLoading(() => {
+        /// 钻石属性
+        var list = this.data.datas.map(obj => {
+          return {
+            StepIndex: obj.step,
+            Qty: Number(obj.qty),
+            Price: Number(obj.price)
+          }
+        })
+  
+        /// 请求参数
+        const info = JSON.stringify({
+          Header: protoHeader(FunCode.GZCenterPurchaseApplyReq),
+          SellUserID: userid(),
+          SellAccountID: accountid(),
+          WRStandardName: this.data.wrstandname,
+          PresaleQty: Number(this.data.pretotalqty),
+          MinBuyQty: Number(this.data.minbuyqty),
+          MaxBuyQty: Number(this.data.maxbuyqty),
+          MinSuccessQty: Number(this.data.minsuccessqty),
+          StartDate: this.data.startdate,
+          EndDate: this.data.enddate,
+          BuyMarginAlgorithm: 1,
+          BuyMarginValue: this.data.buymarginvalue,
+          PerformanceTemplateID: this.data.tmp.autoid,
+          YSZSCategory: this.data.category,
+          ZSShapeTypeStr: this.data.zsshape,
+          ZSColorTypeStr: this.data.zscolor,
+          ZSClarityTypeStr: this.data.zsclarity,
+          ZSCutTypeStr: this.data.zscut,
+          ZSSymmetryTypeStr: this.data.zssymmetry,
+          ZSPolishTypeStr: this.data.zspolish,
+          ZSFluorescenceTypeStr: this.data.zsfluorescence,
+          SizeStr: this.data.zssize,
+          PictureUrls: this.data.filePath,
+          Remark: this.data.remark,
+          GZCenterPurchasePriceLists: list,
+          MarketID: marketid(),
+          ClientType: clientType(),
+          ClientSerialNo: timetample().toString()
+        })
+        /// 发送请求
+        sendMsgToMQ({
+          data: {
+            data: encryptBody(info),
+            funCodeReq: FunCode.GZCenterPurchaseApplyReq,
+            funCodeRsp: FunCode.GZCenterPurchaseApplyRsp,
+            isEncrypted: isEncrypted()
+          },
+          success: (res) => {
+            /// 解析对象
+            const data = JSON.parse(res.data.data)
+            if (data.RetCode != 0) {
+              hideLoading(() => {}, getErrorMsg(data.RetCode))
+              return
+            }
+            /// 求购发布请求成功
+            hideLoading(() => {
+              wx.navigateBack()
+            }, '提交申请成功', 'success')
+          },
+          fail: (emsg) => {
+            hideLoading(()=>{}, emsg)
+          }
+        })
+      }, '提交申请请求中....')
+      }, '提示', '确认要提交申请吗?')
+  },
+
+  /// 获取履约模板信息
+  queryPermancePlanTmp() {
+    /// showLoading
+    showLoading(() => {
+      queryPermancePlanTmp({
+        data: {
+          marketid: marketid()
+        },
+        success: (res) => {
+          /// 获取数据
+          this.setData({ 
+            tmps: res.data,
+            tmp: res.data[0],
+            actions: res.data.map(obj => { return obj.templatename })
+           })
+        },
+        complete: () => {
+          /// hideLoading
+          hideLoading()
+        }
+      })
+    })
+  },
+
+  /**
+   * 新增价格
+   */
+  addPrice(e: any) {
+    console.log(e)
+    this.setData({
+      datas: this.data.datas.concat([{price: 0.0, qty: 0.0, step: this.data.datas.length+1}]) 
+    })
+  },
+
+  /**
+   * 删除某一行
+   */
+  deleteRow(e: any) {
+    const row = e.target.id
+    var obj = this.data.datas[row-1]
+    if (obj.qty === 0.0 && row === '1') {
+      showToast('第一条数据信息不能删除')
+      return
+    }
+    /// 删除数据
+    this.data.datas.splice(row-1, 1)
+    this.setData({ datas: this.data.datas  })
+  },
+
+  /**
+   * 数据变化
+   */
+  onRowChanged(e: any) {
+    console.log(e)
+    /// 获取对应的id
+    const ids = (<string> e.target.id).split(' ')
+    const row = <number><unknown>ids[0]
+    const id = ids[1]
+    var obj = this.data.datas[row-1]
+    /// 数据赋值
+    if (id === "qty") {
+      obj.qty = e.detail
+    } else {
+      obj.price = e.detail
+    }
+    /// 删除数据
+    this.data.datas.splice(row-1, 1)
+    this.data.datas.splice(row-1, 0, obj)
+    this.setData({ datas: this.data.datas  })
+  },
+
+  /**
+   * 数据变化重新排序
+   */
+  onRowSort() {
+    /// 数据排序
+    this.setData({
+      datas: this.data.datas.sort(function(a, b) {
+        if (a.qty > b.qty) { return 1; }
+        if (a.qty < b.qty) { return -1; }
+        return 0;
+      })
+    })
+  },
+
+  /**
    * 生命周期函数--监听页面加载
    */
   onLoad() {
-
+    /// 获取履约模板信息
+    this.queryPermancePlanTmp()
   },
 
   /**

+ 121 - 9
GuangZuan/miniprogram/mHome/pages/purchase/new/index.wxml

@@ -1,9 +1,121 @@
-<!--mHome/pages/purchase/new/index.wxml-->
-<view class="container">
-  <!-- 导航栏 -->
-  <van-nav-bar custom-style="background-color: #407DB8">
-    <van-icon slot="left" name="arrow-left" size="25px" color="#fff" bind:click="backToParent"/>
-    <text slot="title" style="color: #fff;">集采申请</text>
-  </van-nav-bar>
-
-</view>
+
+<view class="container" style="padding-bottom: {{ safeBottom }}px;">
+  <view class="nav-view" style="position: sticky; top: 0; z-index: 999;">
+    <!-- 导航栏 -->
+    <van-nav-bar custom-style="background-color: #407DB8">
+      <van-icon slot="left" name="arrow-left" size="25px" color="#fff" bind:click="backToParent"/>
+      <text slot="title" style="color: #fff;">集采申请</text>
+    </van-nav-bar>
+  </view>
+
+  <van-cell-group>
+    <van-cell><view solt="title" class="sub-title">集采信息</view></van-cell>
+    <view class="cell-item">
+      <van-field label="商品名称:" title-width="8em" size="large" required clearable model:value="{{ wrstandname }}" placeholder="请输入商品名称" border="{{ false }}"/>
+    </view>
+    <view class="cell-item">
+      <van-field label="钻石类型:" title-width="8em" size="large" required readonly border="{{ false }}">
+        <view slot="input">
+          <van-radio-group solt="input" value="{{ category }}" bind:change="onChange" direction="horizontal" >
+            <van-radio wx:for="{{ categorys }}" wx:for-item="itm" wx:key="value" name="{{ itm.value }}">{{ itm.text }}</van-radio>
+          </van-radio-group>
+        </view>
+      </van-field>
+    </view>
+    <view class="cell-item">
+      <van-field label="预售总量:" type="digit" title-width="8em" size="large" required clearable model:value="{{ pretotalqty }}" placeholder="请输入预售总量" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="最小采购单位:" type="digit" title-width="8em" size="large" required clearable model:value="{{ minbuyqty }}" placeholder="请输入最小采购单位" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="最大采购单位:" type="digit" title-width="8em" size="large" required clearable model:value="{{ maxbuyqty }}" placeholder="请输入最大采购单位" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="最低成团量:" type="digit" title-width="8em" size="large" required clearable model:value="{{ minsuccessqty }}" placeholder="请输入最低成团量" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">(克拉)</view>
+    </view>
+    <view class="cell-item">
+      <van-field label="采购保证金比例:" type="digit" title-width="8em" size="large" required clearable model:value="{{ buymarginvalue }}" placeholder="请输入采购保证金比例" border="{{ false }}" bind:change="onChange" />
+      <view class="unit">%</view>
+    </view>
+    <view class="cell-item">
+      <van-field id="startdate" label="开始日期:" title-width="8em" size="large" required readonly clearable value="{{ startdate }}" placeholder="请选择开始日期" border="{{ false }}" bind:click-input	="onButtonClick" />
+    </view>
+    <view class="cell-item">
+      <van-field id="enddate" label="结束日期:" title-width="8em" size="large" required readonly clearable value="{{ enddate }}" placeholder="请选择结束日期" border="{{ false }}" bind:click-input	="onButtonClick" />
+    </view>
+    <view class="cell-item">
+      <van-field label="履约方式:" title-width="8em" size="large" required readonly clearable value="{{ tmp.templatename }}" border="{{ false }}" bind:click-input="showPlanTmps" />
+      <view class="unit"><van-icon name="arrow"></van-icon></view>
+    </view>
+    <view class="content prestyle">
+      <view class="content__item__step">
+        <view class="content__item__step__item" wx:for="{{ tmp.LstStep }}" wx:for-item="itm" wx:for-index="idx" wx:key="idx"> 
+          <text style="background-color: {{ tcolors[idx] }}; color: white;">{{ itm.stepinfo }}</text>
+          <text>{{ itm.stepdate }}</text>
+        </view>
+      </view>
+    </view>
+  </van-cell-group>
+
+  <van-cell-group>
+    <van-cell>
+      <view solt="title" class="sub-title">集采价格</view>
+      <van-icon slot="right-icon" name="plus" size="20px" color="#226FD9" class="custom-icon" bind:click="addPrice" />
+    </van-cell>
+    <view class="column-title">
+     <view class="column-title__item" wx:for="{{ columns }}" wx:for-item="itm" wx:for-index="idx" wx:key="idx">{{ itm }}</view>
+    </view>
+    <view class="row" wx:for="{{ datas }}" wx:for-item="itm" wx:for-index="idx" wx:key="idx">
+      <view class="row__item">{{ itm.step }}</view> 
+      <view class="row__item">
+        <van-field id="{{ itm.step }} qty" value="{{ itm.qty }}" input-align="center" clearable type="digit" readonly="{{ idx === 0 }}" bind:change="onRowChanged" ></van-field>
+      </view> 
+      <view class="row__item">
+        <van-field id="{{ itm.step }} price" value="{{ itm.price }}" input-align="center" clearable type="digit" bind:change="onRowChanged"	></van-field>
+      </view> 
+      <view class="row__item"><van-icon name="delete-o" size="15px" bind:click="deleteRow" id="{{ itm.step }}"></van-icon></view>
+    </view>
+  </van-cell-group>
+
+  <van-cell-group>
+    <van-cell><view solt="title" class="sub-title">钻石参考信息</view></van-cell>
+    <van-field label="形状:" size="large" clearable model:value="{{ zsshape }}" placeholder="请输入形状" border="{{ false }}" bind:change="onChange" />
+    <van-field label="颜色:" size="large" clearable model:value="{{ zscolor }}" placeholder="请输入颜色" border="{{ false }}" bind:change="onChange" />
+    <van-field label="净度:" size="large" clearable model:value="{{ zsclarity }}" placeholder="请输入净度" border="{{ false }}" bind:change="onChange" />
+    <van-field label="尺寸:" size="large" clearable model:value="{{ zssize }}" placeholder="请输入尺寸" border="{{ false }}" bind:change="onChange" />
+    <van-field label="抛光:" size="large" clearable model:value="{{ zspolish }}" placeholder="请输入抛光" border="{{ false }}" bind:change="onChange" />
+    <van-field label="对称:" size="large" clearable model:value="{{ zssymmetry }}" placeholder="请输入对称" border="{{ false }}" bind:change="onChange" />
+    <van-field label="切工:" size="large" clearable model:value="{{ zscut }}" placeholder="请输入切工" border="{{ false }}" bind:change="onChange" />
+    <van-field label="荧光:" size="large" clearable model:value="{{ zsfluorescence }}" placeholder="请输入荧光" border="{{ false }}" bind:change="onChange" />
+    <!-- 凭证 -->
+    <view class="credentials-info" style="padding-top: 10px;">
+      <text style="padding-left: 15px; font-size: 15px; width: 130px;">*附件</text>
+      <view class="credentials-top-view">
+        <text class="value">请上传相关图片</text>
+        <!-- 凭证图片 -->
+        <view class="upload"><van-uploader max-count="6" deletable="{{ true }}" file-list="{{ fileList }}" bind:after-read="afterRead" bind:delete="deleteImage" /></view> 
+      </view>
+    </view>
+    <van-field label="备注:" size="large" type="textarea" autosize maxlength="200" clearable model:value="{{ remark }}" placeholder="请输入备注信息" border="{{ false }}" bind:change="onChange" />
+  </van-cell-group>
+
+  <!-- 操作按钮 -->
+  <view class="button-view">
+    <van-button custom-class="cancel" round bind:click="backToParent" block color="linear-gradient(to right, #999, #aaa)">取消</van-button>
+    <van-button custom-class="submit" id="submit" round bind:click="onButtonClick" block color="linear-gradient(to right, #4bb0ff, #D91D34)">提交申请</van-button>
+  </view>
+</view>
+
+<!-- toast -->
+<van-toast id="van-toast"/>
+<!-- 履约模板 -->
+<van-popup show="{{ show }}" position="bottom" custom-style="height: 30%"  bind:click-overlay="onClose">
+  <van-picker show-toolbar bind:confirm="onSelect" bind:cancel="onClose" columns="{{ actions }}" title="请选择履约模板" />
+</van-popup>
+<!-- 选择日期 -->  
+<van-calendar show="{{ showCal }}" min-date="{{ minDate }}" bind:close="onCloseCal" bind:confirm="onConfirm" />

+ 2 - 2
GuangZuan/project.private.config.json

@@ -10,8 +10,8 @@
     "miniprogram": {
       "list": [
         {
-          "name": "预售申请",
-          "pathName": "mHome/pages/presell/new/index",
+          "name": "集采申请",
+          "pathName": "mHome/pages/purchase/new/index",
           "query": "",
           "launchMode": "default",
           "scene": null