Browse Source

销售订单业务员账号选择经销商

zhaoxiaohai 2 years ago
parent
commit
d1274d7b6d

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

@@ -1,114 +1,165 @@
 const _Http = getApp().globalData.http;
+
 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";
 
 page {
-	background-color: #fff;
+    background-color: #fff;
 }
 
 .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 {
-	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}}" />
 
 <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 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>
+<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 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>

+ 24 - 19
packageA/orderForm/detail.js

@@ -27,25 +27,11 @@ Page({
     onLoad(options) {
         this.setData({
             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);
 
-        //获取企业免邮额度
-        _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({
             "classname": "sysmanage.develop.optiontype.optiontype",
@@ -91,7 +77,26 @@ Page({
                 detail: res.data,
                 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 content = JSON.parse(JSON.stringify(page.data.content));
         content.pageNumber = 1;
-        content.pageSize = page.data.list.length;
+        content.pageSize = page.data.content.pageNumber * page.data.content.pageSize;
         _Http.basic({
-            "id": wx.getStorageSync('userMsg').usertype == 1 ? 20221111145202 : 20221224180302,
+            "id": this.data.userrole == '业务员' ? 20221111145202 : 20221224180302,
             content
         }).then(res => {
             console.log("订单列表", res)

+ 100 - 99
packageA/orderForm/detail.wxml

@@ -2,124 +2,125 @@
 <template is="skeleton" wx:if="{{loading}}" />
 
 <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="{{detail.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>
 
 <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 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>
 
 <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 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 style="height: 20rpx;" />
 <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>
 
 <view style="height: 130rpx;" />
 <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>

+ 4 - 1
packageA/orderForm/index.js

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

+ 6 - 8
packageA/orderForm/modules/list/index.wxml

@@ -14,7 +14,7 @@
             {{item.type}}:{{item.sonum}}
         </view>
         <view class="exp" wx:if="{{userrole=='业务员'}}">
-            经销商:{{item.abbreviation || ' --'}}
+            经销商:{{item.enterprisename || ' --'}}
         </view>
         <view class="exp">
             区域经理:{{item.salename || ' --'}}
@@ -29,20 +29,18 @@
             合计:¥{{item.defaultamount}}元
         </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 wx:else class="bottom">
         暂无收货人
     </view>
 </navigator>
 
 <Yl_Empty wx:if="{{list.length==0}}" />
-
-
 <wxs module="set">
     module.exports = {
         color: function (statu) {

+ 0 - 1
select/agent/index.js

@@ -110,6 +110,5 @@ Page({
   onUnload() {
     //回收数据
     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">
 		<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="title line-1">{{item.enterprisename}}</view>
+			<view class="title line-1">{{item.enterprisename || ' --'}}</view>
 			<view class="subfield line-1">
-				经销商编号:{{item.agentnum}}
+				经销商编号:{{item.agentnum||' --'}}
 			</view>
 			<view class="subfield line-1">
 				联系人:{{item.contact}} {{item.phonenumber}}