zhaoxiaohai 3 лет назад
Родитель
Сommit
627dec6cda

+ 14 - 52
packageA/opponent/add.js

@@ -3,7 +3,6 @@ let _Http = getApp().globalData.http,
 Page({
     data: {
         showAll: false,
-        queryShow: false,
         repetitionShow: false,
         repetitionList: [],
         isSubmit: false,
@@ -85,64 +84,27 @@ Page({
             })
         }
     },
-    /* 引入 */
-    introduce(e) {
-        let {
-            item
-        } = e.currentTarget.dataset,
-            that = this;
-        wx.showModal({
-            title: '提示',
-            content: `是否确定引入“${item.companyName}”信息`,
-            complete: (res) => {
-                if (res.confirm) {
-                    that.setData({
-                        [`form[0].value`]: item.companyName,
-                        queryShow: false,
-                        queryList: null
-                    })
-                }
-            }
+    introduce({
+        detail
+    }) {
+        let item = detail;
+        this.setData({
+            [`form[0].value`]: item.companyName
         })
     },
-    /* 工商查询 */
-    queryClient(e) {
+    queryClient() {
         let data = this.selectComponent("#Form").query();
-        this.setData({
-            form: this.data.form.map(v => {
-                v.value = data[v.valueName];
-                return v
-            }),
-        })
-        console.log(this.data.form)
-        if (data.enterprisename == '') return wx.showToast({
-            title: `您还未填写企业名称`,
-            icon: "none"
-        });
-        _Http.basic({
-            id: 20221208103601,
-            content: {
-                pageNumber: 1,
-                pageTotal: 1,
-                pageSize: 5,
-                keyword: data.enterprisename,
-            }
-        }).then(res => {
-            console.log("工商查询", res)
-            if (!res.data[0]) return wx.showToast({
-                title: '未查询到相关企业!',
+        if (data.enterprisename == '') {
+            wx.showToast({
+                title: `您还未填写企业名称`,
                 icon: "none"
             });
+        } else {
             this.setData({
-                queryList: res.data,
-                queryShow: true
+                form: this.selectComponent("#Form").data.form,
             })
-        })
-    },
-    onClose() {
-        this.setData({
-            queryShow: false
-        })
+            this.selectComponent("#Info").queryClient(data.enterprisename)
+        }
     },
     repClose() {
         if (this.data.isSubmit) {

+ 1 - 16
packageA/opponent/add.wxml

@@ -1,7 +1,7 @@
 <Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
 <Yl_field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm'>
     <view slot='info'>
-        <information catchtap='queryClient' />
+        <information id="Info" catchtap='queryClient' catch:callback='introduce' />
     </view>
 </Yl_field>
 <view style="height: 100rpx;" />
@@ -11,21 +11,6 @@
     <van-button custom-class='new-submit' disabled='{{disabled}}' bindclick='submit'>提交</van-button>
 </view>
 
-<!-- 工商查询 -->
-<van-popup show="{{ queryShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="onClose">
-    <view class="title">
-        工商查询
-        <van-icon custom-class='icon' size='40rpx' name="cross" bindtap="onClose" />
-    </view>
-    <navigator url="#" class="enterprise" wx:for="{{queryList}}" wx:key="item.ocid" data-item="{{item}}" bindtap="introduce">
-        <view class="enterprise_title">{{item.companyName}}</view>
-        <view class="exp">法人:{{item.legalPerson}} <text style="margin-left: 20rpx;">状态:{{item.bizStatus}}</text></view>
-        <view class="exp">税号:{{item.taxNum}}</view>
-        <!-- <view class="exp">地区:{{item.regProvince + item.regCity+item.regArea}}</view> -->
-        <view class="exp">地址:{{item.address}}</view>
-    </navigator>
-</van-popup>
-
 <!-- 查重 -->
 <van-popup show="{{ repetitionShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="repClose">
     <view class="title">

+ 24 - 60
packageA/publicCustomer/addAndEditor.js

@@ -3,7 +3,6 @@ let _Http = getApp().globalData.http,
 
 Page({
     data: {
-        queryShow: false,
         repetitionShow: false,
         repetitionList: [],
         isSubmit: false,
@@ -176,75 +175,40 @@ Page({
             })
         }
     },
-    /* 引入 */
-    introduce(e) {
-        let {
-            item
-        } = e.currentTarget.dataset,
-            that = this;
-        wx.showModal({
-            title: '提示',
-            content: `是否确定引入“${item.companyName}”信息`,
-            complete: (res) => {
-                if (res.confirm) {
-                    let data = {
-                        enterprisename: item.companyName, //企业名称
-                        taxno: item.taxNum, //税号
-                        contact: item.legalPerson, //法人
-                        region: [item.regProvince, item.regCity, item.regArea], //地区
-                        address: item.address, //地区
-                    }
-                    that.setData({
-                        form: that.data.form.map(v => {
-                            if (data[v.valueName]) v.value = data[v.valueName];
-                            return v
-                        }),
-                        queryShow: false,
-                        queryList: null
-                    })
-                }
-            }
-        })
-
-    },
     /* 工商查询 */
-    queryClient(e) {
-        let data = this.selectComponent("#Form").query();
+    introduce({
+        detail
+    }) {
+        let item = detail;
+        let data = {
+            enterprisename: item.companyName, //企业名称
+            taxno: item.taxNum, //税号
+            contact: item.legalPerson, //法人
+            region: [item.regProvince, item.regCity, item.regArea], //地区
+            address: item.address, //地区
+        }
         this.setData({
             form: this.data.form.map(v => {
-                v.value = data[v.valueName];
+                if (data[v.valueName]) v.value = data[v.valueName];
                 return v
             }),
+
         })
-        console.log(this.data.form)
-        if (data.enterprisename == '') return wx.showToast({
-            title: `您还未填写企业名称`,
-            icon: "none"
-        });
-        _Http.basic({
-            id: 20221208103601,
-            content: {
-                pageNumber: 1,
-                pageTotal: 1,
-                pageSize: 5,
-                keyword: data.enterprisename,
-            }
-        }).then(res => {
-            console.log("工商查询", res)
-            if (!res.data[0]) return wx.showToast({
-                title: '未查询到相关企业!',
+    },
+    /* 工商查询 */
+    queryClient() {
+        let data = this.selectComponent("#Form").query();
+        if (data.enterprisename == '') {
+            wx.showToast({
+                title: `您还未填写企业名称`,
                 icon: "none"
             });
+        } else {
             this.setData({
-                queryList: res.data,
-                queryShow: true
+                form: this.selectComponent("#Form").data.form,
             })
-        })
-    },
-    onClose() {
-        this.setData({
-            queryShow: false
-        })
+            this.selectComponent("#Info").queryClient(data.enterprisename)
+        }
     },
     repClose() {
         if (this.data.isSubmit) {

+ 1 - 17
packageA/publicCustomer/addAndEditor.wxml

@@ -1,7 +1,7 @@
 <Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
 <Yl_field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm'>
     <view slot='info'>
-        <information catchtap='queryClient' />
+        <information id="Info" catchtap='queryClient' catch:callback='introduce' />
     </view>
 </Yl_field>
 <view style="height: 112rpx;" />
@@ -10,22 +10,6 @@
     <van-button custom-class='new-submit' disabled='{{disabled}}' bindclick='submit'>提交</van-button>
 </view>
 
-<!-- 工商查询 -->
-<van-popup show="{{ queryShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="onClose">
-    <view class="title">
-        工商查询
-        <van-icon custom-class='icon' size='40rpx' name="cross" bindtap="onClose" />
-    </view>
-    <navigator url="#" class="enterprise" wx:for="{{queryList}}" wx:key="item.ocid" data-item="{{item}}" bindtap="introduce">
-        <view class="enterprise_title">{{item.companyName}}</view>
-        <view class="exp">法人:{{item.legalPerson}} <text style="margin-left: 20rpx;">状态:{{item.bizStatus}}</text></view>
-        <view class="exp">税号:{{item.taxNum}}</view>
-        <!-- <view class="exp">地区:{{item.regProvince + item.regCity+item.regArea}}</view> -->
-        <view class="exp">地址:{{item.address}}</view>
-    </navigator>
-</van-popup>
-
-
 <!-- 查重 -->
 <van-popup show="{{ repetitionShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="repClose">
     <view class="title">

+ 33 - 71
packageA/setclient/addAndEditor.js

@@ -4,7 +4,6 @@ let _Http = getApp().globalData.http,
 Page({
     data: {
         showAll: false,
-        queryShow: false,
         repetitionShow: false,
         repetitionList: [],
         isSubmit: false,
@@ -126,6 +125,39 @@ Page({
         disabled: true,
         countDown: "", //查重倒计时
     },
+    queryClient() {
+        let data = this.selectComponent("#Form").query();
+        if (data.enterprisename == '') {
+            wx.showToast({
+                title: `您还未填写企业名称`,
+                icon: "none"
+            });
+        } else {
+            this.setData({
+                form: this.selectComponent("#Form").data.form,
+            })
+            this.selectComponent("#Info").queryClient(data.enterprisename)
+        }
+    },
+    /* 工商查询 */
+    introduce({
+        detail
+    }) {
+        let item = detail;
+        let data = {
+            enterprisename: item.companyName, //企业名称
+            taxno: item.taxNum, //税号
+            contact: item.legalPerson, //法人
+            region: [item.regProvince, item.regCity, item.regArea], //地区
+            address: item.address, //地区
+        }
+        this.setData({
+            form: this.data.form.map(v => {
+                if (data[v.valueName]) v.value = data[v.valueName];
+                return v
+            })
+        })
+    },
     setOption(item) {
         let i = this.data.form.findIndex(v => v.valueName == item.valueName);
         this.setData({
@@ -155,76 +187,6 @@ Page({
             })
         }
     },
-    /* 引入 */
-    introduce(e) {
-        let {
-            item
-        } = e.currentTarget.dataset,
-            that = this;
-        wx.showModal({
-            title: '提示',
-            content: `是否确定引入“${item.companyName}”信息`,
-            complete: (res) => {
-                if (res.confirm) {
-                    let data = {
-                        enterprisename: item.companyName, //企业名称
-                        taxno: item.taxNum, //税号
-                        contact: item.legalPerson, //法人
-                        region: [item.regProvince, item.regCity, item.regArea], //地区
-                        address: item.address, //地区
-                    }
-                    that.setData({
-                        form: that.data.form.map(v => {
-                            if (data[v.valueName]) v.value = data[v.valueName];
-                            return v
-                        }),
-                        queryShow: false,
-                        queryList: null
-                    })
-                }
-            }
-        })
-
-    },
-    /* 工商查询 */
-    queryClient(e) {
-        let data = this.selectComponent("#Form").query();
-        this.setData({
-            form: this.data.form.map(v => {
-                v.value = data[v.valueName];
-                return v
-            }),
-        })
-        console.log(this.data.form)
-        if (data.enterprisename == '') return wx.showToast({
-            title: `您还未填写企业名称`,
-            icon: "none"
-        });
-        _Http.basic({
-            id: 20221208103601,
-            content: {
-                pageNumber: 1,
-                pageTotal: 1,
-                pageSize: 5,
-                keyword: data.enterprisename,
-            }
-        }).then(res => {
-            console.log("工商查询", res)
-            if (!res.data[0]) return wx.showToast({
-                title: '未查询到相关企业!',
-                icon: "none"
-            });
-            this.setData({
-                queryList: res.data,
-                queryShow: true
-            })
-        })
-    },
-    onClose() {
-        this.setData({
-            queryShow: false
-        })
-    },
     repClose() {
         if (this.data.isSubmit) {
             let that = this;

+ 1 - 16
packageA/setclient/addAndEditor.wxml

@@ -1,7 +1,7 @@
 <Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
 <Yl_field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm'>
     <view slot='info'>
-        <information catchtap='queryClient' />
+        <information id="Info" catchtap='queryClient' catch:callback='introduce' />
     </view>
 </Yl_field>
 <view style="height: 112rpx;" />
@@ -10,21 +10,6 @@
     <van-button custom-class='new-submit' disabled='{{disabled}}' bindclick='submit'>提交</van-button>
 </view>
 
-<!-- 工商查询 -->
-<van-popup show="{{ queryShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="onClose">
-    <view class="title">
-        工商查询
-        <van-icon custom-class='icon' size='40rpx' name="cross" bindtap="onClose" />
-    </view>
-    <navigator url="#" class="enterprise" wx:for="{{queryList}}" wx:key="item.ocid" data-item="{{item}}" bindtap="introduce">
-        <view class="enterprise_title">{{item.companyName}}</view>
-        <view class="exp">法人:{{item.legalPerson}} <text style="margin-left: 20rpx;">状态:{{item.bizStatus}}</text></view>
-        <view class="exp">税号:{{item.taxNum}}</view>
-        <!-- <view class="exp">地区:{{item.regProvince + item.regCity+item.regArea}}</view> -->
-        <view class="exp">地址:{{item.address}}</view>
-    </navigator>
-</van-popup>
-
 <!-- 查重 -->
 <van-popup show="{{ repetitionShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="repClose">
     <view class="title">

+ 52 - 1
packageA/setclient/modules/information/index.js

@@ -1,8 +1,59 @@
+let _Http = getApp().globalData.http;
 Component({
     properties: {
+        callback: Function
     },
     data: {
+        queryShow: false,
     },
     methods: {
+        /* 引入 */
+        introduce(e) {
+            let {
+                item
+            } = e.currentTarget.dataset,
+                that = this;
+            wx.showModal({
+                title: '提示',
+                content: `是否确定引入“${item.companyName}”信息`,
+                complete: (res) => {
+                    if (res.confirm) {
+                        that.setData({
+                            queryShow: false,
+                            queryList: null
+                        })
+                        that.triggerEvent("callback", item)
+                        
+                    }
+                }
+            })
+        },
+        /* 工商查询 */
+        queryClient(enterprisename) {
+            _Http.basic({
+                id: 20221208103601,
+                content: {
+                    pageNumber: 1,
+                    pageTotal: 1,
+                    pageSize: 5,
+                    keyword: enterprisename,
+                }
+            }).then(res => {
+                console.log("工商查询", res)
+                if (!res.data[0]) return wx.showToast({
+                    title: '未查询到相关企业!',
+                    icon: "none"
+                });
+                this.setData({
+                    queryList: res.data,
+                    queryShow: true
+                })
+            })
+        },
+        onClose() {
+            this.setData({
+                queryShow: false
+            })
+        },
     }
-})
+})

+ 50 - 0
packageA/setclient/modules/information/index.scss

@@ -9,4 +9,54 @@
     font-family: PingFang SC-Bold, PingFang SC;
     font-weight: bold;
     color: #3874F6;
+}
+
+.popup {
+    .title {
+        position: sticky;
+        height: 80rpx;
+        line-height: 80rpx;
+        width: 100%;
+        text-align: center;
+        border-bottom: 1rpx solid #ddd;
+        font-weight: 600;
+        color: #333;
+        top: 0;
+        background-color: #fff;
+
+        .icon {
+            position: absolute;
+            right: 28rpx;
+            top: 22rpx;
+            color: #999;
+        }
+    }
+
+    .enterprise {
+        width: 100%;
+        box-sizing: border-box;
+        padding-left: 30rpx;
+        padding-right: 10rpx;
+        padding-bottom: 10rpx;
+        border-bottom: 1rpx solid #ddd;
+        margin-top: 10rpx;
+        text-align: left;
+
+
+        &_title {
+            line-height: 40rpx;
+            font-size: 28rpx;
+            font-family: PingFang SC-Bold, PingFang SC;
+            font-weight: bold;
+            color: #333333;
+        }
+
+        .exp {
+            line-height: 34rpx;
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            margin-top: 8rpx;
+        }
+    }
 }

+ 17 - 3
packageA/setclient/modules/information/index.wxml

@@ -1,3 +1,17 @@
-<view class="info">
-    工
-</view>
+<view class="info">工</view>
+
+
+<!-- 工商查询 -->
+<van-popup show="{{ queryShow }}" custom-class='popup' round position="bottom" custom-style="height: 100%;" bind:close="onClose">
+    <view class="title">
+        工商查询
+        <van-icon custom-class='icon' size='40rpx' name="cross" bindtap="onClose" />
+    </view>
+    <navigator url="#" class="enterprise" wx:for="{{queryList}}" wx:key="item.ocid" data-item="{{item}}" bindtap="introduce">
+        <view class="enterprise_title">{{item.companyName}}</view>
+        <view class="exp">法人:{{item.legalPerson}} <text style="margin-left: 20rpx;">状态:{{item.bizStatus}}</text></view>
+        <view class="exp">税号:{{item.taxNum}}</view>
+        <!-- <view class="exp">地区:{{item.regProvince + item.regCity+item.regArea}}</view> -->
+        <view class="exp">地址:{{item.address}}</view>
+    </navigator>
+</van-popup>