zhangqiOMG 3 lat temu
rodzic
commit
286ea4d730

+ 9 - 0
Eservice/api/http.js

@@ -1,8 +1,17 @@
 var app = getApp(); //引入全局app.js,我们可以在globalData中定义一些公用的数据,比如baseUrl、token
 var app = getApp(); //引入全局app.js,我们可以在globalData中定义一些公用的数据,比如baseUrl、token
 
 
 const request = function (url = "", options) {
 const request = function (url = "", options) {
+<<<<<<< HEAD
   const baseUrl = "http://61.164.207.46:8000/yos/rest/index" + url;
   const baseUrl = "http://61.164.207.46:8000/yos/rest/index" + url;
   // const baseUrl = "http://122.226.136.204:8082/yos/rest/index" + url;
   // const baseUrl = "http://122.226.136.204:8082/yos/rest/index" + url;
+=======
+  // const baseUrl = "http://61.164.207.46:8000/yos/rest/index" + url;
+  const baseUrl = "http://122.226.136.204:8082/yos/rest/index" + url;
+
+//   const baseUrl = "https://oms.idcgroup.com.cn:8079/yos/rest/index" + url;
+
+  console.log(baseUrl)
+>>>>>>> 462eff694c7055755ed096669c0c8b22d191195c
   options.data.accesstoken = wx.getStorageSync('userMsg').token
   options.data.accesstoken = wx.getStorageSync('userMsg').token
   return new Promise((resolve, reject) => {
   return new Promise((resolve, reject) => {
     wx.request({
     wx.request({

+ 6 - 18
app.js

@@ -1,5 +1,3 @@
-
-
 import {
 import {
     ApiModel
     ApiModel
 } from './utils/Api';
 } from './utils/Api';
@@ -10,6 +8,7 @@ App({
         if (options.query.userMsg) {
         if (options.query.userMsg) {
             wx.setStorageSync('userMsg', JSON.parse(options.query.userMsg))
             wx.setStorageSync('userMsg', JSON.parse(options.query.userMsg))
             wx.setStorageSync('auth', JSON.parse(options.query.auth))
             wx.setStorageSync('auth', JSON.parse(options.query.auth))
+            wx.setStorageSync('siteP', JSON.parse(options.query.site));
             //获取用户权限 
             //获取用户权限 
             this.globalData.http.basic({
             this.globalData.http.basic({
                 "classname": "sysmanage.develop.userauth.userauth",
                 "classname": "sysmanage.develop.userauth.userauth",
@@ -25,27 +24,12 @@ App({
                 })
                 })
                 wx.setStorageSync('userauth', res.data);
                 wx.setStorageSync('userauth', res.data);
             });
             });
-            // 查询站点数据
-            this.globalData.http.basic({
-                "classname": "webmanage.site.site",
-                "method": "querySite_Parameter",
-                "content": {}
-            }).then(res => {
-                console.log("跳转进入查询站点数据", res)
-                if (res.msg != '成功') return wx.showToast({
-                    title: res.msg,
-                    icon: "none"
-                });
-                wx.setStorageSync('siteP', res.data);
-            });
-            console.log('跳转进入', wx.getStorageSync('userMsg'))
-            console.log('跳转进入', wx.getStorageSync('auth'))
         }
         }
     },
     },
     initSocket() {
     initSocket() {
         let that = this;
         let that = this;
         this.globalData.SocketTask = wx.connectSocket({
         this.globalData.SocketTask = wx.connectSocket({
-            url: 'wss://meida.cnyunl.com/yos/webSocket/' + wx.getStorageSync('userMsg').token,
+            url: 'wss://oms.idcgroup.com.cn:8079/yos/webSocket/' + wx.getStorageSync('userMsg').token,
             complete: (res) => {
             complete: (res) => {
                 console.log(res)
                 console.log(res)
             }
             }
@@ -73,6 +57,10 @@ App({
             that: null, //保存this
             that: null, //保存this
             callback: function () {}
             callback: function () {}
         },
         },
+<<<<<<< HEAD
         host:"http://61.164.207.46:8000"
         host:"http://61.164.207.46:8000"
+=======
+        host: "http://122.226.136.204:8082"
+>>>>>>> 462eff694c7055755ed096669c0c8b22d191195c
     }
     }
 })
 })

+ 60 - 14
packageA/borrow/index.js

@@ -43,6 +43,9 @@ Page({
     },
     },
     onLoad(options) {
     onLoad(options) {
         this.getList(true)
         this.getList(true)
+        this.setData({
+            userrole: wx.getStorageSync('userrole')
+        })
     },
     },
     /* 处理筛选 */
     /* 处理筛选 */
     handleFilter({
     handleFilter({
@@ -101,27 +104,70 @@ Page({
             })
             })
             getApp().globalData.handleSelect = this.handleCreated.bind(this);
             getApp().globalData.handleSelect = this.handleCreated.bind(this);
         } else {
         } else {
-            _Http.basic({
-                "id": 20230116092702,
-                "content": {
-                    "sa_orderid": 0
-                }
-            }).then(res => {
-                console.log("按个", res)
-                if (res.msg != '成功') return wx.showToast({
-                    title: res.msg,
-                    icon: "none"
-                });
+            if (this.data.userrole == '业务员') {
                 wx.navigateTo({
                 wx.navigateTo({
-                    url: '/packageA/borrow/detail?id=' + res.data.sa_orderid,
+                    url: `/select/agent/index?params=${JSON.stringify({
+                                "id": 20220920083901,
+                                "content": {
+                                    nocache:true,
+                                    "where": {
+                                            "condition": "",
+                                            "type":9,
+                                    }
+                                }
+                        })}&radio=true`,
                 })
                 })
-            })
+                getApp().globalData.handleSelect = this.handleSingle.bind(this);
+            } else {
+                _Http.basic({
+                    "id": 20230116092702,
+                    "content": {
+                        "sa_orderid": 0
+                    }
+                }).then(res => {
+                    console.log("按个", res)
+                    if (res.msg != '成功') return wx.showToast({
+                        title: res.msg,
+                        icon: "none"
+                    });
+                    wx.navigateTo({
+                        url: '/packageA/borrow/detail?id=' + res.data.sa_orderid,
+                    })
+                })
+            }
         }
         }
     },
     },
+    handleSingle({
+        item
+    }) {
+        wx.showModal({
+            title: '提示',
+            content: `是否确定选择"${item.enterprisename}"创建工具借用单?`,
+            complete: (res) => {
+                if (res.confirm) _Http.basic({
+                    "id": 20230116092702,
+                    "content": {
+                        "sa_orderid": 0,
+                        sys_enterpriseid: item.sys_enterpriseid
+                    }
+                }).then(res => {
+                    console.log("按个", res)
+                    if (res.msg != '成功') return wx.showToast({
+                        title: res.msg,
+                        icon: "none"
+                    });
+                    wx.redirectTo({
+                        url: '/packageA/borrow/detail?id=' + res.data.sa_orderid,
+                    })
+                })
+            }
+        })
+
+    },
     handleCreated(e) {
     handleCreated(e) {
         wx.showModal({
         wx.showModal({
             title: '提示',
             title: '提示',
-            content: `是否确认选择“${e.item.billno}”创建借用单`,
+            content: `是否确认选择“${e.item.title}”创建借用单`,
             complete: ({
             complete: ({
                 confirm
                 confirm
             }) => {
             }) => {

+ 2 - 2
packageA/invoice/detail.js

@@ -198,9 +198,9 @@ Page({
         let page = getCurrentPages().find(v => v.__route__ == 'packageA/invoice/index');
         let page = getCurrentPages().find(v => v.__route__ == 'packageA/invoice/index');
         let content = JSON.parse(JSON.stringify(page.data.content));
         let content = JSON.parse(JSON.stringify(page.data.content));
         content.pageNumber = 1;
         content.pageNumber = 1;
-        content.pageSize = page.data.list.length;
+        content.pageSize = page.data.content.pageNumber * page.data.content.pageSize;
         _Http.basic({
         _Http.basic({
-            "id": 20221219133703,
+            "id": 20221216143103,
             "version": 1,
             "version": 1,
             content
             content
         }).then(res => {
         }).then(res => {

+ 4 - 1
packageA/invoice/index.js

@@ -35,6 +35,9 @@ Page({
     },
     },
     onLoad(options) {
     onLoad(options) {
         this.getList(true)
         this.getList(true)
+        this.setData({
+            userrole: wx.getStorageSync('userrole')
+        })
     },
     },
     /* 处理筛选 */
     /* 处理筛选 */
     handleFilter({
     handleFilter({
@@ -49,7 +52,7 @@ Page({
         if (content.pageNumber > content.pageTotal) return;
         if (content.pageNumber > content.pageTotal) return;
         content.where.status = this.data.active;
         content.where.status = this.data.active;
         _Http.basic({
         _Http.basic({
-            "id": 20221219133703, //20221216143103
+            "id": 20221216143103, //20221216143103
             "version": 1,
             "version": 1,
             content
             content
         }).then(res => {
         }).then(res => {

+ 1 - 1
packageA/invoice/index.wxml

@@ -8,7 +8,7 @@
 </van-tabs>
 </van-tabs>
 <view class="total" style="height: 20rpx;" />
 <view class="total" style="height: 20rpx;" />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
-	<List list="{{list}}" />
+	<List list="{{list}}" userrole='{{userrole}}' />
 </Yl_ListBox>
 </Yl_ListBox>
 <!-- 新建浮动按钮 -->
 <!-- 新建浮动按钮 -->
 <Yl_FloatingButton bindtap="toAdd" />
 <Yl_FloatingButton bindtap="toAdd" />

+ 4 - 3
packageA/invoice/modules/list/index.js

@@ -1,5 +1,6 @@
 Component({
 Component({
-  properties: {
-    list: Array
-  },
+    properties: {
+        list: Array,
+        userrole: String
+    },
 })
 })

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

@@ -9,6 +9,14 @@
         <view class="exp">
         <view class="exp">
             税号:{{item.taxno || ' --'}}
             税号:{{item.taxno || ' --'}}
         </view>
         </view>
+        <block wx:if="{{userrole!='经销商'}}">
+            <view class="exp">
+                经销商名称:{{item.agententerprisename || ' --'}}
+            </view>
+            <view class="exp">
+                经销商编号:{{item.agentnum || ' --'}}
+            </view>
+        </block>
         <view class="exp">
         <view class="exp">
             开票单位:{{item.enterprisename || ' --'}}
             开票单位:{{item.enterprisename || ' --'}}
         </view>
         </view>

+ 25 - 11
packageA/market/detail.js

@@ -13,15 +13,18 @@ Page({
             sa_itemgroupid: options.id,
             sa_itemgroupid: options.id,
             itemno: options.itemno
             itemno: options.itemno
         })
         })
+        this.setData({
+            userrole: wx.getStorageSync('userrole')
+        })
         this.getDetail();
         this.getDetail();
     },
     },
     /* 获取详情 */
     /* 获取详情 */
     getDetail() {
     getDetail() {
         _Http.basic({
         _Http.basic({
-            "id": "20221223165503",
+            "id": "20220926142403",
             "content": {
             "content": {
                 "sa_itemgroupid": this.data.sa_itemgroupid,
                 "sa_itemgroupid": this.data.sa_itemgroupid,
-                itemno: this.data.itemno
+                // itemno: this.data.itemno
             }
             }
         }).then(res => {
         }).then(res => {
             console.log("商品详情", res)
             console.log("商品详情", res)
@@ -29,10 +32,21 @@ Page({
                 title: res.msg,
                 title: res.msg,
                 icon: "none"
                 icon: "none"
             })
             })
-            this.handleFiles(res.data.item[0].attinfos)
+            if (res.data.length == 0) {
+                wx.showToast({
+                    title: '未查询到商品',
+                    icon: "none",
+                    mask: true
+                })
+                setTimeout(() => {
+                    wx.navigateBack();
+                }, 500)
+                return;
+            }
+            this.handleFiles(res.data[0].attinfos)
             this.setData({
             this.setData({
-                detail: res.data.item[0],
-                rows: res.data.rows,
+                detail: res.data[0],
+                rows: res.data,
                 loading: false
                 loading: false
             })
             })
         })
         })
@@ -90,10 +104,11 @@ Page({
             item
             item
         } = e.currentTarget.dataset;
         } = e.currentTarget.dataset;
         if (item.itemno == this.data.itemno) return;
         if (item.itemno == this.data.itemno) return;
+        this.handleFiles(item.attinfos)
         this.setData({
         this.setData({
+            detail: item,
             itemno: item.itemno
             itemno: item.itemno
-        });
-        this.getDetail();
+        })
     },
     },
     clickBut() {
     clickBut() {
         this.data.detail.tradefield.length >= 2 ? wx.showToast({
         this.data.detail.tradefield.length >= 2 ? wx.showToast({
@@ -111,7 +126,7 @@ Page({
         _Http.basic({
         _Http.basic({
             "id": 20220924095102,
             "id": 20220924095102,
             "content": {
             "content": {
-                "sa_brandid": detail.brand[0].sa_brandid, //品牌id
+                "sa_brandid": detail.brand, //品牌id
                 "itemid": detail.itemid, //货品id
                 "itemid": detail.itemid, //货品id
                 "qty": 1, //数量
                 "qty": 1, //数量
                 "itemno": this.data.itemno, //货品编号
                 "itemno": this.data.itemno, //货品编号
@@ -119,7 +134,6 @@ Page({
             },
             },
         }).then(res => {
         }).then(res => {
             console.log("加入购物车", res)
             console.log("加入购物车", res)
-
             if (res.msg != '成功') return wx.showToast({
             if (res.msg != '成功') return wx.showToast({
                 title: res.msg,
                 title: res.msg,
                 icon: "none"
                 icon: "none"
@@ -130,7 +144,7 @@ Page({
             }, false).then(res => {
             }, false).then(res => {
                 console.log("购物车数量", res)
                 console.log("购物车数量", res)
                 getApp().globalData.num = res.data.num;
                 getApp().globalData.num = res.data.num;
-                this.selectComponent("#Float").setNum(res.data.num)
+                if (this.data.userrole == '经销商') this.selectComponent("#Float").setNum(res.data.num)
                 setTimeout(() => {
                 setTimeout(() => {
                     wx.showToast({
                     wx.showToast({
                         title: '加入成功',
                         title: '加入成功',
@@ -142,6 +156,6 @@ Page({
         })
         })
     },
     },
     onShow() {
     onShow() {
-        this.selectComponent("#Float").setNum(getApp().globalData.num)
+        if (this.data.userrole == '经销商') this.selectComponent("#Float").setNum(getApp().globalData.num)
     },
     },
 })
 })

+ 13 - 12
packageA/market/detail.wxml

@@ -37,7 +37,7 @@
 		选择商品
 		选择商品
 	</view>
 	</view>
 	<view class="product-box">
 	<view class="product-box">
-		<navigator url="#" class="product {{itemno===item.itemno?'active':''}}" wx:for="{{rows}}" wx:key="itemno" bindtap="changeItemno" data-item="{{item}}">{{item.spec}}</navigator>
+		<navigator url="#" class="product {{itemno===item.itemno?'active':''}}" wx:for="{{rows}}" wx:key="itemno" bindtap="changeItemno" data-item="{{item}}">{{item.model}}</navigator>
 	</view>
 	</view>
 </view>
 </view>
 <van-tabs custom-class='tabs' title-active-color='var(--assist)' color='var(--assist)'>
 <van-tabs custom-class='tabs' title-active-color='var(--assist)' color='var(--assist)'>
@@ -58,17 +58,18 @@
 		</view>
 		</view>
 	</van-tab>
 	</van-tab>
 	<van-tab title="产品资料">
 	<van-tab title="产品资料">
-        <Yl_Empty />
+		<Yl_Empty />
 	</van-tab>
 	</van-tab>
 </van-tabs>
 </van-tabs>
-<!-- 底部 -->
-<view style="height: 150rpx;" />
-<view class="footer">
-	<picker wx:if="{{detail.tradefield.length>=2}}" range='{{detail.tradefield}}' range-key='tradefield' bindchange='storage'>
-		<van-button custom-class='but' bindtap="clickBut">加入购物车</van-button>
-	</picker>
-	<van-button wx:else custom-class='but' bindtap="clickBut">加入购物车</van-button>
-</view>
 
 
-<!-- 购物车按钮 -->
-<Float id="Float" />
+<block wx:if="{{userrole!='业务员'}}">
+	<!-- 底部 -->
+	<view style="height: 150rpx;" />
+	<view class="footer">
+		<picker wx:if="{{detail.tradefield.length>=2}}" range='{{detail.tradefield}}' range-key='tradefield' bindchange='storage'>
+			<van-button custom-class='but' bindtap="clickBut">加入购物车</van-button>
+		</picker>
+		<van-button wx:else custom-class='but' bindtap="clickBut">加入购物车</van-button>
+	</view><!-- 购物车按钮 -->
+	<Float id="Float" />
+</block>

+ 5 - 3
packageA/market/index.js

@@ -27,8 +27,9 @@ Page({
         }]
         }]
     },
     },
     onLoad(options) {
     onLoad(options) {
-        if (options.istool) this.setData({
-            istool: options.istool
+        this.setData({
+            istool: options.istool ? 1 : 0,
+            userrole: wx.getStorageSync('userrole')
         })
         })
         this.getBrand()
         this.getBrand()
         this.getNum();
         this.getNum();
@@ -221,6 +222,7 @@ Page({
     },
     },
     /* 获取购物车数量 */
     /* 获取购物车数量 */
     getNum() {
     getNum() {
+        if (this.data.userrole == '业务员') return;
         _Http.basic({
         _Http.basic({
             "id": 20220927093202,
             "id": 20220927093202,
             "content": {}
             "content": {}
@@ -231,6 +233,6 @@ Page({
         });
         });
     },
     },
     onShow() {
     onShow() {
-        if (getApp().globalData.num) this.selectComponent("#Float").setNum(getApp().globalData.num)
+        if (getApp().globalData.num && this.data.userrole != '业务员') this.selectComponent("#Float").setNum(getApp().globalData.num)
     }
     }
 })
 })

+ 1 - 1
packageA/market/index.wxml

@@ -19,4 +19,4 @@
 <Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
 <Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
 
 
 <!-- 购物车按钮 -->
 <!-- 购物车按钮 -->
-<Float id="Float" pageType="{{istool==0?'Standard':'Tool'}}" />
+<Float wx:if="{{userrole!='业务员'}}" id="Float" pageType="{{istool==0?'Standard':'Tool'}}" />

+ 162 - 111
packageA/orderForm/add/add.js

@@ -1,114 +1,165 @@
 const _Http = getApp().globalData.http;
 const _Http = getApp().globalData.http;
+
 Page({
 Page({
-    data: {
-        skeletonShow: false,
-        loading: false,
-        sa_brandid: null,
-        tradefield: null,
-        brandList: [],
-        domainList: [],
-        type: "标准订单",
-    },
-    onLoad(options) {
-        console.log(options)
-        this.setData({
-            type: options.type || '标准订单',
-            sa_projectid: options.sa_projectid || 0,
-            sa_contractid: options.sa_contractid || 0,
-        })
-        this.getBrand();
-        this.getDomain();
-    },
-    /* 获取品牌 */
-    getBrand() {
-        _Http.basic({
-            "id": 20220924163702,
-            "content": {
-                "pageSize": 999,
-            }
-        }).then(res => {
-            console.log("查询品牌", res)
-            if (res.data.length) this.setData({
-                brandList: res.data,
-                sa_brandid: res.data[0].sa_brandid
-            });
-        })
-    },
-    /* 选择品牌 */
-    onSelectBrand(e) {
-        let {
-            item
-        } = e.currentTarget.dataset;
-        if (this.data.sa_brandid == item.sa_brandid) return;
-        this.setData({
-            sa_brandid: item.sa_brandid
-        })
-    },
-    /* 获取领域 */
-    getDomain() {
-        _Http.basic({
-            "id": 20221223141802,
-            "content": {
-                "pageNumber": 1,
-                "pageSize": 99999,
-                "where": {
-                    "condition": ""
-                }
-            }
-        }).then(res => {
-            console.log("获取领域", res)
-            if (res.data.length) this.setData({
-                domainList: res.data,
-                tradefield: res.data[0].tradefield,
-                skeletonShow: false
-            });
-        })
-    },
-    /* 选择领域 */
-    onSelect(e) {
-        let {
-            item
-        } = e.currentTarget.dataset;
-        if (this.data.tradefield == item.tradefield) return;
-        this.setData({
-            tradefield: item.tradefield
-        })
-    },
-    submit() {
-        if (this.data.loading) return;
-        this.setData({
-            loading: true
-        })
-        _Http.basic({
-            "id": 20221108111402,
-            content: {
-                sa_orderid: 0,
-                sa_accountclassid: 0,
-                rec_contactsid: 0,
-                pay_enterpriseid: 0,
-                sa_contractid: this.data.sa_contractid,
-                sa_projectid: this.data.sa_projectid,
-                "sa_brandid": this.data.sa_brandid, //品牌ID
-                "type": this.data.type, //订单类型
-                "tradefield": this.data.tradefield, //必选
-            }
-        }).then(res => {
-            this.setData({
-                loading: false
-            })
-            console.log("创建标准订单", res);
-            wx.showToast({
-                title: res.msg != '成功' ? res.msg : '创建成功',
-                icon: "none",
-                mask: true
-            });
-            if (res.msg == '成功') setTimeout(() => {
-                wx.redirectTo({
-                    url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
-                });
-                let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
-                if (page) page.getList(true);
-            }, 500)
-        })
-    }
+	data: {
+		agency: {
+			sys_enterpriseid: 0
+		},
+		skeletonShow: false,
+		loading: false,
+		sa_brandid: null,
+		tradefield: null,
+		brandList: [],
+		domainList: [],
+		type: "标准订单",
+	},
+	onLoad(options) {
+		this.setData({
+			type: options.type || '标准订单',
+			sa_projectid: options.sa_projectid || 0,
+			sa_contractid: options.sa_contractid || 0,
+			userrole: wx.getStorageSync('userrole')
+		})
+		this.getBrand();
+		this.getDomain();
+	},
+	/* 获取品牌 */
+	getBrand() {
+		_Http.basic({
+			"id": 20220924163702,
+			"content": {
+				"pageSize": 999,
+			}
+		}).then(res => {
+			console.log("查询品牌", res)
+			if (res.data.length) this.setData({
+				brandList: res.data,
+				sa_brandid: res.data[0].sa_brandid
+			});
+		})
+	},
+	/* 选择品牌 */
+	onSelectBrand(e) {
+		let {
+			item
+		} = e.currentTarget.dataset;
+		if (this.data.sa_brandid == item.sa_brandid) return;
+		this.setData({
+			sa_brandid: item.sa_brandid
+		})
+	},
+	/* 获取领域 */
+	getDomain() {
+		_Http.basic({
+			"id": 20221223141802,
+			"content": {
+				"pageNumber": 1,
+				"pageSize": 99999,
+				"where": {
+					"condition": ""
+				}
+			}
+		}).then(res => {
+			console.log("获取领域", res)
+			if (res.data.length) this.setData({
+				domainList: res.data,
+				tradefield: res.data[0].tradefield,
+				skeletonShow: false
+			});
+		})
+	},
+	/* 选择领域 */
+	onSelect(e) {
+		let {
+			item
+		} = e.currentTarget.dataset;
+		if (this.data.tradefield == item.tradefield) return;
+		this.setData({
+			tradefield: item.tradefield
+		})
+	},
+	submit() {
+		if (this.data.userrole == '业务员' && !this.data.agency.sys_enterpriseid) {
+			let that = this;
+			wx.showModal({
+				title: '提示',
+				content: '您还未选择经销商!是否立即前往',
+				complete: (res) => {
+					if (res.confirm) that.selectAgency()
+				}
+			})
+			return;
+		};
+		if (this.data.loading) return;
+		this.setData({
+			loading: true
+		})
+		_Http.basic({
+			"id": 20221108111402,
+			content: {
+				sa_orderid: 0,
+				sa_accountclassid: 0,
+				rec_contactsid: 0,
+				pay_enterpriseid: 0,
+				sa_contractid: this.data.sa_contractid,
+				sa_projectid: this.data.sa_projectid,
+				"sa_brandid": this.data.sa_brandid, //品牌ID
+				"type": this.data.type, //订单类型
+				"tradefield": this.data.tradefield, //必选
+				sys_enterpriseid: this.data.agency.sys_enterpriseid
+			}
+		}).then(res => {
+			this.setData({
+				loading: false
+			})
+			console.log("创建标准订单", res);
+			wx.showToast({
+				title: res.msg != '成功' ? res.msg : '创建成功',
+				icon: "none",
+				mask: true
+			});
+			if (res.msg == '成功') setTimeout(() => {
+				wx.redirectTo({
+					url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
+				});
+				let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
+				if (page) page.getList(true);
+			}, 500)
+		})
+	},
+	/* 业务员逻辑 ↓ */
+	selectAgency() {
+		wx.navigateTo({
+			url: `/select/agent/index?params=${JSON.stringify({
+							"id": 20220920083901,
+							"content": {
+								nocache:true,
+								"where": {
+										"condition": "",
+										"type":1,
+										"typemx":this.data.type=='标准订单'?"经销商合作协议":""
+								}
+							}
+					})}&radio=true`,
+		})
+		getApp().globalData.handleSelect = this.setAgency.bind(this);
+	},
+	/* 设置经销商 */
+	setAgency({
+		item
+	}) {
+		let that = this;
+		wx.showModal({
+			title: '提示',
+			content: `是否确定选择"${item.enterprisename}"作为指定经销商?`,
+			complete: (res) => {
+				if (res.confirm) {
+					that.setData({
+						agency: item
+					})
+					wx.navigateBack()
+				}
+			}
+		})
+	}
 })
 })

+ 90 - 74
packageA/orderForm/add/add.scss

@@ -1,92 +1,108 @@
 @import "./add.skeleton.wxss";
 @import "./add.skeleton.wxss";
 
 
 page {
 page {
-	background-color: #fff;
+    background-color: #fff;
 }
 }
 
 
 .groud {
 .groud {
-	width: 100%;
-	padding: 30rpx;
-	border-bottom: 1px solid #DDDDDD;
+    width: 100%;
+    padding: 30rpx;
+    border-bottom: 1px solid #DDDDDD;
 
 
-	.label {
-		height: 60rpx;
-		font-size: 32rpx;
-		font-family: PingFang SC-Regular, PingFang SC;
-		font-weight: bold;
-		color: #333333;
-	}
+    .label {
+        height: 60rpx;
+        font-size: 32rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+    }
 
 
-	.content {
-		display: flex;
-		flex-wrap: wrap;
-		width: 100%;
+    .content {
+        display: flex;
+        flex-wrap: wrap;
+        width: 100%;
 
 
-		.but {
-			min-width: 188rpx;
-			height: 72rpx;
-			background: #F5F5F5;
-			border-radius: 8rpx;
-			font-size: 28rpx;
-			font-family: PingFang SC-Regular, PingFang SC;
-			color: #333333;
-			box-sizing: border-box;
-			margin-right: 20rpx;
-			margin-top: 20rpx;
-			padding: 0 30rpx;
-		}
+        .but {
+            min-width: 188rpx;
+            height: 72rpx;
+            background: #F5F5F5;
+            border-radius: 8rpx;
+            font-size: 28rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #333333;
+            box-sizing: border-box;
+            margin-right: 20rpx;
+            margin-top: 20rpx;
+            padding: 0 30rpx;
+        }
 
 
-		.active {
-			border: 1px solid #3874F6;
-			color: #3874F6;
-			font-weight: bold;
-			background-color: #F5F5F5;
-		}
-	}
+        .active {
+            border: 1px solid #3874F6;
+            color: #3874F6;
+            font-weight: bold;
+            background-color: #F5F5F5;
+        }
+    }
 
 
-	.time {
-		.partition {
-			margin-right: 20rpx;
-			display: flex;
-			align-items: center;
-		}
+    .time {
+        .partition {
+            margin-right: 20rpx;
+            display: flex;
+            align-items: center;
+        }
 
 
-		.tbox {
-			width: 220rpx;
-			height: 72rpx;
-			text-align: center;
-			line-height: 72rpx;
-			background: #F5F5F5;
-			border-radius: 8rpx;
-			font-size: 28rpx;
-			font-family: PingFang SC-Regular, PingFang SC;
-			color: #333333;
-			box-sizing: border-box;
-			margin-right: 20rpx;
-			margin-top: 20rpx;
-		}
-	}
+        .tbox {
+            width: 220rpx;
+            height: 72rpx;
+            text-align: center;
+            line-height: 72rpx;
+            background: #F5F5F5;
+            border-radius: 8rpx;
+            font-size: 28rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #333333;
+            box-sizing: border-box;
+            margin-right: 20rpx;
+            margin-top: 20rpx;
+        }
+    }
+
+    .agency {
+        font-family: PingFang SC-Regular, PingFang SC;
+        margin-left: 10rpx;
+        .title {
+            font-size: 28rpx;
+            color: #333;
+            font-weight: bold;
+        }
+
+        .exp {
+            color: #666;
+            font-size: 26rpx;
+            margin-top: 14rpx;
+        }
+    }
 }
 }
 
 
 
 
 .footer {
 .footer {
-	display: flex;
-	justify-content: center;
-	position: fixed;
-	bottom: 0;
-	width: 100vw;
-	min-height: 130rpx;
-	background-color: #fff;
-	box-shadow: rgba(0, 0, 0, 0.15) 0px 5rpx 15rpx 0px;
+    display: flex;
+    justify-content: center;
+    position: fixed;
+    bottom: 0;
+    width: 100vw;
+    min-height: 130rpx;
+    background-color: #fff;
+    box-shadow: rgba(0, 0, 0, 0.15) 0px 5rpx 15rpx 0px;
 
 
-	.but {
-		width: 690rpx;
-		height: 90rpx;
-		background: #FA8C16;
-		border-radius: 16rpx;
-		font-size: 28rpx;
-		font-weight: 600;
-		color: #FFFFFF;
-		margin-top: 10rpx;
-	}
+    .but {
+        width: 690rpx;
+        height: 90rpx;
+        background: #FA8C16;
+        border-radius: 16rpx;
+        font-size: 28rpx;
+        font-weight: 600;
+        color: #FFFFFF;
+        margin-top: 10rpx;
+    }
 }
 }

+ 29 - 14
packageA/orderForm/add/add.wxml

@@ -1,24 +1,39 @@
-<import src="add.skeleton.wxml"/>
+<import src="add.skeleton.wxml" />
 <template is="skeleton" wx:if="{{skeletonShow}}" />
 <template is="skeleton" wx:if="{{skeletonShow}}" />
 
 
 <view class="groud">
 <view class="groud">
-	<view class="label">
-		选择品牌
-	</view>
-	<view class="content">
-		<van-button custom-class='but {{item.sa_brandid==sa_brandid?"active":""}}' wx:for="{{brandList}}" wx:key="sa_brandid" data-item="{{item}}" bindtap="onSelectBrand">{{item.brandname}}</van-button>
-	</view>
+    <view class="label">
+        选择品牌
+    </view>
+    <view class="content">
+        <van-button custom-class='but {{item.sa_brandid==sa_brandid?"active":""}}' wx:for="{{brandList}}" wx:key="sa_brandid" data-item="{{item}}" bindtap="onSelectBrand">{{item.brandname}}</van-button>
+    </view>
 </view>
 </view>
 <view class="groud">
 <view class="groud">
-	<view class="label">
-		选择领域
-	</view>
-	<view class="content">
-		<van-button custom-class='but {{item.tradefield==tradefield?"active":""}}' wx:for="{{domainList}}" wx:key="sys_enterprise_tradefieldid" data-item="{{item}}" bindtap="onSelect">{{item.tradefield}}</van-button>
-	</view>
+    <view class="label">
+        选择领域
+    </view>
+    <view class="content">
+        <van-button custom-class='but {{item.tradefield==tradefield?"active":""}}' wx:for="{{domainList}}" wx:key="sys_enterprise_tradefieldid" data-item="{{item}}" bindtap="onSelect">{{item.tradefield}}</van-button>
+    </view>
 </view>
 </view>
+<navigator wx:if="{{userrole!='经销商'}}" url="#" class="groud" bindtap="selectAgency">
+    <view class="label jxs">
+        指定经销商:
+    </view>
+    <view class="agency" wx:if="{{agency.sys_enterpriseid}}">
+        <view class="title">
+            {{agency.enterprisename||" --"}}
+        </view>
+        <view class="exp">联系人:{{agency.changeby||" --"}} {{agency.phonenumber||" --"}}</view>
+        <view class="exp">详细地址:{{agency.province+agency.city+agency.county+agency.address||" --"}}</view>
+    </view>
+    <view wx:else>
+        点击选择经销商
+    </view>
+</navigator>
 <!-- 底部 -->
 <!-- 底部 -->
 <view style="height: 150rpx;" />
 <view style="height: 150rpx;" />
 <view class="footer">
 <view class="footer">
-	<van-button custom-class='but' loading='{{loading}}' loading-text='创建中...' bindtap="submit">创建订单</van-button>
+    <van-button custom-class='but' loading='{{loading}}' loading-text='创建中...' bindtap="submit">创建订单</van-button>
 </view>
 </view>

+ 24 - 19
packageA/orderForm/detail.js

@@ -27,25 +27,11 @@ Page({
     onLoad(options) {
     onLoad(options) {
         this.setData({
         this.setData({
             sa_orderid: options.id,
             sa_orderid: options.id,
-            order_rebate_used: wx.getStorageSync('siteP').order_rebate_used
+            order_rebate_used: wx.getStorageSync('siteP').order_rebate_used,
+            userrole: wx.getStorageSync('userrole')
         });
         });
         this.getDetail(true);
         this.getDetail(true);
 
 
-        //获取企业免邮额度
-        _Http.basic({
-            "id": 20220920084001,
-            "content": {},
-        }).then(res => {
-            console.log("查询企业档案", res)
-            if (res.msg != '成功') return wx.showToast({
-                title: res.msg,
-                icon: "none"
-            })
-            this.setData({
-                figure: res.data.freefreightamount
-            })
-        })
-
         //销售分类
         //销售分类
         _Http.basic({
         _Http.basic({
             "classname": "sysmanage.develop.optiontype.optiontype",
             "classname": "sysmanage.develop.optiontype.optiontype",
@@ -91,7 +77,26 @@ Page({
                 detail: res.data,
                 detail: res.data,
                 loading: false
                 loading: false
             });
             });
-            if (init) this.partialRenewal(true)
+            if (init) {
+                this.partialRenewal(true)
+                let content = {};
+                //业务员根据指定经销商的免运费
+                if (wx.getStorageSync('userrole') == '业务员') content.sys_enterpriseid = this.data.detail.sys_enterpriseid;
+                //获取企业免邮额度
+                _Http.basic({
+                    "id": 20220920084001,
+                    content
+                }, false).then(res => {
+                    console.log("查询企业档案", res)
+                    if (res.msg != '成功') return wx.showToast({
+                        title: res.msg,
+                        icon: "none"
+                    })
+                    this.setData({
+                        figure: res.data.freefreightamount
+                    })
+                })
+            }
         })
         })
     },
     },
     /* 选择销售分类 */
     /* 选择销售分类 */
@@ -576,9 +581,9 @@ Page({
         let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
         let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
         let content = JSON.parse(JSON.stringify(page.data.content));
         let content = JSON.parse(JSON.stringify(page.data.content));
         content.pageNumber = 1;
         content.pageNumber = 1;
-        content.pageSize = page.data.list.length;
+        content.pageSize = page.data.content.pageNumber * page.data.content.pageSize;
         _Http.basic({
         _Http.basic({
-            "id": wx.getStorageSync('userMsg').usertype == 1 ? 20221111145202 : 20221224180302,
+            "id": this.data.userrole == '业务员' ? 20221111145202 : 20221224180302,
             content
             content
         }).then(res => {
         }).then(res => {
             console.log("订单列表", res)
             console.log("订单列表", res)

+ 100 - 99
packageA/orderForm/detail.wxml

@@ -2,124 +2,125 @@
 <template is="skeleton" wx:if="{{loading}}" />
 <template is="skeleton" wx:if="{{loading}}" />
 
 
 <view class="intr">
 <view class="intr">
-    <view class="num">
-        {{detail.sonum}}
-    </view>
-    <view class="tags">
-        <text wx:if="{{detail.brandname}}" style="background-color: #0079FE;">{{detail.brandname}}</text>
-        <text wx:if="{{detail.tradefield}}" style="background-color: #4BD863;">{{detail.tradefield}}</text>
-        <!-- <text wx:if="{{detail.status=='新建' && detail.type=='项目订单'}}" style="background-color: #4BD863;" bindtap="setBraned">设置品牌/领域</text> -->
-    </view>
-    <view class="exp" wx:if="{{detail.type=='项目订单'}}">关联项目:{{detail.projectname || '暂无'}}</view>
-    <view class="exp">订单类型:{{detail.type}}</view>
-    <view class="exp">订单状态:{{detail.status}}</view>
-    <view class="exp">单据日期:{{detail.billdate || '暂无'}}</view>
-    <view class="exp">创建日期:{{detail.createdate}}</view>
-    <view class="exp">核销状态:{{detail.writeoffstatus}}</view>
-    <view class="exp">开票状态:{{detail.invoicestatus}}</view>
-    <van-button custom-class='copy' bindtap="copyItem">一键复制订单</van-button>
+	<view class="num">
+		{{detail.sonum}}
+	</view>
+	<view class="tags">
+		<text wx:if="{{detail.brandname}}" style="background-color: #0079FE;">{{detail.brandname}}</text>
+		<text wx:if="{{detail.tradefield}}" style="background-color: #4BD863;">{{detail.tradefield}}</text>
+		<!-- <text wx:if="{{detail.status=='新建' && detail.type=='项目订单'}}" style="background-color: #4BD863;" bindtap="setBraned">设置品牌/领域</text> -->
+	</view>
+	<view class="exp" wx:if="{{userrole!='经销商'}}">经销商:{{detail.enterprisename || ' --'}}</view>
+	<view class="exp" wx:if="{{detail.type=='项目订单'}}">关联项目:{{detail.projectname || '暂无'}}</view>
+	<view class="exp">订单类型:{{detail.type}}</view>
+	<view class="exp">订单状态:{{detail.status}}</view>
+	<view class="exp">单据日期:{{detail.billdate || '暂无'}}</view>
+	<view class="exp">创建日期:{{detail.createdate}}</view>
+	<view class="exp">核销状态:{{detail.writeoffstatus}}</view>
+	<view class="exp">开票状态:{{detail.invoicestatus}}</view>
+	<van-button custom-class='copy' bindtap="copyItem">一键复制订单</van-button>
 </view>
 </view>
 
 
 <navigator url="#" class="box location" bindtap="selectConsignee">
 <navigator url="#" class="box location" bindtap="selectConsignee">
-    <van-icon custom-class='icon' name="location" />
-    <view class="content">
-        <view class="name">
-            {{detail.contacts.name || '暂无'}}<text>{{detail.contacts.phonenumber}}</text>
-        </view>
-        <view class="address">
-            {{detail.contacts.address}}
-        </view>
-    </view>
-    <view class="iconfont icon-dibu-bianji" />
+	<van-icon custom-class='icon' name="location" />
+	<view class="content">
+		<view class="name">
+			{{detail.contacts.name || '暂无'}}<text>{{detail.contacts.phonenumber}}</text>
+		</view>
+		<view class="address">
+			{{detail.contacts.address}}
+		</view>
+	</view>
+	<view class="iconfont icon-dibu-bianji" />
 </navigator>
 </navigator>
 
 
 <navigator url="#" class="box location" bindtap="selectFinance">
 <navigator url="#" class="box location" bindtap="selectFinance">
-    <view class="content">
-        <view class="name">
-            开票单位
-        </view>
-        <view class="address">
-            {{detail.finance.enterprisename || '暂无'}}
-        </view>
-    </view>
-    <view class="iconfont icon-dibu-bianji" />
+	<view class="content">
+		<view class="name">
+			开票单位
+		</view>
+		<view class="address">
+			{{detail.finance.enterprisename || '暂无'}}
+		</view>
+	</view>
+	<view class="iconfont icon-dibu-bianji" />
 </navigator>
 </navigator>
 
 
 <view class="box pay">
 <view class="box pay">
-    <view class="title">
-        支付信息
-    </view>
-    <navigator url="#" class="row" bindtap="selectAgent">
-        <view class="label">结算人</view>
-        <view style="font-size: 28rpx;">
-            {{detail.pay_enterprisename || '暂无'}}
-            <van-icon name="arrow" />
-        </view>
-    </navigator>
+	<view class="title">
+		支付信息
+	</view>
+	<navigator url="#" class="row" bindtap="selectAgent">
+		<view class="label">结算人</view>
+		<view style="font-size: 28rpx;">
+			{{detail.pay_enterprisename || '暂无'}}
+			<van-icon name="arrow" />
+		</view>
+	</navigator>
 
 
-    <view class="row">
-        <view class="label">支付账户</view>
-        <view style="font-size: 28rpx;">
-            {{detail.accountclass.accountname || '暂无'}}
-        </view>
-    </view>
+	<view class="row">
+		<view class="label">支付账户</view>
+		<view style="font-size: 28rpx;">
+			{{detail.accountclass.accountname || '暂无'}}
+		</view>
+	</view>
 
 
-    <block wx:if="{{order_rebate_used==1 && (detail.type=='标准订单'||detail.type=='特殊订单')}}">
-        <navigator url="#" class="row" style="font-size: 0;" bindtap="changeRebateUsed">
-            <view class="label">是否使用返利金(余额:{{detail.rebatebalance}})</view>
-            <checkbox disabled="{{detail.status!='新建'}}" checked="{{detail.rebate_used==1}}" color='var(--assist)' />
-        </navigator>
-        <view class="row" wx:if="{{detail.rebate_used==1}}">
-            <view class="label">返利金支付(最多订单金额{{detail.order_rebate_userate}})</view>
-            <input disabled="{{detail.status!='新建'}}" bindtap="isEdit" type="digit" class="remarks" placeholder-class='placeholder' value="{{detail.rebateamount}}" placeholder="使用金额" bindblur="setRebate_amount" />
-        </view>
-    </block>
+	<block wx:if="{{order_rebate_used==1 && (detail.type=='标准订单'||detail.type=='特殊订单')}}">
+		<navigator url="#" class="row" style="font-size: 0;" bindtap="changeRebateUsed">
+			<view class="label">是否使用返利金(余额:{{detail.rebatebalance}})</view>
+			<checkbox disabled="{{detail.status!='新建'}}" checked="{{detail.rebate_used==1}}" color='var(--assist)' />
+		</navigator>
+		<view class="row" wx:if="{{detail.rebate_used==1}}">
+			<view class="label">返利金支付(最多订单金额{{detail.order_rebate_userate}})</view>
+			<input disabled="{{detail.status!='新建'}}" bindtap="isEdit" type="digit" class="remarks" placeholder-class='placeholder' value="{{detail.rebateamount}}" placeholder="使用金额" bindblur="setRebate_amount" />
+		</view>
+	</block>
 </view>
 </view>
 
 
 <view class="box" style="padding: 10rpx 30rpx;">
 <view class="box" style="padding: 10rpx 30rpx;">
-    <picker mode="selector" range='{{saletypeList}}' disabled="{{detail.status!='新建'}}" range-key='value' bindchange='setSaletype'>
-        <navigator url="#" class="row" bindtap="selectSaletype">
-            <view class="label">销售分类</view>
-            <view style="font-size: 28rpx;">
-                {{detail.saletype || '前往设置'}}
-                <van-icon name="arrow" />
-            </view>
-        </navigator>
-    </picker>
-    <view class="row">
-        <view class="label">订单备注</view>
-        <textarea disabled="{{detail.status!='新建'}}" bindtap="isEdit" class="remarks" placeholder-class='placeholder' bindblur="changeRemarks" value="{{detail.remarks}}" auto-height placeholder="订单备注" />
-    </view>
-    <view class="row">
-        <view class="label">回签单</view>
-        <van-radio-group direction='horizontal' disabled="{{detail.status!='新建'}}" value="{{ detail.signbackstatus }}" bind:change="changeSignbackstatus">
-            <van-radio icon-size='14px' custom-class='label-class' name="不需要">不需要</van-radio>
-            <van-radio icon-size='14px' custom-class='label-class' name="纸质件">纸质件</van-radio>
-            <van-radio icon-size='14px' custom-class='label-class' name="扫描件">扫描件</van-radio>
-        </van-radio-group>
-    </view>
+	<picker mode="selector" range='{{saletypeList}}' disabled="{{detail.status!='新建'}}" range-key='value' bindchange='setSaletype'>
+		<navigator url="#" class="row" bindtap="selectSaletype">
+			<view class="label">销售分类</view>
+			<view style="font-size: 28rpx;">
+				{{detail.saletype || '前往设置'}}
+				<van-icon name="arrow" />
+			</view>
+		</navigator>
+	</picker>
+	<view class="row">
+		<view class="label">订单备注</view>
+		<textarea disabled="{{detail.status!='新建'}}" bindtap="isEdit" class="remarks" placeholder-class='placeholder' bindblur="changeRemarks" value="{{detail.remarks}}" auto-height placeholder="订单备注" />
+	</view>
+	<view class="row">
+		<view class="label">回签单</view>
+		<van-radio-group direction='horizontal' disabled="{{detail.status!='新建'}}" value="{{ detail.signbackstatus }}" bind:change="changeSignbackstatus">
+			<van-radio icon-size='14px' custom-class='label-class' name="不需要">不需要</van-radio>
+			<van-radio icon-size='14px' custom-class='label-class' name="纸质件">纸质件</van-radio>
+			<van-radio icon-size='14px' custom-class='label-class' name="扫描件">扫描件</van-radio>
+		</van-radio-group>
+	</view>
 </view>
 </view>
 <view style="height: 20rpx;" />
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
-    <Product slot='产品明细' id='Product' disabled="{{detail.status!='新建'}}" />
-    <Yl_Attachment slot='附件' id='Yl_Attachment' ownertable="sa_order" ownerid="{{detail.sa_orderid}}" disabled="{{detail.status!='新建'}}" />
-    <Progress slot='订单进度' id='Progress' />
-    <Invoice slot='发票' id='Invoice' apiId='20221229154102' />
+	<Product slot='产品明细' id='Product' disabled="{{detail.status!='新建'}}" />
+	<Yl_Attachment slot='附件' id='Yl_Attachment' ownertable="sa_order" ownerid="{{detail.sa_orderid}}" disabled="{{detail.status!='新建'}}" />
+	<Progress slot='订单进度' id='Progress' />
+	<Invoice slot='发票' id='Invoice' apiId='20221229154102' />
 </Yl_FunTabs>
 </Yl_FunTabs>
 
 
 <view style="height: 130rpx;" />
 <view style="height: 130rpx;" />
 <view class="footer">
 <view class="footer">
-    <view class="price">
-        <view class="count">
-            ¥{{detail.defaultamount}}元
-        </view>
-        <view>
-            {{detail.defaultamount>=figure?'免运费':'差'+(figure-detail.defaultamount)+'元免运费'}}
-        </view>
-    </view>
-    <view class="but-box">
-        <van-button custom-class='but delete' wx:if="{{detail.status=='新建'}}" bind:click="deleteItem">删除订单</van-button>
-        <van-button custom-class='but' wx:if="{{detail.status=='新建'}}" bind:click="submit">提交订单</van-button>
-        <van-button custom-class='but' wx:if="{{detail.status=='交期待确认'}}" bind:click="notarize">确认交期</van-button>
-    </view>
+	<view class="price">
+		<view class="count">
+			¥{{detail.defaultamount}}元
+		</view>
+		<view>
+			{{detail.defaultamount>=figure?'免运费':'差'+(figure-detail.defaultamount)+'元免运费'}}
+		</view>
+	</view>
+	<view class="but-box">
+		<van-button custom-class='but delete' wx:if="{{detail.status=='新建'}}" bind:click="deleteItem">删除订单</van-button>
+		<van-button custom-class='but' wx:if="{{detail.status=='新建'}}" bind:click="submit">提交订单</van-button>
+		<van-button custom-class='but' wx:if="{{detail.status=='交期待确认'}}" bind:click="notarize">确认交期</van-button>
+	</view>
 </view>
 </view>

+ 4 - 1
packageA/orderForm/index.js

@@ -39,6 +39,9 @@ Page({
         }]
         }]
     },
     },
     onLoad(options) {
     onLoad(options) {
+        this.setData({
+            userrole: wx.getStorageSync('userrole')
+        })
         this.getList()
         this.getList()
         this.getBrand()
         this.getBrand()
         this.getDomain()
         this.getDomain()
@@ -56,7 +59,7 @@ Page({
         if (init) content.pageNumber = 1;
         if (init) content.pageNumber = 1;
         if (content.pageNumber > content.pageTotal) return;
         if (content.pageNumber > content.pageTotal) return;
         _Http.basic({
         _Http.basic({
-            "id": wx.getStorageSync('userMsg').usertype == 1 ? 20221111145202 : 20221224180302,
+            "id": this.data.userrole == '业务员' ? 20221111145202 : 20221224180302,
             content
             content
         }).then(res => {
         }).then(res => {
             console.log("订单列表", res)
             console.log("订单列表", res)

+ 1 - 1
packageA/orderForm/index.wxml

@@ -14,7 +14,7 @@
     共计{{content.total}}单,合计¥{{amount}}
     共计{{content.total}}单,合计¥{{amount}}
 </view>
 </view>
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
-    <List list="{{list}}" />
+    <List list="{{list}}" userrole="{{userrole}}" />
 </Yl_ListBox>
 </Yl_ListBox>
 <!-- 新建浮动按钮 -->
 <!-- 新建浮动按钮 -->
 <Float />
 <Float />

+ 4 - 7
packageA/orderForm/modules/list/index.js

@@ -1,9 +1,6 @@
 Component({
 Component({
-  properties: {
-    list: Array,
-    userrole: {
-      type: String,
-      value: wx.getStorageSync('userrole')
-    }
-  },
+    properties: {
+        list: Array,
+        userrole: String
+    },
 })
 })

+ 7 - 9
packageA/orderForm/modules/list/index.wxml

@@ -13,8 +13,8 @@
         <view class="num">
         <view class="num">
             {{item.type}}:{{item.sonum}}
             {{item.type}}:{{item.sonum}}
         </view>
         </view>
-        <view class="exp" wx:if="{{userrole=='业务员'}}">
-            经销商:{{item.abbreviation || ' --'}}
+        <view class="exp" wx:if="{{userrole!='经销商'}}">
+            经销商:{{item.enterprisename || ' --'}}
         </view>
         </view>
         <view class="exp">
         <view class="exp">
             区域经理:{{item.salename || ' --'}}
             区域经理:{{item.salename || ' --'}}
@@ -29,20 +29,18 @@
             合计:¥{{item.defaultamount}}元
             合计:¥{{item.defaultamount}}元
         </view>
         </view>
     </view>
     </view>
-
-    <view wx:if="{{item.contacts.length}}" class="bottom line-1">
-        <text style="margin-right: 10rpx;">{{item.contacts[0].name}}</text>
-        <text style="margin-right: 10rpx;">{{item.contacts[0].phonenumber}}</text>
-        <text style="margin-right: 10rpx;">{{item.contacts[0].address}}</text>
+    <view wx:if="{{item.contacts.length||item.name}}" class="bottom line-1">
+        <text style="margin-right: 10rpx;">{{item.contacts[0].name||item.name}}</text>
+        <text style="margin-right: 10rpx;">{{item.contacts[0].phonenumber||item.phonenumber}}</text>
+        <text style="margin-right: 10rpx;">{{item.contacts[0].address||item.address}}</text>
     </view>
     </view>
+
     <view wx:else class="bottom">
     <view wx:else class="bottom">
         暂无收货人
         暂无收货人
     </view>
     </view>
 </navigator>
 </navigator>
 
 
 <Yl_Empty wx:if="{{list.length==0}}" />
 <Yl_Empty wx:if="{{list.length==0}}" />
-
-
 <wxs module="set">
 <wxs module="set">
     module.exports = {
     module.exports = {
         color: function (statu) {
         color: function (statu) {

+ 1 - 2
packageA/shipment/index.js

@@ -12,7 +12,6 @@ Page({
 			total: 0,
 			total: 0,
 			"where": {
 			"where": {
 				"condition": "",
 				"condition": "",
-				status: "审核",
 			},
 			},
 			sort: []
 			sort: []
 		},
 		},
@@ -49,7 +48,7 @@ Page({
 		if (init) content.pageNumber = 1;
 		if (init) content.pageNumber = 1;
 		if (content.pageNumber > content.pageTotal) return;
 		if (content.pageNumber > content.pageTotal) return;
 		_Http.basic({
 		_Http.basic({
-			"id": 20230111141104,
+			"id": wx.getStorageSync('userrole') == '业务员' ? 20221122132804 : 20230111141104,
 			content
 			content
 		}).then(res => {
 		}).then(res => {
 			console.log("订单列表", res)
 			console.log("订单列表", res)

+ 6 - 1
packageA/tool/index.js

@@ -8,6 +8,7 @@ Page({
         cType: {},
         cType: {},
         loading: true,
         loading: true,
         "content": {
         "content": {
+            nocache: true,
             "pageNumber": 1,
             "pageNumber": 1,
             "pageTotal": 1,
             "pageTotal": 1,
             "tradefield": "",
             "tradefield": "",
@@ -29,6 +30,9 @@ Page({
         }]
         }]
     },
     },
     onLoad(options) {
     onLoad(options) {
+        this.setData({
+            userrole: wx.getStorageSync('userrole')
+        })
         this.getBrand()
         this.getBrand()
         this.getNum();
         this.getNum();
         this.getDomain();
         this.getDomain();
@@ -186,6 +190,7 @@ Page({
     },
     },
     /* 获取购物车数量 */
     /* 获取购物车数量 */
     getNum() {
     getNum() {
+        if (this.data.userrole == '业务员') return;
         _Http.basic({
         _Http.basic({
             "id": 20220927093202,
             "id": 20220927093202,
             "content": {}
             "content": {}
@@ -196,6 +201,6 @@ Page({
         });
         });
     },
     },
     onShow() {
     onShow() {
-        if (getApp().globalData.num) this.selectComponent("#Float").setNum(getApp().globalData.num)
+        if (this.data.userrole != '业务员' && getApp().globalData.num) this.selectComponent("#Float").setNum(getApp().globalData.num)
     }
     }
 })
 })

+ 1 - 1
packageA/tool/index.wxml

@@ -10,4 +10,4 @@
 <!-- 筛选条件 -->
 <!-- 筛选条件 -->
 <Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
 <Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
 <!-- 购物车按钮 -->
 <!-- 购物车按钮 -->
-<Float id="Float" pageType='Tool' />
+<Float wx:if="{{userrole!='业务员'}}" id="Float" pageType='Tool' />

+ 129 - 72
packageA/toolBill/update.js

@@ -6,81 +6,108 @@ Page({
         showAll: false,
         showAll: false,
         disabled: true,
         disabled: true,
         content: {
         content: {
-          "sa_aftersalesmagid":0,
-          "sa_orderid":"",
-          "reason":"",
-          "isitemreturn":true,
-          "billdate":"",
-          "type":"借用归还单"
+            "sa_aftersalesmagid": 0,
+            "sa_orderid": "",
+            "reason": "",
+            "isitemreturn": true,
+            "billdate": "",
+            "type": "借用归还单"
         },
         },
-        form: [{
-                label: "订单号",
-                error: false,
-                errMsg: "",
-                type: "route",
-                url: "/packageA/toolBill/modules/selectOrder/index",
-                params: {
-                    "id":20230105110003,
-                    "content": {
-                        "pageNumber": 1,
-                        "pageSize": 20,
-                        "where": {
-                            "condition": ""
-                        }
-                    }
-                  },
-                query: '&radio=true',
-                value: "",
-                
-                placeholder: "选择订单号",
-                valueName: "sa_orderid",
-                checking: "base",
-                required: true,
-                interrupt:true
-            },
-            {
-                label: "单据日期",
-                error: false,
-                errMsg: "",
-                type: "date",
-                value: getTime.formatTime(new Date(),'-').split(' ')[0],
-                placeholder: "请选择日期",
-                valueName: "billdate",
-                required: true,
-            },{
-                label: "返退原因",
-                error: false,
-                errMsg: "",
-                type: "texteara",
-                value: "",
-                placeholder: "请输入返退原因",
-                valueName: "reason",
-                required: false,
 
 
-            },{
-                label: "是否实物退回",
-                error: false,
-                errMsg: "",
-                type: "radio",
-                radioList:[
-                  {name:'是',id:1},
-                  {name:'否',id:0},
-                ],
-                value: 1,
-                valueName: "isitemreturn",
-                required: true,
-            },
-        ]
     },
     },
     onLoad(options) {
     onLoad(options) {
+        let form = [{
+            label: "单据日期",
+            error: false,
+            errMsg: "",
+            type: "date",
+            value: getTime.formatTime(new Date(), '-').split(' ')[0],
+            placeholder: "请选择日期",
+            valueName: "billdate",
+            required: true,
+        }, {
+            label: "返退原因",
+            error: false,
+            errMsg: "",
+            type: "texteara",
+            value: "",
+            placeholder: "请输入返退原因",
+            valueName: "reason",
+            required: false,
+
+        }, {
+            label: "是否实物退回",
+            error: false,
+            errMsg: "",
+            type: "radio",
+            radioList: [{
+                    name: '是',
+                    id: 1
+                },
+                {
+                    name: '否',
+                    id: 0
+                },
+            ],
+            value: 1,
+            valueName: "isitemreturn",
+            required: true,
+        }];
+        form.unshift(wx.getStorageSync('userrole') == '业务员' ? {
+            label: "所属经销商",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/select/agent/index",
+            params: {
+                "id": 20220920083901,
+                "content": {
+                    nocache: true,
+                    "where": {
+                        "condition": "",
+                        "type": 9,
+                    }
+                }
+            },
+            query: '&radio=true&idname=sys_enterpriseid',
+            value: "",
+            placeholder: "选择经销商",
+            valueName: "sys_enterpriseid",
+            checking: "base",
+            required: true,
+            interrupt: true
+        } : {
+            label: "订单号",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/toolBill/modules/selectOrder/index",
+            params: {
+                "id": 20230105110003,
+                "content": {
+                    nocache: true,
+                    "pageNumber": 1,
+                    "pageSize": 20,
+                    "where": {
+                        "condition": ""
+                    }
+                }
+            },
+            query: '&radio=true',
+            value: "",
+            placeholder: "选择订单号",
+            valueName: "sa_orderid",
+            checking: "base",
+            required: true
+        })
+        this.setData({
+            form
+        })
         if (options.rowData) {
         if (options.rowData) {
-            // wx.setNavigationBarTitle({
-            //   title: 'title',
-            // })
             let data = JSON.parse(options.rowData);
             let data = JSON.parse(options.rowData);
             console.log(data);
             console.log(data);
             this.setData({
             this.setData({
-                form: this.data.form.map(v => {
+                form: form.map(v => {
                     if (v.valueName != 'region') {
                     if (v.valueName != 'region') {
                         if (v.valueName == 'enterprisename') {
                         if (v.valueName == 'enterprisename') {
                             v.value = [data[v.valueName]]
                             v.value = [data[v.valueName]]
@@ -92,21 +119,51 @@ Page({
                     }
                     }
                     return v
                     return v
                 }),
                 }),
-                'form[0].value': [data.sonum,[data.sa_orderid]],
-                'content.sa_aftersalesmagid':data.sa_aftersalesmagid
+                'form[0].value': [data.sonum, [data.sa_orderid]],
+                'content.sa_aftersalesmagid': data.sa_aftersalesmagid
             })
             })
             this.selectComponent('#Form').confirm()
             this.selectComponent('#Form').confirm()
         }
         }
+
+
+
+
+
     },
     },
     /* 打断处理form */
     /* 打断处理form */
     interrupt({
     interrupt({
         detail
         detail
     }) {
     }) {
-        detail.form[detail.temporary.index].value = detail.data.value
+        console.log(detail)
+        detail.form[detail.temporary.index].value = detail.data.value;
+        detail.form.splice(1, detail.form.some(v => v.label == '订单号') ? 1 : 0, {
+            label: "订单号",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/toolBill/modules/selectOrder/index",
+            params: {
+                "id": 20230105110003,
+                "content": {
+                    nocache: true,
+                    "pageNumber": 1,
+                    "pageSize": 20,
+                    "where": {
+                        "condition": ""
+                    },
+                    sys_enterpriseid: detail.data.id[0]
+                }
+            },
+            query: '&radio=true',
+            value: "",
+            placeholder: "选择订单号",
+            valueName: "sa_orderid",
+            checking: "base",
+            required: true
+        })
         this.setData({
         this.setData({
-          form:detail.form
+            form: detail.form
         })
         })
-        this.selectComponent('#Form').confirm()
         wx.navigateBack()
         wx.navigateBack()
     },
     },
     async submit() {
     async submit() {

+ 444 - 444
pages/tabbar/home/index.js

@@ -1,451 +1,451 @@
 let _Http = getApp().globalData.http,
 let _Http = getApp().globalData.http,
-  DataCarousel = null;
+    DataCarousel = null;
 Page({
 Page({
-  data: {
-    appid: "wxc1b6ae925ac1d06a",
-    bannerList: [], //banner列表
-    gridList: [],
-    notice: "",
-    msgCount: 1,
-    msgList: [], //消息列表
-  },
-  onLoad(options) {
-    this.setData({ //获取胶囊位置信息
-      capsule: wx.getMenuButtonBoundingClientRect()
-    })
-    this.refreshData() //更新权限等信息
-  },
-  /* 更新站点信息 */
-  refreshData() {
-    this.setData({
-      user: wx.getStorageSync('userMsg')
-    })
-    if (wx.getStorageSync('userauth').length != 0) {
-      let authList = {},
-        entrance = [{
-          label: "通用",
-          icon: "work-tongyong",
-          appid: "wx08b337e860e3ea58",
-          list: getapps()
-        }, {
-          label: "E-订单",
-          appid: "wxc1b6ae925ac1d06a",
-          icon: "work-E-dingdan",
-          list: getedd()
-        }, {
-          label: "E-服务",
-          appid: "wxc1b6ae925ac1d06a",
-          icon: "work-E-fuwu",
-          list: geteservice()
-        }, {
-          label: "营销工具",
-          icon: "work-yingxiaogongju",
-          appid: "wx08b337e860e3ea58",
-          list: gettool()
-        }, {
-          label: "CRM",
-          appid: "wx08b337e860e3ea58",
-          icon: "work-CRM",
-          list: getcrm()
-        }];
-      //通用
-      function getapps() {
-        const paths = [{
-          name: "签到",
-          path: "/packageA/clockIn/index",
-          icon: "work-a-wodemendianxinxidizhi"
-        }, {
-          name: "任务",
-          path: "/packageA/work/index",
-          icon: "work-a-woderenwuzhongxin"
-        }, {
-          name: "通讯录",
-          path: "/packageA/contacts/index",
-          icon: "work-xiaochengxutongxunlu"
-        }];
-        let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用']),
-          list = [];
-        app.forEach((v, i) => {
-          v.apps.forEach(s => {
-            authList[s.name] = {
-              options: s.meta.auth.map(a => a.option),
-              optionnames: s.meta.auth.map(a => a.optionname),
-            }
-            if (authList[s.name].options.some(s => s == "read")) {
-              let i = paths.findIndex(k => k.name == s.meta.title);
-              if (i != -1) {
-                paths[i].index = i;
-                list.push(paths[i])
-              }
-            }
-          })
-        });
-
-        return dye(list)
-      }
-      //营销工具
-      function gettool() {
-        const paths = [{
-          name: "通告",
-          path: "/pages/annunciate/index",
-          icon: "work-a-shouyejingangqutonggao"
-        }, {
-          name: "营销物料",
-          path: "/pages/tabbar/smartStore/index",
-          icon: "work-a-shouyejingangquyingxiaowuliao",
-          openType: "switchTab"
-        }, {
-          name: "推广素材",
-          path: "/pages/promotional/index",
-          icon: "work-a-shouyejingangqutuiguangsucai"
-        }, {
-          name: "商学院",
-          path: "/pages/college/index",
-          icon: "work-a-shangxueyuanxuexi"
-        }, {
-          name: "提报",
-          path: "/pages/submission/index",
-          icon: "work-a-tibaoguanlitibao"
-        }];
-        let tool = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], paths.map(v => v.name)),
-          list = [];
-        tool.forEach(v => {
-          let auth = v.apps[0].meta.auth;
-          if (!auth.some(r => r.option == 'read')) return;
-          authList[v.apps[0].name] = {
-            options: auth.map(a => a.option),
-            optionnames: auth.map(a => a.optionname)
-          };
-          let item = paths.find(s => s.name == v.systemmodulename);
-          item && list.push(item)
-        });
+    data: {
+        appid: "wxc1b6ae925ac1d06a",
+        bannerList: [], //banner列表
+        gridList: [],
+        notice: "",
+        msgCount: 1,
+        msgList: [], //消息列表
+    },
+    onLoad(options) {
+        this.setData({ //获取胶囊位置信息
+            capsule: wx.getMenuButtonBoundingClientRect()
+        })
+        this.refreshData() //更新权限等信息
+    },
+    /* 更新站点信息 */
+    refreshData() {
+        this.setData({
+            user: wx.getStorageSync('userMsg')
+        })
+        if (wx.getStorageSync('userauth').length != 0) {
+            let authList = {},
+                entrance = [{
+                    label: "通用",
+                    icon: "work-tongyong",
+                    appid: "wx08b337e860e3ea58",
+                    list: getapps()
+                }, {
+                    label: "E-订单",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-dingdan",
+                    list: getedd()
+                }, {
+                    label: "E-服务",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-fuwu",
+                    list: geteservice()
+                }, {
+                    label: "营销工具",
+                    icon: "work-yingxiaogongju",
+                    appid: "wx08b337e860e3ea58",
+                    list: gettool()
+                }, {
+                    label: "CRM",
+                    appid: "wx08b337e860e3ea58",
+                    icon: "work-CRM",
+                    list: getcrm()
+                }];
+            //通用
+            function getapps() {
+                const paths = [{
+                    name: "签到",
+                    path: "/packageA/clockIn/index",
+                    icon: "work-a-wodemendianxinxidizhi"
+                }, {
+                    name: "任务",
+                    path: "/packageA/work/index",
+                    icon: "work-a-woderenwuzhongxin"
+                }, {
+                    name: "通讯录",
+                    path: "/packageA/contacts/index",
+                    icon: "work-xiaochengxutongxunlu"
+                }];
+                let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用']),
+                    list = [];
+                app.forEach((v, i) => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
 
 
-        return dye(list)
-      };
-      //CRM
-      function getcrm() {
-        const paths = [{
-          name: "市场活动",
-          path: "/packageA/activity/index",
-          icon: "work-shichanghuodong",
-        }, {
-          name: "公海线索",
-          path: "/packageA/publicClue/index",
-          icon: "work-xiaochengxu_xiaoshoumubiao"
-        }, {
-          name: "销售线索",
-          path: "/packageA/saleClue/index",
-          icon: "work-xiaoshouxiansuo"
-        }, {
-          name: "公海客户",
-          path: "/packageA/publicCustomer/index",
-          icon: "work-gonghaikehu"
-        }, {
-          name: "客户",
-          path: "/packageA/setclient/index",
-          icon: "work-kehu"
-        }, {
-          name: "项目商机",
-          path: "/packageA/project/index",
-          icon: "work-xiangmushangji"
-        }, {
-          name: "报价单",
-          path: "/packageA/offers/index",
-          icon: "work-xiangmubaojia"
-        }, {
-          name: "竞争对手",
-          path: "/packageA/opponent/index",
-          icon: "work-jingzhengduishou"
-        }, {
-          name: "合同",
-          path: "/packageA/contract/index",
-          icon: "work-hetong"
-        }, {
-          name: "销售目标",
-          path: "/packageA/target/index",
-          icon: "work-xiaochengxu_xiaoshoumubiao"
-        }, {
-          name: "销售预测",
-          path: "/packageA/salesForecasting/index",
-          icon: "work-xiaochengxu_xiaoshouyuce"
-        }];
-        let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['销售预测', '销售线索', '销售目标', '合同管理', '客户管理', '项目管理']),
-          list = [];
-        crm.forEach(v => {
-          v.apps.forEach(s => {
-            authList[s.name] = {
-              options: s.meta.auth.map(a => a.option),
-              optionnames: s.meta.auth.map(a => a.optionname),
-            }
-            if (authList[s.name].options.some(s => s == "read")) {
-              let i = paths.findIndex(k => k.name == s.meta.title);
-              if (i != -1) {
-                paths[i].index = i;
-                list.push(paths[i])
-              }
-            }
-          })
-        });
-        return dye(list.sort((a, b) => a.index - b.index))
-      };
-      //E订单
-      function getedd() {
-        let paths = [{
-          name: "商城",
-          path: "/packageA/market/index",
-          icon: "work-shangcheng"
-        }, {
-          name: "销售订单",
-          path: "/packageA/orderForm/index",
-          icon: "work-dingdan"
-        }, {
-          name: "收货",
-          path: "/packageA/shipment/index",
-          icon: "work-shouhuo"
-        }, {
-          name: "业绩目标",
-          path: "/packageA/target/index",
-          icon: "work-yejimubiao"
-        }, {
-          name: "账户",
-          path: "/packageA/account/index",
-          icon: "work-zhanghu"
-        }, {
-          name: "促销活动",
-          path: "/packageA/activity/index",
-          icon: "work-cuxiaohuodong"
-        }, {
-          name: "工具查询",
-          path: "/packageA/tool/index",
-          icon: "work-gongjuchaxun"
-        }, {
-          name: "购物车",
-          path: "/packageA/shopping/index",
-          icon: "work-gouwuche"
-        }, {
-          name: "开票",
-          path: "/packageA/invoice/index",
-          icon: "work-kaipiao"
-        }, {
-          name: "打款凭证",
-          path: "/packageA/remitVoucher/index",
-          icon: "work-dakuanpingzheng"
-        }, {
-          name: "工具借用",
-          path: "/packageA/borrow/index",
-          icon: "work-shujuchaxun"
-        }, {
-          name: "工具归还",
-          path: "/packageA/toolBill/index",
-          icon: "work-shujuchaxun"
-        }, {
-          name: "居间费结算",
-          path: "/packageA/betweenFee/index",
-          icon: "work-jujianfeijiesuan"
-        }, ];
-        /* {
-            name: "数据查询",
-            path: "#",
-            icon: "work-shujuchaxun"
-        } */
-        let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货与库存", "业绩查询"]),
-          list = [];
-        edd.forEach(v => {
-          v.apps.forEach(s => {
-            authList[s.name] = {
-              options: s.meta.auth.map(a => a.option),
-              optionnames: s.meta.auth.map(a => a.optionname),
+                return dye(list)
             }
             }
-            if (authList[s.name].options.some(s => s == "read")) {
-              let i = paths.findIndex(k => k.name == s.meta.title);
-              if (i != -1) {
-                paths[i].index = i;
-                list.push(paths[i])
-              }
-            }
-          })
-        });
-        return dye(list.sort((a, b) => a.index - b.index))
-      };
-      //E服务
-      function geteservice() {
-        let paths = [{
-          name: "工单",
-          path: "/Eservice/workOrder/index",
-          icon: "work-gongdan"
-        }, {
-          name: "申请单",
-          path: "/Eservice/agent/serviceBillList/index",
-          icon: "work-shenqingdan"
-        }, {
-          name: "申请单管理",
-          path: "/Eservice/workerLeader/serviceBillList/index",
-          icon: "work-shenqingdanguanli"
-        }, {
-          name: "业务员服务申请单",
-          path: "/Eservice/saler/serviceBillList/index",
-          icon: "work-yewuyuanfuwushenqingdan"
-        }];
-        let eservice = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-服务"], ["工单管理"]),
-          list = [];
-        eservice.forEach(v => {
-          v.apps.forEach(s => {
-            authList[s.name] = {
-              options: s.meta.auth.map(a => a.option),
-              optionnames: s.meta.auth.map(a => a.optionname),
-            }
-            if (authList[s.name].options.some(s => s == "read")) {
-              let i = paths.findIndex(k => k.name == s.meta.title);
-              if (i != -1) {
-                paths[i].index = i;
-                list.push(paths[i])
-              }
+            //营销工具
+            function gettool() {
+                const paths = [{
+                    name: "通告",
+                    path: "/pages/annunciate/index",
+                    icon: "work-a-shouyejingangqutonggao"
+                }, {
+                    name: "营销物料",
+                    path: "/pages/mediaLibrary/index",
+                    icon: "work-a-shouyejingangquyingxiaowuliao"
+                }, {
+                    name: "推广素材",
+                    path: "/pages/promotional/index",
+                    icon: "work-a-shouyejingangqutuiguangsucai"
+                }, {
+                    name: "商学院",
+                    path: "/pages/college/index",
+                    icon: "work-a-shangxueyuanxuexi"
+                }, {
+                    name: "提报",
+                    path: "/pages/submission/index",
+                    icon: "work-a-tibaoguanlitibao"
+                }];
+                let tool = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], paths.map(v => v.name)),
+                    list = [];
+                tool.forEach(v => {
+                    let auth = v.apps[0].meta.auth;
+                    if (!auth.some(r => r.option == 'read')) return;
+                    authList[v.apps[0].name] = {
+                        options: auth.map(a => a.option),
+                        optionnames: auth.map(a => a.optionname)
+                    };
+                    let item = paths.find(s => s.name == v.systemmodulename);
+                    item && list.push(item)
+                });
+
+                return dye(list)
+            };
+            //CRM
+            function getcrm() {
+                const paths = [{
+                    name: "市场活动",
+                    path: "/packageA/activity/index",
+                    icon: "work-shichanghuodong",
+                }, {
+                    name: "公海线索",
+                    path: "/packageA/publicClue/index",
+                    icon: "work-xiaochengxu_xiaoshoumubiao"
+                }, {
+                    name: "销售线索",
+                    path: "/packageA/saleClue/index",
+                    icon: "work-xiaoshouxiansuo"
+                }, {
+                    name: "公海客户",
+                    path: "/packageA/publicCustomer/index",
+                    icon: "work-gonghaikehu"
+                }, {
+                    name: "客户",
+                    path: "/packageA/setclient/index",
+                    icon: "work-kehu"
+                }, {
+                    name: "项目商机",
+                    path: "/packageA/project/index",
+                    icon: "work-xiangmushangji"
+                }, {
+                    name: "报价单",
+                    path: "/packageA/offers/index",
+                    icon: "work-xiangmubaojia"
+                }, {
+                    name: "竞争对手",
+                    path: "/packageA/opponent/index",
+                    icon: "work-jingzhengduishou"
+                }, {
+                    name: "合同",
+                    path: "/packageA/contract/index",
+                    icon: "work-hetong"
+                }, {
+                    name: "销售目标",
+                    path: "/packageA/target/index",
+                    icon: "work-xiaochengxu_xiaoshoumubiao"
+                }, {
+                    name: "销售预测",
+                    path: "/packageA/salesForecasting/index",
+                    icon: "work-xiaochengxu_xiaoshouyuce"
+                }];
+                let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['销售预测', '销售线索', '销售目标', '合同管理', '客户管理', '项目管理']),
+                    list = [];
+                crm.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            };
+            //E订单
+            function getedd() {
+                let paths = [{
+                    name: "商城",
+                    path: "/packageA/market/index",
+                    icon: "work-shangcheng"
+                }, {
+                    name: "销售订单",
+                    path: "/packageA/orderForm/index",
+                    icon: "work-dingdan"
+                }, {
+                    name: "收货",
+                    path: "/packageA/shipment/index",
+                    icon: "work-shouhuo"
+                }, {
+                    name: "业绩目标",
+                    path: "/packageA/target/index",
+                    icon: "work-yejimubiao"
+                }, {
+                    name: "账户",
+                    path: "/packageA/account/index",
+                    icon: "work-zhanghu"
+                }, {
+                    name: "促销活动",
+                    path: "/packageA/activity/index",
+                    icon: "work-cuxiaohuodong"
+                }, {
+                    name: "工具查询",
+                    path: "/packageA/tool/index",
+                    icon: "work-gongjuchaxun"
+                }, {
+                    name: "购物车",
+                    path: "/packageA/shopping/index",
+                    icon: "work-gouwuche"
+                }, {
+                    name: "开票",
+                    path: "/packageA/invoice/index",
+                    icon: "work-kaipiao"
+                }, {
+                    name: "打款凭证",
+                    path: "/packageA/remitVoucher/index",
+                    icon: "work-dakuanpingzheng"
+                }, {
+                    name: "工具借用",
+                    path: "/packageA/borrow/index",
+                    icon: "work-shujuchaxun"
+                }, {
+                    name: "工具归还",
+                    path: "/packageA/toolBill/index",
+                    icon: "work-shujuchaxun"
+                }, {
+                    name: "居间费结算",
+                    path: "/packageA/betweenFee/index",
+                    icon: "work-jujianfeijiesuan"
+                }, ];
+                /* {
+                    name: "数据查询",
+                    path: "#",
+                    icon: "work-shujuchaxun"
+                } */
+                let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货与库存", "业绩查询"]),
+                    list = [];
+                edd.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            };
+            //E服务
+            function geteservice() {
+                let paths = [{
+                    name: "工单",
+                    path: "/Eservice/workOrder/index",
+                    icon: "work-gongdan"
+                }, {
+                    name: "申请单",
+                    path: "/Eservice/agent/serviceBillList/index",
+                    icon: "work-shenqingdan"
+                }, {
+                    name: "申请单管理",
+                    path: "/Eservice/workerLeader/serviceBillList/index",
+                    icon: "work-shenqingdanguanli"
+                }, {
+                    name: "业务员服务申请单",
+                    path: "/Eservice/saler/serviceBillList/index",
+                    icon: "work-yewuyuanfuwushenqingdan"
+                }];
+                let eservice = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-服务"], ["工单管理"]),
+                    list = [];
+                eservice.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
             }
             }
-          })
-        });
-        return dye(list.sort((a, b) => a.index - b.index))
-      }
-      //染色
-      function dye(list) {
-        let colorList = [{
-          color: "#3874F6",
-          bColor: "#F0F3FF",
-        }, {
-          color: "#5AB73F",
-          bColor: "#F4FAEF",
-        }, {
-          color: "#F29C37",
-          bColor: "#FCF6EF",
-        }, {
-          color: "#EB4B5C",
-          bColor: "#FDF1ED",
-        }, {
-          color: "#3874F6",
-          bColor: "#F0F3FF",
-        }, {
-          color: "#F29C37",
-          bColor: "#FCF6EF",
-        }, {
-          color: "#EB4B5C",
-          bColor: "#FDF1ED",
-        }, {
-          color: "#3874F6",
-          bColor: "#F0F3FF",
-        }, {
-          color: "#5AB73F",
-          bColor: "#F4FAEF",
-        }, {
-          color: "#F29C37",
-          bColor: "#FCF6EF",
-        }, {
-          color: "#5AB73F",
-          bColor: "#F4FAEF",
-        }, {
-          color: "#3874F6",
-          bColor: "#F0F3FF",
-        }, {
-          color: "#F29C37",
-          bColor: "#FCF6EF",
-        }, {
-          color: "#EB4B5C",
-          bColor: "#FDF1ED",
-        }, {
-          color: "#5AB73F",
-          bColor: "#F4FAEF",
-        }];
-        return list.map((v, i) => {
-          return {
-            ...v,
-            ...colorList[i > colorList.length - 1 ? i - colorList.length : i]
-          }
-        })
-      };
-      wx.setStorageSync('auth', authList)
-      this.setData({
-        entrance,
-        auth: JSON.stringify(authList),
-        userMsg: JSON.stringify(wx.getStorageSync('userMsg'))
-      })
-      /* 获取首页banner */
-      let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
-      if (banner) this.setData({
-        bannerList: banner.ads
-      })
-    } else {
-      setTimeout(this.refreshData, 10);
-      return;
-    }
+            //染色
+            function dye(list) {
+                let colorList = [{
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }];
+                return list.map((v, i) => {
+                    return {
+                        ...v,
+                        ...colorList[i > colorList.length - 1 ? i - colorList.length : i]
+                    }
+                })
+            };
+            wx.setStorageSync('auth', authList)
+            this.setData({
+                entrance,
+                auth: JSON.stringify(authList),
+                userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
+                site: JSON.stringify(wx.getStorageSync('siteP'))
+            })
+            /* 获取首页banner */
+            let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
+            if (banner) this.setData({
+                bannerList: banner.ads
+            })
+        } else {
+            setTimeout(this.refreshData, 10);
+            return;
+        }
 
 
-  },
-  /* 获取最新信息 */
-  queryMessage(i = 0) {
-    _Http.basic({
-      "classname": "system.message.Message",
-      "method": "queryMessage",
-      content: {
-        nocache: true,
-        pageNumber: 1,
-        pageSize: 5,
-        pageTotal: 1,
-        type: "",
-        where: {}
-      },
-    }, false).then(res => {
-      if (res.msg != '成功') return (i <= 5) ? this.queryMessage(i + 1) : wx.showToast({
-        title: res.msg,
-        icon: "none"
-      })
-      this.setData({
-        msgList: res.data,
-        notice: res.data[0]
-      })
-      if (this.data.msgList.length > 2) this.startDataCarousel();
-    })
-  },
-  /* 开启消息轮播 */
-  startDataCarousel() {
-    clearInterval(DataCarousel);
-    DataCarousel = setInterval(() => {
-      let count = this.data.msgCount < this.data.msgList.length ? this.data.msgCount : 0;
-      this.setData({
-        msgCount: count + 1,
-        notice: this.data.msgList[count]
-      })
-    }, 5000)
-  },
-  /* 去消息详情 */
-  toMsg(e) {
-    const {
-      item
-    } = e.currentTarget.dataset;
-    wx.navigateTo({
-      url: '/pages/tabbar/message/details?id=' + item.messageid,
-    })
-  },
-  /* banner */
-  bannerClick(e) {
-    const {
-      item
-    } = e.currentTarget.dataset,
-      hyperlink = item.hyperlink.split(":");
-    if (hyperlink[0] == 'path') wx.navigateTo({
-      url: hyperlink[1]
-    })
-  },
-  onShow() {
-    this.getTabBar().init();
-    if (this.data.msgList.length > 2) this.startDataCarousel();
-    this.queryMessage(0); //更新最新消息
-  },
-  onHide() {
-    clearInterval(DataCarousel);
-  },
-  onReady() {
-    // this.setListHeight();
-  },
-  /* 设置页面高度 */
-  setListHeight() {
-    this.selectComponent("#ListBox").setHeight(".grld-title", this);
-  },
-  onShareAppMessage() {}
+    },
+    /* 获取最新信息 */
+    queryMessage(i = 0) {
+        _Http.basic({
+            "classname": "system.message.Message",
+            "method": "queryMessage",
+            content: {
+                nocache: true,
+                pageNumber: 1,
+                pageSize: 5,
+                pageTotal: 1,
+                type: "",
+                where: {}
+            },
+        }, false).then(res => {
+            if (res.msg != '成功') return (i <= 5) ? this.queryMessage(i + 1) : wx.showToast({
+                title: res.msg,
+                icon: "none"
+            })
+            this.setData({
+                msgList: res.data,
+                notice: res.data[0]
+            })
+            if (this.data.msgList.length > 2) this.startDataCarousel();
+        })
+    },
+    /* 开启消息轮播 */
+    startDataCarousel() {
+        clearInterval(DataCarousel);
+        DataCarousel = setInterval(() => {
+            let count = this.data.msgCount < this.data.msgList.length ? this.data.msgCount : 0;
+            this.setData({
+                msgCount: count + 1,
+                notice: this.data.msgList[count]
+            })
+        }, 5000)
+    },
+    /* 去消息详情 */
+    toMsg(e) {
+        const {
+            item
+        } = e.currentTarget.dataset;
+        wx.navigateTo({
+            url: '/pages/tabbar/message/details?id=' + item.messageid,
+        })
+    },
+    /* banner */
+    bannerClick(e) {
+        const {
+            item
+        } = e.currentTarget.dataset,
+            hyperlink = item.hyperlink.split(":");
+        if (hyperlink[0] == 'path') wx.navigateTo({
+            url: hyperlink[1]
+        })
+    },
+    onShow() {
+        this.getTabBar().init();
+        if (this.data.msgList.length > 2) this.startDataCarousel();
+        this.queryMessage(0); //更新最新消息
+    },
+    onHide() {
+        clearInterval(DataCarousel);
+    },
+    onReady() {
+        // this.setListHeight();
+    },
+    /* 设置页面高度 */
+    setListHeight() {
+        this.selectComponent("#ListBox").setHeight(".grld-title", this);
+    },
+    onShareAppMessage() {}
 })
 })

+ 1 - 1
pages/tabbar/home/index.scss

@@ -21,7 +21,7 @@
     font-size: 28rpx;
     font-size: 28rpx;
     font-family: PingFang SC-Regular, PingFang SC;
     font-family: PingFang SC-Regular, PingFang SC;
 
 
-    .iconfont {
+    .work {
         color: #FA8C16;
         color: #FA8C16;
         margin-right: 20rpx;
         margin-right: 20rpx;
     }
     }

+ 2 - 2
pages/tabbar/home/index.wxml

@@ -12,7 +12,7 @@
 </view>
 </view>
 <!-- 滚动通知 -->
 <!-- 滚动通知 -->
 <van-notice-bar custom-class='notice-bar' mode="link" background="none" data-item="{{notice}}" background='#FCF6EF' color='#666' text="{{notice.message}}">
 <van-notice-bar custom-class='notice-bar' mode="link" background="none" data-item="{{notice}}" background='#FCF6EF' color='#666' text="{{notice.message}}">
-    <text slot="left-icon" data-item="{{notice}}" class="iconfont icon-xiaoxigundong" />
+    <text slot="left-icon" data-item="{{notice}}" class="work work-xiaoxigundong" />
 </van-notice-bar>
 </van-notice-bar>
 <!-- 轮播区域 -->
 <!-- 轮播区域 -->
 <swiper class='banner' wx:if="{{bannerList.length}}" autoplay circular>
 <swiper class='banner' wx:if="{{bannerList.length}}" autoplay circular>
@@ -25,7 +25,7 @@
         <view class="group" wx:if="{{item.list.length}}">
         <view class="group" wx:if="{{item.list.length}}">
             <view class="label"><text class="work {{item.icon}}" />{{item.label}}</view>
             <view class="label"><text class="work {{item.icon}}" />{{item.label}}</view>
             <view class="main">
             <view class="main">
-                <navigator version='trial' class="item" wx:for="{{item.list}}" wx:for-item="it" wx:for-index="i" target='{{item.appid!=appid?"miniProgram":"self"}}' app-id='{{item.appid}}' path="{{it.path+'?auth='+auth+'&userMsg='+userMsg}}" url="{{it.path}}" open-type="{{it.openType||'navigate'}}" wx:key="name" data-it="{{it}}" data-item="{{item}}" bindtap="openRecord">
+                <navigator version='trial' class="item" wx:for="{{item.list}}" wx:for-item="it" wx:for-index="i" target='{{item.appid!=appid?"miniProgram":"self"}}' app-id='{{item.appid}}' path="{{it.path+'?auth='+auth+'&userMsg='+userMsg+'&site='+site}}" url="{{it.path}}" open-type="{{it.openType||'navigate'}}" wx:key="name" data-it="{{it}}" data-item="{{item}}" bindtap="openRecord">
                     <view class="icon-box" style="background-color: {{it.bColor}};">
                     <view class="icon-box" style="background-color: {{it.bColor}};">
                         <text class="work {{it.icon}}" style="color: {{it.color}};" />
                         <text class="work {{it.icon}}" style="color: {{it.color}};" />
                     </view>
                     </view>

+ 0 - 1
select/agent/index.js

@@ -110,6 +110,5 @@ Page({
   onUnload() {
   onUnload() {
     //回收数据
     //回收数据
     getApp().globalData.handleSelect = null;
     getApp().globalData.handleSelect = null;
-    
   }
   }
 })
 })

+ 2 - 2
select/agent/index.wxml

@@ -8,9 +8,9 @@
 	<navigator class="item" url="#" wx:for="{{list}}" wx:key="itemno" data-id="{{item[idname]}}" bindtap="changeResult">
 	<navigator class="item" url="#" wx:for="{{list}}" wx:key="itemno" data-id="{{item[idname]}}" bindtap="changeResult">
 		<van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
 		<van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
 		<view class="main" style="padding-left: {{!radio?'10rpx':''}};">
 		<view class="main" style="padding-left: {{!radio?'10rpx':''}};">
-			<view class="title line-1">{{item.enterprisename}}</view>
+			<view class="title line-1">{{item.enterprisename || ' --'}}</view>
 			<view class="subfield line-1">
 			<view class="subfield line-1">
-				经销商编号:{{item.agentnum}}
+				经销商编号:{{item.agentnum||' --'}}
 			</view>
 			</view>
 			<view class="subfield line-1">
 			<view class="subfield line-1">
 				联系人:{{item.contact}} {{item.phonenumber}}
 				联系人:{{item.contact}} {{item.phonenumber}}

+ 7 - 3
static/work-icon.wxss

@@ -1,8 +1,8 @@
 @font-face {
 @font-face {
     font-family: "work"; /* Project id 3902307 */
     font-family: "work"; /* Project id 3902307 */
-    src: url('//at.alicdn.com/t/c/font_3902307_h2gzokzadc9.woff2?t=1677073678140') format('woff2'),
-         url('//at.alicdn.com/t/c/font_3902307_h2gzokzadc9.woff?t=1677073678140') format('woff'),
-         url('//at.alicdn.com/t/c/font_3902307_h2gzokzadc9.ttf?t=1677073678140') format('truetype');
+    src: url('//at.alicdn.com/t/c/font_3902307_837vogsih7.woff2?t=1677140175077') format('woff2'),
+         url('//at.alicdn.com/t/c/font_3902307_837vogsih7.woff?t=1677140175077') format('woff'),
+         url('//at.alicdn.com/t/c/font_3902307_837vogsih7.ttf?t=1677140175077') format('truetype');
   }
   }
   
   
   .work {
   .work {
@@ -13,6 +13,10 @@
     -moz-osx-font-smoothing: grayscale;
     -moz-osx-font-smoothing: grayscale;
   }
   }
   
   
+  .work-xiaoxigundong:before {
+    content: "\e674";
+  }
+  
   .work-shenqingdan:before {
   .work-shenqingdan:before {
     content: "\e686";
     content: "\e686";
   }
   }

+ 6 - 0
utils/Http.js

@@ -1,6 +1,12 @@
 // const baseUrl = "https://meida.cnyunl.com/yos/rest/index";
 // const baseUrl = "https://meida.cnyunl.com/yos/rest/index";
+<<<<<<< HEAD
 const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
 const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
 // const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
 // const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
+=======
+// const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
+const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
+// const baseUrl = "https://oms.idcgroup.com.cn:8079/yos/rest/index";
+>>>>>>> 462eff694c7055755ed096669c0c8b22d191195c
 
 
 class HTTP {
 class HTTP {
     request({
     request({