Explorar el Código

合同 提交/审核/反审核

zhaoxiaohai hace 3 años
padre
commit
22c9b8643c

+ 109 - 4
packageA/contract/detail.js

@@ -8,6 +8,15 @@ Page({
             num: 132
         }],
         tabbarList: [{
+            icon: "icon-genjin",
+            label: "提交"
+        }, {
+            icon: "icon-genjin",
+            label: "审核"
+        }, {
+            icon: "icon-genjin",
+            label: "反审核"
+        }, {
             icon: "icon-genjin",
             label: "跟进"
         }, {
@@ -28,6 +37,7 @@ Page({
         _Http.basic({
             "id": 20221121195102,
             "content": {
+                nocache: true,
                 "sa_contractid": this.data.sa_contractid
             },
         }).then(res => {
@@ -69,13 +79,14 @@ Page({
                     data.type = '居间协议'
                     break;
                 case "项目":
+                    /*  {
+                        label: "合同条款",
+                        num: 132
+                    }, */
                     data.type = data.typemx + '项目协议'
                     tabsList = tabsList.concat([{
                         label: "产品清单",
                         num: 132
-                    }, {
-                        label: "合同条款",
-                        num: 132
                     }, {
                         label: "跟进动态",
                         num: 132
@@ -111,6 +122,16 @@ Page({
                 tabsList,
                 tabsActive
             });
+
+            /* 更新列表数据 */
+            let page = getCurrentPages().find(v => v.__route__ == 'packageA/contract/index');
+            if (page) {
+                let i = page.data.list.findIndex(v => v.sa_contractid == this.data.sa_contractid);
+                if (i != -1) page.setData({
+                    [`list[${i}].status`]: res.data.status
+                })
+            }
+
             this.getTags();
             this.getGroup();
             this.partialRenewal();
@@ -300,8 +321,92 @@ Page({
     tabbarOnClick({
         detail
     }) {
-        let data = this.data.detail;
+        let data = this.data.detail,
+            that = this;
         switch (detail.label) {
+            case "提交":
+                if (data.status != '新建') return wx.showToast({
+                    title: '当前状态不可提交!',
+                    icon: "none"
+                })
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定提交当前协议,提交后禁止使用部分功能`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": 20221121202802,
+                            "content": {
+                                "sa_contractids": [that.data.sa_contractid]
+                            }
+                        }).then(res => {
+                            console.log("提交报价单", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? "提交成功" : res.msg,
+                                icon: "none"
+                            })
+                            if (res.msg == '成功') setTimeout(() => {
+                                that.getDetail();
+                            }, 300)
+                        })
+                    }
+                })
+                break;
+            case "审核":
+                if (data.status != '已提交') return wx.showToast({
+                    title: '当前状态不可审核!',
+                    icon: "none"
+                })
+                wx.showModal({
+                    title: '提示',
+                    content: `是否通过当前协议`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": 20221121203102,
+                            "version": 1,
+                            "content": {
+                                "type": 1, //0:不通过,1:通过
+                                "sa_contractids": [that.data.sa_contractid]
+                            }
+                        }).then(res => {
+                            console.log("审核合同", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? "审核成功" : res.msg,
+                                icon: "none"
+                            })
+                            if (res.msg == '成功') setTimeout(() => {
+                                that.getDetail();
+                            }, 300)
+                        })
+                    }
+                })
+                break;
+            case "反审核":
+                if (data.status == '新建') return wx.showToast({
+                    title: '当前状态不可反审核!',
+                    icon: "none"
+                })
+                wx.showModal({
+                    title: '提示',
+                    content: `是否退回当前协议`,
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": 20221212135402,
+                            "content": {
+                                "sa_contractid": that.data.sa_contractid,
+                            }
+                        }).then(res => {
+                            console.log("反审核合同", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? "反审核成功" : res.msg,
+                                icon: "none"
+                            })
+                            if (res.msg == '成功') setTimeout(() => {
+                                that.getDetail();
+                            }, 300)
+                        })
+                    }
+                })
+                break;
             case "跟进":
                 wx.navigateTo({
                     url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_contract&ownerid=${data.sa_contractid}`,

+ 2 - 2
packageA/contract/detail.wxml

@@ -11,8 +11,8 @@
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Product slot='{{detail.type=="工具使用(借出)协议"?"工具清单":"产品清单"}}' disabled='{{detail.status!="新建"}}' id='Product' />
     <Trace slot='跟进动态' id='Trace' ownertable='sa_contract' ownerid='{{detail.sa_contractid}}' />
-    <PiscountProduct slot='产品明细折扣' id='PiscountProduct' />
-    <PiscountType slot='产品类型折扣' id='PiscountType' />
+    <PiscountProduct slot='产品明细折扣' id='PiscountProduct' disabled='{{detail.status!="新建"}}' />
+    <PiscountType slot='产品类型折扣' id='PiscountType' disabled='{{detail.status!="新建"}}' />
     <view style="height: 140rpx;" />
 </Yl_FunTabs>
 <!-- 底部 -->

+ 3 - 3
packageA/contract/modules/discount/product/list/index.wxml

@@ -26,7 +26,7 @@
                     <text class="line-1" style="margin-right: 6rpx;">牌价:{{item.marketprice||' --'}}</text>
                 </view>
             </view>
-            <view class="delete" data-item="{{item}}" catchtap="deleteProduct">
+            <view class="delete" wx:if="{{!disabled}}" data-item="{{item}}" catchtap="deleteProduct">
                 <text class="iconfont icon-guanlian-shanchu" />
             </view>
         </view>
@@ -35,11 +35,11 @@
         <view class="row">
             <view style="margin-right: 30rpx;">
                 <view class="label">折扣(%):</view>
-                <input class="input" style="width: 130rpx;" type="digit" value="{{item.discountrate}}" data-name="discountrate" data-index="{{index}}" bindblur="onBlur" />
+                <input class="input" style="width: 130rpx;" disabled='{{disabled}}' type="digit" value="{{item.discountrate}}" data-name="discountrate" data-index="{{index}}" bindblur="onBlur" />
             </view>
             <view>
                 <view class="label">单价(元):</view>
-                <input class="input" style="flex: 1;" type="digit" value="{{item.price}}" data-name="price" data-index="{{index}}" bindblur="onBlur" />
+                <input class="input" style="flex: 1;" type="digit" disabled='{{disabled}}' value="{{item.price}}" data-name="price" data-index="{{index}}" bindblur="onBlur" />
             </view>
         </view>
     </view>

+ 2 - 2
packageA/contract/modules/discount/type/list/index.wxml

@@ -9,7 +9,7 @@
                     品牌:{{item.brandname||'暂无品牌'}}
                 </view>
             </view>
-            <view class="delete" data-item="{{item}}" catchtap="deleteProduct">
+            <view class="delete" wx:if="{{!disabled}}" data-item="{{item}}" catchtap="deleteProduct">
                 <text class="iconfont icon-guanlian-shanchu" />
             </view>
         </view>
@@ -18,7 +18,7 @@
         <view class="row">
             <view style="margin-right: 30rpx;">
                 <view class="label">折扣(%):</view>
-                <input class="input" style="width: 130rpx;" type="digit" value="{{item.discountrate}}" data-name="discountrate" data-index="{{index}}" bindblur="onBlur" />
+                <input class="input" style="width: 130rpx;" disabled='{{disabled}}' type="digit" value="{{item.discountrate}}" data-name="discountrate" data-index="{{index}}" bindblur="onBlur" />
             </view>
         </view>
     </view>