zhaoxiaohai 2 years ago
parent
commit
dd4b0b38e1

+ 1 - 1
components/My_categoryListings/index.wxml

@@ -21,4 +21,4 @@
         <view style="height: {{height-80}}rpx;" />
     </scroll-view>
 </view>
-<!-- <My_empty wx:if="{{list.length==0}}" /> -->
+<!-- <Yl_Empty wx:if="{{list.length==0}}" /> -->

+ 1 - 1
components/Yl_Attachment/index.js

@@ -34,7 +34,7 @@ Component({
 			}).then(res => {
 				console.log("附件列表", res)
 				if (res.msg != '成功') return wx.showToast({
-					title: res.data,
+					title: res.msg,
 					icon: "none"
 				});
 				this.setData({

+ 1 - 1
components/Yl_Empty/index.js

@@ -1,4 +1,4 @@
-// components/My_empty/index.js
+// components/Yl_Empty/index.js
 Component({
     /**
      * 组件的属性列表

+ 1 - 1
components/Yl_Files/index.js

@@ -72,7 +72,7 @@ Component({
                 }
             }).then(res => {
                 if (res.msg != '成功') return wx.showToast({
-                    title: res.data,
+                    title: res.msg,
                     icon: "none"
                 });
                 let files = this.data.files;

+ 110 - 101
packageA/orderForm/add/add.js

@@ -1,104 +1,113 @@
 const _Http = getApp().globalData.http;
 Page({
-  data: {
-    skeletonShow: false,
-    loading: false,
-    sa_brandid: null,
-    tradefield: null,
-    brandList: [],
-    domainList: []
-  },
-  onLoad(options) {
-    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_brandid": this.data.sa_brandid, //品牌ID
-        "type": "标准订单", //订单类型
-        "tradefield": this.data.tradefield, //必选
-      }
-    }).then(res => {
-      this.setData({
-        loading: false
-      })
-      console.log("创建标准订单", res);
-      wx.showToast({
-        title: res.msg != '成功' ? res.msg : '创建成功',
-        icon: "none"
-      });
-      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: {
+        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"
+            });
+            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)
+        })
+    }
 })

+ 72 - 67
packageA/orderForm/add/float/index.js

@@ -1,35 +1,35 @@
 const _Http = getApp().globalData.http;
 
 Component({
-  data: {
-    types: [{
-      name: '标准订单'
-    }, {
-      name: '项目订单'
-    }],
-    actionShow: false,
-  },
-  methods: {
-    /* 挑选新增订单类型 */
-    onSelect() {
-      this.setData({
-        actionShow: true
-      })
+    data: {
+        types: [{
+            name: '标准订单'
+        }, {
+            name: '项目订单'
+        }],
+        actionShow: false,
     },
-    /* 选择订单类型 */
-    selectType({
-      detail
-    }) {
-      switch (detail.name) {
-        case '标准订单':
-          wx.navigateTo({
-            url: '/packageA/orderForm/add/add',
-          })
-          break;
-        case '项目订单':
-          /* 前去挑选合同 */
-          wx.navigateTo({
-            url: `/select/contract/index?params=${JSON.stringify({
+    methods: {
+        /* 挑选新增订单类型 */
+        onSelect() {
+            this.setData({
+                actionShow: true
+            })
+        },
+        /* 选择订单类型 */
+        selectType({
+            detail
+        }) {
+            switch (detail.name) {
+                case '标准订单':
+                    wx.navigateTo({
+                        url: '/packageA/orderForm/add/add?type=标准订单',
+                    })
+                    break;
+                case '项目订单':
+                    /* 前去挑选合同 */
+                    wx.navigateTo({
+                        url: `/select/contract/index?params=${JSON.stringify({
               "id": 20230103150802,
               "content": {
                   "pageNumber": 1,
@@ -41,46 +41,51 @@ Component({
                   }
               }
           })}&radio=false`,
-          })
-          getApp().globalData.handleSelect = this.addProjectOrder.bind(this);
-          break;
-      }
-      this.onCancel();
-    },
-    /* 取消选择订单类型 */
-    onCancel() {
-      this.setData({
-        actionShow: false
-      })
-    },
-    addProjectOrder(e) {
-      wx.showModal({
-        title: '提示',
-        content: `是否确认创建“${e.item.billno}”相关“${e.item.projectname}”项目订单?`,
-        complete: (res) => {
-          if (res.confirm) _Http.basic({
-            "id": 20230103141402,
-            "content": {
-              sa_orderid: 0,
-              "sa_contractid": e.item.sa_contractid, //合同ID,
-              "sa_projectid": e.item.sa_projectid, //工程项目表ID,
+                    })
+                    getApp().globalData.handleSelect = this.addProjectOrder.bind(this);
+                    break;
             }
-          }).then(res => {
-            console.log("创建商品订单", res)
-            wx.showToast({
-              title: res.msg != '成功' ? res.msg : '创建成功',
-              icon: "none"
-            });
-            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)
-          })
+            this.onCancel();
+        },
+        /* 取消选择订单类型 */
+        onCancel() {
+            this.setData({
+                actionShow: false
+            })
+        },
+        addProjectOrder(e) {
+            wx.showModal({
+                title: '提示',
+                content: `是否确认创建“${e.item.billno}”相关“${e.item.projectname}”项目订单?`,
+                complete: (res) => {
+                    if (res.confirm) {
+                        wx.navigateTo({
+                            url: `/packageA/orderForm/add/add?type=项目订单&sa_contractid=${e.item.sa_contractid}&sa_projectid=${ e.item.sa_projectid}`,
+                        })
+                    }
+                    /* _Http.basic({
+                                           "id": 20230103141402,
+                                           "content": {
+                                               sa_orderid: 0,
+                                               "sa_contractid": e.item.sa_contractid, //合同ID,
+                                               "sa_projectid": e.item.sa_projectid, //工程项目表ID,
+                                           }
+                                       }).then(res => {
+                                           console.log("创建商品订单", res)
+                                           wx.showToast({
+                                               title: res.msg != '成功' ? res.msg : '创建成功',
+                                               icon: "none"
+                                           });
+                                           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)
+                                       }) */
+                }
+            })
         }
-      })
     }
-  }
 })

+ 436 - 436
packageA/orderForm/detail.js

@@ -1,59 +1,59 @@
 const _Http = getApp().globalData.http;
 
 Page({
-	data: {
-		loading: true,
-		sa_orderid: null,
-		tabsActive: 0,
-		tabsList: [{
-			label: "产品明细",
-			icon: "icon-tabchanpin",
-			model: "#Product"
-		}, {
-			label: "附件",
-			icon: "icon-tabfujian1",
-			model: "#Yl_Attachment"
-		}, {
-			label: "订单进度",
-			icon: "icon-tabcaozuojilu1",
-			model: "#Progress"
-		}, {
-			label: "发票",
-			icon: "icon-tabkaipiaoxinxi"
-		}],
-	},
-	onLoad(options) {
-		this.setData({
-			sa_orderid: options.id
-		});
-		this.getDetail(true);
-	},
-	/* 获取详情 */
-	getDetail(init = false, show = true) {
-		_Http.basic({
-			"id": 20221108151302,
-			"content": {
-				nocache: true,
-				"sa_orderid": this.data.sa_orderid
-			}
-		}, show).then(res => {
-			console.log("订单详情", res)
-			if (res.msg != '成功') return wx.showToast({
-				title: res.msg,
-				icon: "none"
-			});
-			this.setData({
-				detail: res.data,
-				loading: false
-			});
-			if (init) this.partialRenewal(true)
-		})
-	},
-	/* 选择结算人 */
-	selectAgent() {
-		if (this.isEdit()) return;
-		wx.navigateTo({
-			url: `/select/agent/index?params=${JSON.stringify({ 
+    data: {
+        loading: true,
+        sa_orderid: null,
+        tabsActive: 0,
+        tabsList: [{
+            label: "产品明细",
+            icon: "icon-tabchanpin",
+            model: "#Product"
+        }, {
+            label: "附件",
+            icon: "icon-tabfujian1",
+            model: "#Yl_Attachment"
+        }, {
+            label: "订单进度",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Progress"
+        }, {
+            label: "发票",
+            icon: "icon-tabkaipiaoxinxi"
+        }],
+    },
+    onLoad(options) {
+        this.setData({
+            sa_orderid: options.id
+        });
+        this.getDetail(true);
+    },
+    /* 获取详情 */
+    getDetail(init = false, show = true) {
+        _Http.basic({
+            "id": 20221108151302,
+            "content": {
+                nocache: true,
+                "sa_orderid": this.data.sa_orderid
+            }
+        }, show).then(res => {
+            console.log("订单详情", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            });
+            this.setData({
+                detail: res.data,
+                loading: false
+            });
+            if (init) this.partialRenewal(true)
+        })
+    },
+    /* 选择结算人 */
+    selectAgent() {
+        if (this.isEdit()) return;
+        wx.navigateTo({
+            url: `/select/agent/index?params=${JSON.stringify({ 
 				"id":20230104103702,
 				"content": {
 					"pageNumber": 1, 
@@ -64,55 +64,55 @@ Page({
 						}, 
 				}
 			 })}&radio=true`,
-		});
-		getApp().globalData.handleSelect = this.setAgeant.bind(this);
-	},
-	/* 设置结算人 */
-	setAgeant({
-		item
-	}) {
-		let that = this;
-		console.log("选择经销商", item)
-		wx.showModal({
-			title: '提示',
-			content: `是否确认设置"${item.enterprisename}"为结算人?`,
-			complete: (res) => {
-				if (res.confirm) {
-					let pay_enterpriseid = that.data.detail.pay_enterpriseid,
-						sys_enterprise_financeid = that.data.detail.sys_enterprise_financeid,
-						sa_accountclassid = that.data.detail.sa_accountclassid;
-					that.setData({
-						"detail.pay_enterpriseid": item.sys_enterpriseid,
-						"detail.sys_enterprise_financeid": item.finance[0] ? item.finance[0].sys_enterprise_financeid : 0,
-						"detail.sa_accountclassid": item.accounts[0] ? item.accounts[0].sa_accountclassid : 0,
-					});
-					that.changeDetail().then(s => {
-						if (s.msg == '成功') {
-							wx.showToast({
-								title: '设置成功',
-								icon: "none"
-							});
-							setTimeout(() => {
-								wx.navigateBack();
-								that.getDetail();
-							}, 500)
-						} else {
-							that.setData({
-								"detail.pay_enterpriseid": pay_enterpriseid,
-								"detail.sys_enterprise_financeid": sys_enterprise_financeid,
-								"detail.sa_accountclassid": sa_accountclassid
-							});
-						}
-					})
-				}
-			}
-		})
-	},
-	/* 选择收货人 */
-	selectConsignee() {
-		if (this.isEdit()) return;
-		wx.navigateTo({
-			url: `/select/address/index?params=${JSON.stringify({ 
+        });
+        getApp().globalData.handleSelect = this.setAgeant.bind(this);
+    },
+    /* 设置结算人 */
+    setAgeant({
+        item
+    }) {
+        let that = this;
+        console.log("选择经销商", item)
+        wx.showModal({
+            title: '提示',
+            content: `是否确认设置"${item.enterprisename}"为结算人?`,
+            complete: (res) => {
+                if (res.confirm) {
+                    let pay_enterpriseid = that.data.detail.pay_enterpriseid,
+                        sys_enterprise_financeid = that.data.detail.sys_enterprise_financeid,
+                        sa_accountclassid = that.data.detail.accountclass.sa_accountclassid;
+                    that.setData({
+                        "detail.pay_enterpriseid": item.sys_enterpriseid,
+                        "detail.sys_enterprise_financeid": item.finance[0] ? item.finance[0].sys_enterprise_financeid : 0,
+                        "detail.accountclass.sa_accountclassid": item.accounts[0] ? item.accounts[0].sa_accountclassid : 0,
+                    });
+                    that.changeDetail().then(s => {
+                        if (s.msg == '成功') {
+                            wx.showToast({
+                                title: '设置成功',
+                                icon: "none"
+                            });
+                            setTimeout(() => {
+                                wx.navigateBack();
+                                that.getDetail();
+                            }, 500)
+                        } else {
+                            that.setData({
+                                "detail.pay_enterpriseid": pay_enterpriseid,
+                                "detail.sys_enterprise_financeid": sys_enterprise_financeid,
+                                "detail.sa_accountclassid": sa_accountclassid
+                            });
+                        }
+                    })
+                }
+            }
+        })
+    },
+    /* 选择收货人 */
+    selectConsignee() {
+        if (this.isEdit()) return;
+        wx.navigateTo({
+            url: `/select/address/index?params=${JSON.stringify({ 
 				"id":20221009155803,
 				"content": {
 					nocache:true,
@@ -126,49 +126,49 @@ Page({
 						}, 
 				}
 			 })}&radio=true`,
-		});
-		getApp().globalData.handleSelect = this.setConsignee.bind(this);
-	},
-	/* 设置收货人 */
-	setConsignee({
-		item
-	}) {
-		let that = this;
-		console.log("设置收货人", item)
-		wx.showModal({
-			title: '提示',
-			content: `是否确认设置"${item.name}"为收货人?`,
-			complete: (res) => {
-				if (res.confirm) {
-					let rec_contactsid = that.data.detail.rec_contactsid;
-					that.setData({
-						"detail.rec_contactsid": item.contactsid
-					});
-					that.changeDetail().then(s => {
-						if (s.msg == '成功') {
-							wx.showToast({
-								title: '设置成功',
-								icon: "none"
-							});
-							setTimeout(() => {
-								wx.navigateBack();
-								that.getDetail();
-							}, 500)
-						} else {
-							that.setData({
-								"detail.rec_contactsid": rec_contactsid
-							});
-						}
-					})
-				}
-			}
-		})
-	},
-	/* 选择财务信息 */
-	selectFinance() {
-		if (this.isEdit()) return;
-		wx.navigateTo({
-			url: `/select/finance/index?params=${JSON.stringify({ 
+        });
+        getApp().globalData.handleSelect = this.setConsignee.bind(this);
+    },
+    /* 设置收货人 */
+    setConsignee({
+        item
+    }) {
+        let that = this;
+        console.log("设置收货人", item)
+        wx.showModal({
+            title: '提示',
+            content: `是否确认设置"${item.name}"为收货人?`,
+            complete: (res) => {
+                if (res.confirm) {
+                    let rec_contactsid = that.data.detail.rec_contactsid;
+                    that.setData({
+                        "detail.rec_contactsid": item.contactsid
+                    });
+                    that.changeDetail().then(s => {
+                        if (s.msg == '成功') {
+                            wx.showToast({
+                                title: '设置成功',
+                                icon: "none"
+                            });
+                            setTimeout(() => {
+                                wx.navigateBack();
+                                that.getDetail();
+                            }, 500)
+                        } else {
+                            that.setData({
+                                "detail.rec_contactsid": rec_contactsid
+                            });
+                        }
+                    })
+                }
+            }
+        })
+    },
+    /* 选择财务信息 */
+    selectFinance() {
+        if (this.isEdit()) return;
+        wx.navigateTo({
+            url: `/select/finance/index?params=${JSON.stringify({ 
 				"id":20221013160602,
 				"content": {
 					nocache:true,
@@ -181,296 +181,296 @@ Page({
 					}, 
 				}
 			 })}&radio=true`,
-		});
-		getApp().globalData.handleSelect = this.setFinance.bind(this);
-	},
-	/* 设置财务信息 */
-	setFinance({
-		item
-	}) {
-		let that = this;
-		console.log("设置财务信息", item)
-		wx.showModal({
-			title: '提示',
-			content: `是否确认设置"${item.enterprisename}"为开票单位?`,
-			complete: (res) => {
-				if (res.confirm) {
-					let sys_enterprise_financeid = that.data.detail.sys_enterprise_financeid;
-					that.setData({
-						"detail.sys_enterprise_financeid": item.sys_enterprise_financeid
-					});
-					that.changeDetail().then(s => {
-						if (s.msg == '成功') {
-							wx.showToast({
-								title: '设置成功',
-								icon: "none"
-							});
-							setTimeout(() => {
-								wx.navigateBack();
-								that.getDetail();
-							}, 500)
-						} else {
-							that.setData({
-								"detail.sys_enterprise_financeid": sys_enterprise_financeid
-							});
-						}
-					})
-				}
-			}
-		})
-	},
-	//tabs 切换
-	tabsChange({
-		detail
-	}) {
-		this.setData({
-			tabsActive: detail
-		});
-		this.partialRenewal();
-	},
-	//局部数据更新 tabs
-	partialRenewal(init = false) {
-		let model = this.data.tabsList[this.data.tabsActive].model;
-		if (model) {
-			let Component = this.selectComponent(model),
-				{
-					total,
-					pageNumber,
-					pageTotal
-				} = Component.data.content,
-				id = this.data.detail.sa_orderid;
-			if (total == null || init) {
-				Component.getList(id, init);
-			} else if (pageNumber < pageTotal) {
-				Component.getList(id, false);
-			}
-		}
-	},
-	onReachBottom() {
-		this.partialRenewal();
-	},
-	/* 更新数据 */
-	changeDetail() {
-		let data = this.data.detail,
-			content = {
-				"sa_orderid": data.sa_orderid,
-				"sys_enterpriseid": data.sys_enterpriseid, //订货企业id
-				"sa_accountclassid": data.sa_accountclassid || 0, //营销账户类型ID
-				"sa_brandid": data.sa_brandid, //品牌ID
-				"sys_enterprise_financeid": data.sys_enterprise_financeid, //合作企业财务信息ID(开票信息)
-				"sa_logiscompid": data.logiscomp.sa_logiscompid, //物流公司档案ID
-				"rec_contactsid": data.rec_contactsid || 0, //合作企业联系人表ID(收货信息)
-				"type": data.type, //订单类型
-				"typemx": data.typemx, // 明细分类,可选
-				"remarks": data.remarks,
-				"saler_hrid": data.saler_hrid, //销售人员hrid,业务员hrid
-				"tradefield": data.tradefield, //必选
-				"pay_enterpriseid": data.pay_enterpriseid, //结算单位
-				"rebate_userate": data.accountclass.rebate_userate, //返利金使用比例
-				"rebate_used": data.rebate_used, //默认0,是否使用返利金
-				"billdate": data.billdate, //单据日期,默认创建日期
-			};
-		if (content.type != '标准订单') {
-			//"sa_contractid": 1, 合同ID,标准订单不传
-			//"sa_projectid": 1, 工程项目表ID,标准订单不传
-		}
-		return new Promise((resolve, reject) => {
-			_Http.basic({
-				"id": 20221108111402,
-				content
-			}).then(res => {
-				console.log("修改订单数据", res);
-				if (res.msg != '成功') wx.showToast({
-					title: res.msg,
-					icon: "none"
-				});
-				resolve(res)
-			})
-		})
-	},
-	/* 修改订单备注 */
-	changeRemarks(e) {
-		let value = e.detail.value,
-			remarks = this.data.detail.remarks,
-			that = this;
-		if (value == this.data.detail.remarks) return;
-		wx.showModal({
-			title: '提示',
-			content: '是否确定修改订单备注?',
-			complete: async (res) => {
-				if (res.cancel) that.setData({
-					"detail.remarks": remarks
-				})
-				if (res.confirm) {
-					let res = await that.changeDetail();
-					that.setData({
-						"detail.remarks": res.msg == '成功' ? value : remarks
-					})
-				}
-			}
-		})
-	},
-	/* 设置是否使用返利金 */
-	async changeRebateUsed() {
-		if (this.data.detail.status != '新建') return wx.showToast({
-			title: '当前订单状态不可设置!',
-			icon: "none"
-		})
-		this.setData({
-			"detail.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
-		})
-		let res = await this.changeDetail();
-		if (res.msg != '成功') {
-			this.setData({
-				"detail.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
-			});
-		}
-	},
-	/* 删除订单 */
-	deleteItem() {
-		let that = this;
-		wx.showModal({
-			title: '提示',
-			content: '是否确认删除订单?',
-			complete: (res) => {
-				if (res.confirm) _Http.basic({
-					"id": 20221108152102,
-					"content": {
-						"sa_orderids": [
-							that.data.sa_orderid
-						]
-					}
-				}).then(s => {
-					console.log("删除订单", s)
-					if (s.msg != '成功') return wx.showToast({
-						title: s.msg,
-						icon: "none"
-					});
-					wx.showToast({
-						title: `成功删除${that.data.detail.sonum}订单`,
-						icon: "none"
-					});
-					setTimeout(() => {
-						let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
-						if (page) page.setData({
-							list: page.data.list.filter(v => v.sa_orderid != that.data.sa_orderid),
-							"content.total": page.data.content.total - 1,
-							amount: (page.data.amount - that.data.detail.amount).toFixed(2)
-						});
-						wx.navigateBack()
-					}, 500)
-				})
-			}
-		})
-	},
-	/* 提交订单 */
-	submit() {
-		let that = this;
-		wx.showModal({
-			title: '提示',
-			content: '是否确认提交订单?',
-			complete: (res) => {
-				if (res.confirm) _Http.basic({
-					"id": 20221108153402,
-					"content": {
-						sa_orderid: that.data.sa_orderid
-					},
-				}).then(s => {
-					console.log("提交订单", s)
-					wx.showToast({
-						title: s.msg != '成功' ? s.msg : '提交成功',
-						icon: "none"
-					});
-					if (s.msg == '成功') that.setData({
-						"detail.status": "提交"
-					})
-				})
-			}
-		})
-	},
-	/* 确认订单交期 */
-	notarize() {
-		let that = this;
-		wx.showModal({
-			title: '提示',
-			content: '是否确认交期?',
-			complete: (res) => {
-				if (res.confirm) _Http.basic({
-					"id": 20221230094802,
-					"content": {
-						sa_orderid: that.data.sa_orderid
-					},
-				}).then(s => {
-					console.log("确认交期", s)
-					wx.showToast({
-						title: s.msg != '成功' ? s.msg : '提交成功',
-						icon: "none"
-					});
-				})
-			}
-		})
-	},
-	/* 判断是否可以编辑 */
-	isEdit() {
-		if (this.data.detail.status != '新建') wx.showToast({
-			title: '当前订单状态不可设置!',
-			icon: "none"
-		});
-		return this.data.detail.status != '新建';
-	},
-	/* 拷贝订单 */
-	copyItem() {
-		let item = this.data.detail;
-		wx.showModal({
-			title: '提示',
-			content: `是否确认复制${item.type}“${item.sonum}”`,
-			complete: (res) => {
-				if (res.confirm) _Http.basic({
-					"id": 20230102144502,
-					"content": {
-						"sa_orderid": item.sa_orderid
-					}
-				}).then(res => {
-					console.log("复制订单", res)
-					if (res.msg != '成功') return wx.showToast({
-						title: res.msg,
-						icon: "none"
-					});
-					wx.showModal({
-						title: '提示',
-						content: `${item.type}复制成功 是否立即前往`,
-						complete: (s) => {
-							if (s.confirm) wx.redirectTo({
-								url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
-							})
-						}
-					})
+        });
+        getApp().globalData.handleSelect = this.setFinance.bind(this);
+    },
+    /* 设置财务信息 */
+    setFinance({
+        item
+    }) {
+        let that = this;
+        console.log("设置财务信息", item)
+        wx.showModal({
+            title: '提示',
+            content: `是否确认设置"${item.enterprisename}"为开票单位?`,
+            complete: (res) => {
+                if (res.confirm) {
+                    let sys_enterprise_financeid = that.data.detail.sys_enterprise_financeid;
+                    that.setData({
+                        "detail.sys_enterprise_financeid": item.sys_enterprise_financeid
+                    });
+                    that.changeDetail().then(s => {
+                        if (s.msg == '成功') {
+                            wx.showToast({
+                                title: '设置成功',
+                                icon: "none"
+                            });
+                            setTimeout(() => {
+                                wx.navigateBack();
+                                that.getDetail();
+                            }, 500)
+                        } else {
+                            that.setData({
+                                "detail.sys_enterprise_financeid": sys_enterprise_financeid
+                            });
+                        }
+                    })
+                }
+            }
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        let model = this.data.tabsList[this.data.tabsActive].model;
+        if (model) {
+            let Component = this.selectComponent(model),
+                {
+                    total,
+                    pageNumber,
+                    pageTotal
+                } = Component.data.content,
+                id = this.data.detail.sa_orderid;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber < pageTotal) {
+                Component.getList(id, false);
+            }
+        }
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    /* 更新数据 */
+    changeDetail() {
+        let data = this.data.detail,
+            content = {
+                "sa_orderid": data.sa_orderid,
+                "sys_enterpriseid": data.sys_enterpriseid, //订货企业id
+                "sa_accountclassid": data.accountclass.sa_accountclassid || 0, //营销账户类型ID
+                "sa_brandid": data.sa_brandid, //品牌ID
+                "sys_enterprise_financeid": data.sys_enterprise_financeid || 0, //合作企业财务信息ID(开票信息)
+                "sa_logiscompid": data.logiscomp.sa_logiscompid, //物流公司档案ID
+                "rec_contactsid": data.rec_contactsid || 0, //合作企业联系人表ID(收货信息)
+                "type": data.type, //订单类型
+                "typemx": data.typemx, // 明细分类,可选
+                "remarks": data.remarks,
+                "saler_hrid": data.saler_hrid, //销售人员hrid,业务员hrid
+                "tradefield": data.tradefield, //必选
+                "pay_enterpriseid": data.pay_enterpriseid, //结算单位
+                "rebate_userate": data.accountclass.rebate_userate, //返利金使用比例
+                "rebate_used": data.rebate_used, //默认0,是否使用返利金
+                "billdate": data.billdate, //单据日期,默认创建日期
+            };
+        if (content.type = '项目订单') {
+            content.sa_contractid = data.sa_contractid,
+                content.sa_projectid = data.sa_projectid;
+        }
+        return new Promise((resolve, reject) => {
+            _Http.basic({
+                "id": 20221108111402,
+                content
+            }).then(res => {
+                console.log("修改订单数据", res);
+                if (res.msg != '成功') wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                resolve(res)
+            })
+        })
+    },
+    /* 修改订单备注 */
+    changeRemarks(e) {
+        let value = e.detail.value,
+            remarks = this.data.detail.remarks,
+            that = this;
+        if (value == this.data.detail.remarks) return;
+        wx.showModal({
+            title: '提示',
+            content: '是否确定修改订单备注?',
+            complete: async (res) => {
+                if (res.cancel) that.setData({
+                    "detail.remarks": remarks
+                })
+                if (res.confirm) {
+                    let res = await that.changeDetail();
+                    that.setData({
+                        "detail.remarks": res.msg == '成功' ? value : remarks
+                    })
+                }
+            }
+        })
+    },
+    /* 设置是否使用返利金 */
+    async changeRebateUsed() {
+        if (this.data.detail.status != '新建') return wx.showToast({
+            title: '当前订单状态不可设置!',
+            icon: "none"
+        })
+        this.setData({
+            "detail.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
+        })
+        let res = await this.changeDetail();
+        if (res.msg != '成功') {
+            this.setData({
+                "detail.rebate_used": this.data.detail.rebate_used == 1 ? 0 : 1
+            });
+        }
+    },
+    /* 删除订单 */
+    deleteItem() {
+        let that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除订单?',
+            complete: (res) => {
+                if (res.confirm) _Http.basic({
+                    "id": 20221108152102,
+                    "content": {
+                        "sa_orderids": [
+                            that.data.sa_orderid
+                        ]
+                    }
+                }).then(s => {
+                    console.log("删除订单", s)
+                    if (s.msg != '成功') return wx.showToast({
+                        title: s.msg,
+                        icon: "none"
+                    });
+                    wx.showToast({
+                        title: `成功删除${that.data.detail.sonum}订单`,
+                        icon: "none"
+                    });
+                    setTimeout(() => {
+                        /*  let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
+                         if (page) page.setData({
+                             list: page.data.list.filter(v => v.sa_orderid != that.data.sa_orderid),
+                             "content.total": page.data.content.total - 1,
+                             amount: (page.data.amount - that.data.detail.amount).toFixed(2)
+                         }); */
+                        wx.navigateBack()
+                    }, 500)
+                })
+            }
+        })
+    },
+    /* 提交订单 */
+    submit() {
+        let that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认提交订单?',
+            complete: (res) => {
+                if (res.confirm) _Http.basic({
+                    "id": 20221108153402,
+                    "content": {
+                        sa_orderid: that.data.sa_orderid
+                    },
+                }).then(s => {
+                    console.log("提交订单", s)
+                    wx.showToast({
+                        title: s.msg != '成功' ? s.msg : '提交成功',
+                        icon: "none"
+                    });
+                    if (s.msg == '成功') that.setData({
+                        "detail.status": "提交"
+                    })
+                })
+            }
+        })
+    },
+    /* 确认订单交期 */
+    notarize() {
+        let that = this;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认交期?',
+            complete: (res) => {
+                if (res.confirm) _Http.basic({
+                    "id": 20221230094802,
+                    "content": {
+                        sa_orderid: that.data.sa_orderid
+                    },
+                }).then(s => {
+                    console.log("确认交期", s)
+                    wx.showToast({
+                        title: s.msg != '成功' ? s.msg : '提交成功',
+                        icon: "none"
+                    });
+                })
+            }
+        })
+    },
+    /* 判断是否可以编辑 */
+    isEdit() {
+        if (this.data.detail.status != '新建') wx.showToast({
+            title: '当前订单状态不可设置!',
+            icon: "none"
+        });
+        return this.data.detail.status != '新建';
+    },
+    /* 拷贝订单 */
+    copyItem() {
+        let item = this.data.detail;
+        wx.showModal({
+            title: '提示',
+            content: `是否确认复制${item.type}“${item.sonum}”`,
+            complete: (res) => {
+                if (res.confirm) _Http.basic({
+                    "id": 20230102144502,
+                    "content": {
+                        "sa_orderid": item.sa_orderid
+                    }
+                }).then(res => {
+                    console.log("复制订单", res)
+                    if (res.msg != '成功') return wx.showToast({
+                        title: res.msg,
+                        icon: "none"
+                    });
+                    wx.showModal({
+                        title: '提示',
+                        content: `${item.type}复制成功 是否立即前往`,
+                        complete: (s) => {
+                            if (s.confirm) wx.redirectTo({
+                                url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
+                            })
+                        }
+                    })
 
-				})
-			}
-		})
-	},
-	/* 设置项目订单品牌领域 */
-	setBraned() {
-		wx.navigateTo({
-			url: './modules/setBrand/index?id=' + this.data.sa_orderid,
-		})
-	},
-	onUnload() {
-		let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
-		let content = page.data.content;
-		content.pageNumber = 1;
-		content.pageSize = page.data.list.length;
-		_Http.basic({
-			"id": 20221224180302,
-			content
-		}).then(res => {
-			console.log("订单列表", res)
-			page.setData({
-				list: res.data,
-				"content.total": res.total,
-				amount: res.tips.amount || 0
-			})
-		})
-	},
+                })
+            }
+        })
+    },
+    /* 设置项目订单品牌领域 */
+    setBraned() {
+        wx.navigateTo({
+            url: './modules/setBrand/index?id=' + this.data.sa_orderid,
+        })
+    },
+    onUnload() {
+        let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
+        let content = page.data.content;
+        content.pageNumber = 1;
+        content.pageSize = page.data.list.length;
+        _Http.basic({
+            "id": wx.getStorageSync('userMsg').usertype == 1 ? 20221111145202 : 20221224180302,
+            content
+        }).then(res => {
+            console.log("订单列表", res)
+            page.setData({
+                list: res.data,
+                "content.total": res.total,
+                amount: res.tips.amount || 0
+            })
+        })
+    },
 })

+ 1 - 1
packageA/orderForm/detail.wxml

@@ -8,7 +8,7 @@
     <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>
+        <!-- <text wx:if="{{detail.status=='新建' && detail.type=='项目订单'}}" style="background-color: #4BD863;" bindtap="setBraned">设置品牌/领域</text> -->
     </view>
     <view class="exp">订单类型:{{detail.type}}</view>
     <view class="exp">订单状态:{{detail.status}}</view>

+ 1 - 1
packageA/orderForm/index.js

@@ -55,7 +55,7 @@ Page({
         if (init) content.pageNumber = 1;
         if (content.pageNumber > content.pageTotal) return;
         _Http.basic({
-            "id": 20221224180302,
+            "id": wx.getStorageSync('userMsg').usertype == 1 ? 20221111145202 : 20221224180302,
             content
         }).then(res => {
             console.log("订单列表", res)

+ 235 - 235
packageA/orderForm/modules/product/index.js

@@ -1,185 +1,185 @@
 const _Http = getApp().globalData.http,
-	file = require("../../../../utils/FormatTheAttachment");
+    file = require("../../../../utils/FormatTheAttachment");
 let queue = [],
-	downCounter = null;
+    downCounter = null;
 Component({
-	properties: {
-		disabled: Boolean, //禁用
-	},
-	data: {
-		sa_orderid: 0,
-		"content": {
-			nocache: true,
-			"pageNumber": 1,
-			pageTotal: 1,
-			total: null
-		}
-	},
-	lifetimes: {
-		detached: function () {
-			if (downCounter) {
-				clearTimeout(downCounter);
-				this.changeItem(queue)
-			}
-		},
-	},
-	methods: {
-		/* 获取产品列表 */
-		getList(id, init) {
-			let content = this.data.content;
-			content.sa_orderid = id;
+    properties: {
+        disabled: Boolean, //禁用
+    },
+    data: {
+        sa_orderid: 0,
+        "content": {
+            nocache: true,
+            "pageNumber": 1,
+            pageTotal: 1,
+            total: null
+        }
+    },
+    lifetimes: {
+        detached: function () {
+            if (downCounter) {
+                clearTimeout(downCounter);
+                this.changeItem(queue)
+            }
+        },
+    },
+    methods: {
+        /* 获取产品列表 */
+        getList(id, init) {
+            let content = this.data.content;
+            content.sa_orderid = id;
 
-			if (init) content.pageNumber = 1;
-			_Http.basic({
-				"id": "20221109093902",
-				content
-			}).then(res => {
-				console.log("订货清单列表", res)
-				if (res.msg != '成功') return wx.showToast({
-					title: res.msg,
-					icon: "none"
-				})
-				res.data = res.data.map(value => {
-					if (value.attinfos.length != 0) {
-						value.attinfos = file.fileList(value.attinfos)
-						let image = value.attinfos.find(v => v.fileType == "image");
-						value.cover = image ? image.cover : "";
-					}
-					return value;
-				})
-				let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail;
-				let base = {
-					sa_orderid: page.sa_orderid,
-					sys_enterpriseid: page.sys_enterpriseid,
-					sa_contractid: page.sa_contractid,
-					type: page.type,
-				};
-				this.setData({
-					list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
-					"content.pageNumber": res.pageNumber + 1,
-					"content.pageSize": res.pageSize,
-					"content.pageTotal": res.pageTotal,
-					"content.total": res.total,
-					sa_orderid: id,
-					base
-				})
-			})
-		},
-		/* 统一交期 */
-		dateChange(e) {
-			let that = this;
-			wx.showModal({
-				title: '提示',
-				content: `是否确定将当前产品列表交期统一设置为:${e.detail.value}`,
-				complete: (res) => {
-					if (res.confirm) _Http.basic({
-						"id": 20230104143802,
-						"content": {
-							"sa_orderid": that.data.sa_orderid,
-							"needdate": e.detail.value
-						}
-					}).then(res => {
-						console.log('统一设置交期', res)
-						wx.showToast({
-							title: res.msg == '成功' ? '设置成功' : res.msg,
-							icon: "none"
-						})
-						if (res.msg == '成功') that.setData({
-							list: that.data.list.map(v => {
-								v.needdate = e.detail.value;
-								return v
-							})
-						})
-					})
-				}
-			})
-		},
-		/* 修改 */
-		changeProduct({
-			detail
-		}) {
-			let obj = detail,
-				index = this.data.list.findIndex(v => v.itemid == detail.itemid),
-				data = this.data.list[index],
-				calculatePrice = data.qty != obj.qty;
-			if (data.qty == obj.qty && data.remarks == obj.remarks && data.needdate == obj.needdate) return;
-			_Http.basic({
-				"id": 20221109093602,
-				"content": {
-					...this.data.base,
-					"items": [detail]
-				}
-			}).then(res => {
-				console.log("产品修改", res)
-				if (res.msg != '成功') {
-					wx.showToast({
-						title: res.msg,
-						icon: "none"
-					});
-					obj = data;
-				};
-				data = {
-					...data,
-					...obj
-				};
-				if (res.msg == '成功' && calculatePrice) {
-					let page = getCurrentPages()[getCurrentPages().length - 1];
-					if (page) {
-						let amount = page.data.detail.amount - data.amount;
-						data.amount = ((data.qty - 0) * (data.price - 0)).toFixed(2);
-						amount = (amount + (data.amount - 0)).toFixed(2);
-						page.setData({
-							"detail.amount": amount - 0
-						})
-					}
-				}
-				this.setData({
-					[`list[${index}]`]: data
-				})
-			})
-		},
-		/* 删除 */
-		deleteItem({
-			detail
-		}) {
-			let that = this;
-			wx.showModal({
-				title: '提示',
-				content: `是否确认删除“${detail.itemname}”?`,
-				complete: (res) => {
-					if (res.confirm) _Http.basic({
-						"id": 20221109093702,
-						"content": {
-							sa_orderid: detail.sa_orderid,
-							"sa_orderitemsids": [
-								detail.sa_orderitemsid
-							]
-						}
-					}).then(s => {
-						if (s.msg != '成功') return wx.showToast({
-							title: res.msg,
-							icon: "none"
-						});
-						that.setData({
-							list: that.data.list.filter(v => v.sa_orderitemsid != detail.sa_orderitemsid)
-						});
-						/* 更新金额 */
-						let page = getCurrentPages()[getCurrentPages().length - 1];
-						let amount = (page.data.detail.amount - detail.amount).toFixed(2);
-						if (page) page.setData({
-							"detail.amount": amount - 0
-						})
-					})
-				}
-			})
-		},
-		/* 去添加产品 */
-		addProduct() {
-			let detail = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail;
-			console.log(detail)
-			wx.navigateTo({
-				url: `/select/product/index?params=${JSON.stringify({
-					"id": detail.type=='项目合同'?20230103155002:20221109153502,
+            if (init) content.pageNumber = 1;
+            _Http.basic({
+                "id": "20221109093902",
+                content
+            }).then(res => {
+                console.log("订货清单列表", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                })
+                res.data = res.data.map(value => {
+                    if (value.attinfos.length != 0) {
+                        value.attinfos = file.fileList(value.attinfos)
+                        let image = value.attinfos.find(v => v.fileType == "image");
+                        value.cover = image ? image.cover : "";
+                    }
+                    return value;
+                })
+                let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail;
+                let base = {
+                    sa_orderid: page.sa_orderid,
+                    sys_enterpriseid: page.sys_enterpriseid,
+                    sa_contractid: page.sa_contractid,
+                    type: page.type,
+                };
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageSize": res.pageSize,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    sa_orderid: id,
+                    base
+                })
+            })
+        },
+        /* 统一交期 */
+        dateChange(e) {
+            let that = this;
+            wx.showModal({
+                title: '提示',
+                content: `是否确定将当前产品列表交期统一设置为:${e.detail.value}`,
+                complete: (res) => {
+                    if (res.confirm) _Http.basic({
+                        "id": 20230104143802,
+                        "content": {
+                            "sa_orderid": that.data.sa_orderid,
+                            "needdate": e.detail.value
+                        }
+                    }).then(res => {
+                        console.log('统一设置交期', res)
+                        wx.showToast({
+                            title: res.msg == '成功' ? '设置成功' : res.msg,
+                            icon: "none"
+                        })
+                        if (res.msg == '成功') that.setData({
+                            list: that.data.list.map(v => {
+                                v.needdate = e.detail.value;
+                                return v
+                            })
+                        })
+                    })
+                }
+            })
+        },
+        /* 修改 */
+        changeProduct({
+            detail
+        }) {
+            let obj = detail,
+                index = this.data.list.findIndex(v => v.itemid == detail.itemid),
+                data = this.data.list[index],
+                calculatePrice = data.qty != obj.qty;
+            if (data.qty == obj.qty && data.remarks == obj.remarks && data.needdate == obj.needdate) return;
+            _Http.basic({
+                "id": 20221109093602,
+                "content": {
+                    ...this.data.base,
+                    "items": [detail]
+                }
+            }).then(res => {
+                console.log("产品修改", res)
+                if (res.msg != '成功') {
+                    wx.showToast({
+                        title: res.msg,
+                        icon: "none"
+                    });
+                    obj = data;
+                };
+                data = {
+                    ...data,
+                    ...obj
+                };
+                if (res.msg == '成功' && calculatePrice) {
+                    let page = getCurrentPages()[getCurrentPages().length - 1];
+                    if (page) {
+                        let amount = page.data.detail.amount - data.amount;
+                        data.amount = ((data.qty - 0) * (data.price - 0)).toFixed(2);
+                        amount = (amount + (data.amount - 0)).toFixed(2);
+                        page.setData({
+                            "detail.amount": amount - 0
+                        })
+                    }
+                }
+                this.setData({
+                    [`list[${index}]`]: data
+                })
+            })
+        },
+        /* 删除 */
+        deleteItem({
+            detail
+        }) {
+            let that = this;
+            wx.showModal({
+                title: '提示',
+                content: `是否确认删除“${detail.itemname}”?`,
+                complete: (res) => {
+                    if (res.confirm) _Http.basic({
+                        "id": 20221109093702,
+                        "content": {
+                            sa_orderid: detail.sa_orderid,
+                            "sa_orderitemsids": [
+                                detail.sa_orderitemsid
+                            ]
+                        }
+                    }).then(s => {
+                        if (s.msg != '成功') return wx.showToast({
+                            title: res.msg,
+                            icon: "none"
+                        });
+                        that.setData({
+                            list: that.data.list.filter(v => v.sa_orderitemsid != detail.sa_orderitemsid)
+                        });
+                        /* 更新金额 */
+                        let page = getCurrentPages()[getCurrentPages().length - 1];
+                        let amount = (page.data.detail.amount - detail.amount).toFixed(2);
+                        if (page) page.setData({
+                            "detail.amount": amount - 0
+                        })
+                    })
+                }
+            })
+        },
+        /* 去添加产品 */
+        addProduct() {
+            let detail = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/detail').data.detail;
+            console.log(detail)
+            wx.navigateTo({
+                url: `/select/product/index?params=${JSON.stringify({
+					"id": detail.type=='项目订单'?20230103155002:20221109153502,
 					"content": {
 						nocache:true,
 						"sa_orderid": this.data.sa_orderid, //订单ID
@@ -192,61 +192,61 @@ Component({
 						}
 					}
 				})}`
-			});
-			getApp().globalData.handleSelect = this.handleSelect.bind(this);
-		},
-		/* 处理新增产品 */
-		handleSelect(detail) {
-			let that = this;
-			wx.showModal({
-				title: '提示',
-				content: `是否确认添加${detail.result.length}件商品?`,
-				complete: (res) => {
-					if (res.confirm) _Http.basic({
-						"id": 20221109093602,
-						"content": {
-							...that.data.base,
-							"items": detail.list.map(v => {
-								return {
-									sa_orderitemsid: 0,
-									"itemid": v.itemid, //商品ID
-									"qty": 1, //数量
-								}
-							})
-						}
-					}).then(s => {
-						console.log('新增产品', s)
-						wx.showToast({
-							title: s.msg == '成功' ? '添加成功' : s.msg,
-							icon: "none"
-						});
-						if (s.msg == '成功') setTimeout(() => {
-							that.getList(that.data.sa_orderid, true);
-							wx.navigateBack();
-							that.updateThePrice();
-						}, 300)
-					})
-				}
-			});
-		},
-		/* 使用接口更新总价 */
-		updateThePrice() {
-			_Http.basic({
-				"id": 20230105101102,
-				"content": {
-					"sa_orderid": this.data.sa_orderid
-				},
-			}).then(res => {
-				console.log("获取列表总价", res)
-				if (res.msg != '成功') return wx.showToast({
-					title: `产品总价更新失败`,
-					icon: "none"
-				});
-				let page = getCurrentPages()[getCurrentPages().length - 1];
-				if (page) page.setData({
-					"detail.amount": res.data.amount - 0
-				})
-			})
-		}
-	}
+            });
+            getApp().globalData.handleSelect = this.handleSelect.bind(this);
+        },
+        /* 处理新增产品 */
+        handleSelect(detail) {
+            let that = this;
+            wx.showModal({
+                title: '提示',
+                content: `是否确认添加${detail.result.length}件商品?`,
+                complete: (res) => {
+                    if (res.confirm) _Http.basic({
+                        "id": 20221109093602,
+                        "content": {
+                            ...that.data.base,
+                            "items": detail.list.map(v => {
+                                return {
+                                    sa_orderitemsid: 0,
+                                    "itemid": v.itemid, //商品ID
+                                    "qty": 1, //数量
+                                }
+                            })
+                        }
+                    }).then(s => {
+                        console.log('新增产品', s)
+                        wx.showToast({
+                            title: s.msg == '成功' ? '添加成功' : s.msg,
+                            icon: "none"
+                        });
+                        if (s.msg == '成功') setTimeout(() => {
+                            that.getList(that.data.sa_orderid, true);
+                            wx.navigateBack();
+                            that.updateThePrice();
+                        }, 300)
+                    })
+                }
+            });
+        },
+        /* 使用接口更新总价 */
+        updateThePrice() {
+            _Http.basic({
+                "id": 20230105101102,
+                "content": {
+                    "sa_orderid": this.data.sa_orderid
+                },
+            }).then(res => {
+                console.log("获取列表总价", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: `产品总价更新失败`,
+                    icon: "none"
+                });
+                let page = getCurrentPages()[getCurrentPages().length - 1];
+                if (page) page.setData({
+                    "detail.amount": res.data.amount - 0
+                })
+            })
+        }
+    }
 })

+ 1 - 1
pages/base/index.js

@@ -49,7 +49,7 @@ Page({
             console.log("客户商机列表", res)
             this.selectComponent('#ListBox').RefreshToComplete();
             if (res.msg != '成功') return wx.showToast({
-                title: res.data,
+                title: res.msg,
                 icon: "none"
             })
             this.setData({

+ 53 - 1
pages/tabbar/home/index.js

@@ -39,6 +39,58 @@ Page({
                 bColor: "#F4FAEF",
                 icon: "icon-dingdan"
             })
+            /* ------------------------------- */
+            /* gridList.push({
+                name: "订货",
+                path: "#",
+                color: "#5AB73F",
+                bColor: "#F4FAEF",
+                icon: "icon-dingdan"
+            }) */
+      
+            gridList.push({
+                name: "促销活动",
+                path: "#",
+                color: "#3874F6",
+                bColor: "#F0F3FF",
+                icon: "icon-cuxiaohuodong"
+            })
+            gridList.push({
+                name: "开票",
+                path: "#",
+                color: "#EB4B5C",
+                bColor: "#FDF1ED",
+                icon: "icon-kaipiao"
+            })
+            gridList.push({
+                name: "账户",
+                path: "#",
+                color: "#EB4B5C",
+                bColor: "#FDF1ED",
+                icon: "icon-zhanghu"
+            })
+            gridList.push({
+                name: "收货",
+                path: "#",
+                color: "#3874F6",
+                bColor: "#F0F3FF",
+                icon: "icon-shouhuo"
+            })
+            gridList.push({
+                name: "数据查询",
+                path: "#",
+                color: "#F29C37",
+                bColor: "#FCF6EF",
+                icon: "icon-shujuchaxun"
+            })
+            gridList.push({
+                name: "业绩目标",
+                path: "#",
+                color: "#5AB73F",
+                bColor: "#F4FAEF",
+                icon: "icon-yejimubiao"
+            })
+            /* ------------------------------- */
             this.setData({
                 gridList
             })
@@ -115,7 +167,7 @@ Page({
     onHide() {
         clearInterval(DataCarousel);
     },
-    onReady(){
+    onReady() {
         this.setListHeight();
     },
     /* 设置页面高度 */

+ 3 - 0
pages/tabbar/home/index.scss

@@ -81,6 +81,9 @@
                 text-align: center;
                 line-height: 100rpx;
                 border-radius: 16rpx;
+                .iconfont{
+                    font-size: 38rpx;
+                }
             }
 
             .name {

+ 1 - 1
pages/tabbar/message/index.wxml

@@ -14,7 +14,7 @@
         </view>
         <view wx:if="{{item.isread=='0'}}" class="unread-item" />
     </navigator>
-    <My_empty wx:if="{{!list.length}}" />
+    <Yl_Empty wx:if="{{!list.length}}" />
     <view style="height: 180rpx;" />
 </Yl_ListBox>
 

+ 1 - 1
pages/teams/index.wxml

@@ -39,7 +39,7 @@
         </navigator>
     </block>
     <view style="height: 230rpx;" />
-    <My_empty wx:if="{{list.length==0}}" />
+    <Yl_Empty wx:if="{{list.length==0}}" />
 </Yl_ListBox>
 <view class="footer" wx:if="{{per.query(authList,butText+'新增')}}">
     <van-button custom-class='add-but' color="var(--assist)" bindtap="newItem">新建{{butText}}</van-button>

+ 1 - 1
pages/teams/modules/Pop-upMulti-select.wxml

@@ -5,7 +5,7 @@
 <van-action-sheet show="{{ show }}" title="{{title}}" safe-area-inset-bottom='{{false}}' bind:close='closeSelete'>
     <van-divider customStyle="margin-top:-5rpx; margin-bottom:-0rpx;" />
     <scroll-view class="scroll-view" scroll-y>
-        <My_empty sonMarTop='70' marTop="220rpx" wx:if="{{list.length==0}}" text='暂无角色' />
+        <Yl_Empty sonMarTop='70' marTop="220rpx" wx:if="{{list.length==0}}" text='暂无角色' />
         <van-checkbox-group value="{{ result }}" bind:change="onChange">
             <van-cell-group border='{{false}}'>
                 <van-cell border='{{false}}' wx:for="{{ list }}" title-class='title-class line-1' wx:key="index" title="{{ item.rolename }}" clickable data-index="{{ index }}" value-class='value-class' bind:click="toggle">

+ 7 - 0
project.private.config.json

@@ -29,6 +29,13 @@
           "query": "",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "开发首页",
+          "pathName": "pages/home/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }

+ 1 - 1
select/address/index.js

@@ -38,7 +38,7 @@ Page({
       console.log("选择经销商列表", res)
       this.selectComponent('#ListBox').RefreshToComplete();
       if (res.msg != '成功') return wx.showToast({
-        title: res.data,
+        title: res.msg,
         icon: "none"
       })
 

+ 1 - 1
select/agent/index.js

@@ -38,7 +38,7 @@ Page({
       console.log("选择经销商列表", res)
       this.selectComponent('#ListBox').RefreshToComplete();
       if (res.msg != '成功') return wx.showToast({
-        title: res.data,
+        title: res.msg,
         icon: "none"
       })
 

+ 1 - 1
select/contract/index.js

@@ -38,7 +38,7 @@ Page({
       console.log("选择合同列表", res)
       this.selectComponent('#ListBox').RefreshToComplete();
       if (res.msg != '成功') return wx.showToast({
-        title: res.data,
+        title: res.msg,
         icon: "none"
       })
 

+ 1 - 1
select/finance/index.js

@@ -38,7 +38,7 @@ Page({
       console.log("财务信息列表", res)
       this.selectComponent('#ListBox').RefreshToComplete();
       if (res.msg != '成功') return wx.showToast({
-        title: res.data,
+        title: res.msg,
         icon: "none"
       })
 

+ 1 - 1
select/product/index.js

@@ -39,7 +39,7 @@ Page({
 			console.log("选择产品列表", res)
 			this.selectComponent('#ListBox').RefreshToComplete();
 			if (res.msg != '成功') return wx.showToast({
-				title: res.data,
+				title: res.msg,
 				icon: "none"
 			})
 			res.data = res.data.map(value => {

+ 45 - 45
select/product/index.wxml

@@ -5,52 +5,52 @@
 <view class="total">共{{params.content.total}}个</view>
 
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
-	<navigator class="setclient-list-item" url="#" wx:for="{{list}}" wx:key="item.itemno" data-id="{{item[idname]}}" bindtap="changeResult">
-		<view class="mian">
-			<van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
-			<view class="img" data-file="{{item.attinfos}}" catchtap="viewImage">
-				<van-image width="100%" height="100%" wx:if="{{item.cover}}" src="{{item.cover}}" use-loading-slot use-error-slot lazy-load>
-					<van-loading slot="loading" type="spinner" size="20" vertical />
-					<text slot="error" style="font-size: 24rpx;">暂无图片</text>
-				</van-image>
-				<text wx:else class="err">暂无图片</text>
-			</view>
-			<view class="dec">
-				<view class="title line-1">
-					{{item.itemname}}
-				</view>
-				<view class="subfield line-1">
-					<text>品牌:{{item.brandName}}sdf sdf sdf</text>
-					领域:{{item.tradefields}}
-				</view>
-				<view class="price line-1">
-					价格:<text class="num">¥{{item.gradeprice}}</text><text wx:if="{{item.gradeprice<item.oldprice}}" style="text-decoration:line-through; color:#999;">/{{item.oldprice}}</text>
-				</view>
-			</view>
-		</view>
-		<view class="bot">
-			<text>型号:{{item.model||' --'}}</text>
-			<text>规格:{{item.spec||' --'}}</text>
-		</view>
-	</navigator>
-	<view wx:if="{{!radio}}" style="height: 130rpx;" />
-	<Yl_Empty wx:if="{{list.length==0}}" />
+    <navigator class="setclient-list-item" url="#" wx:for="{{list}}" wx:key="item.itemno" data-id="{{item[idname]}}" bindtap="changeResult">
+        <view class="mian">
+            <van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
+            <view class="img" data-file="{{item.attinfos}}" catchtap="viewImage">
+                <van-image width="100%" height="100%" wx:if="{{item.cover}}" src="{{item.cover}}" use-loading-slot use-error-slot lazy-load>
+                    <van-loading slot="loading" type="spinner" size="20" vertical />
+                    <text slot="error" style="font-size: 24rpx;">暂无图片</text>
+                </van-image>
+                <text wx:else class="err">暂无图片</text>
+            </view>
+            <view class="dec">
+                <view class="title line-1">
+                    {{item.itemname}}
+                </view>
+                <view class="subfield line-1">
+                    <text>品牌:{{item.brandName}}sdf sdf sdf</text>
+                    领域:{{item.tradefields}}
+                </view>
+                <view class="price line-1">
+                    价格:<text class="num">¥{{item.gradeprice || item.price}}元</text><text wx:if="{{item.gradeprice<item.oldprice ||item.price<item.oldprice}}" style="text-decoration:line-through; color:#999;">/{{item.oldprice}}</text>
+                </view>
+            </view>
+        </view>
+        <view class="bot">
+            <text>型号:{{item.model||' --'}}</text>
+            <text>规格:{{item.spec||' --'}}</text>
+        </view>
+    </navigator>
+    <view wx:if="{{!radio}}" style="height: 130rpx;" />
+    <Yl_Empty wx:if="{{list.length==0}}" />
 </Yl_ListBox>
 
 <block wx:if="{{!radio}}">
-	<view class="footer">
-		<view class="count">
-			已选:{{result.length}}
-		</view>
-		<van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">确定</van-button>
-	</view>
-	<wxs module="handle">
-		module.exports = {
-			isCheck: function (id, list) {
-				return list.some(function (v) {
-					return v == id
-				});
-			},
-		}
-	</wxs>
+    <view class="footer">
+        <view class="count">
+            已选:{{result.length}}
+        </view>
+        <van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">确定</van-button>
+    </view>
+    <wxs module="handle">
+        module.exports = {
+            isCheck: function (id, list) {
+                return list.some(function (v) {
+                    return v == id
+                });
+            },
+        }
+    </wxs>
 </block>

+ 218 - 117
static/font-icon.wxss

@@ -1,118 +1,219 @@
 @font-face {
-  font-family: "iconfont"; /* Project id 3830173 */
-  src: url('//at.alicdn.com/t/c/font_3830173_w74silsfcrh.woff2?t=1672973980731') format('woff2'),
-       url('//at.alicdn.com/t/c/font_3830173_w74silsfcrh.woff?t=1672973980731') format('woff'),
-       url('//at.alicdn.com/t/c/font_3830173_w74silsfcrh.ttf?t=1672973980731') format('truetype');
-}
-
-.iconfont {
-  font-family: "iconfont" !important;
-  font-size: 16px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-
-.icon-a-wodemima:before {
-  content: "\e651";
-}
-
-.icon-a-wodetuanduiguanli:before {
-  content: "\e640";
-}
-
-.icon-a-wodeguanyuyingyong:before {
-  content: "\e646";
-}
-
-.icon-a-wodebangdingweixin:before {
-  content: "\e650";
-}
-
-.icon-shouhuo:before {
-  content: "\e677";
-}
-
-.icon-dingdan:before {
-  content: "\e678";
-}
-
-.icon-zhanghu:before {
-  content: "\e679";
-}
-
-.icon-kaipiao:before {
-  content: "\e67a";
-}
-
-.icon-tuifan:before {
-  content: "\e67b";
-}
-
-.icon-shangcheng:before {
-  content: "\e67c";
-}
-
-.icon-shujuchaxun:before {
-  content: "\e67d";
-}
-
-.icon-cuxiaohuodong:before {
-  content: "\e67e";
-}
-
-.icon-yejimubiao:before {
-  content: "\e67f";
-}
-
-.icon-a-biaoqianlanshouyexuanzhong:before {
-  content: "\e606";
-}
-
-.icon-a-biaoqianlanxiaoxi:before {
-  content: "\e609";
-}
-
-.icon-a-biaoqianlanwode:before {
-  content: "\e62a";
-}
-
-.icon-a-biaoqianlanwodexuanzhong:before {
-  content: "\e643";
-}
-
-.icon-a-biaoqianlanxiaoxixuanzhong:before {
-  content: "\e64a";
-}
-
-.icon-xiaoxigundong:before {
-  content: "\e674";
-}
-
-.icon-E-dingdanxitong:before {
-  content: "\e675";
-}
-
-.icon-a-sousuolansousuo:before {
-  content: "\e621";
-}
-
-.icon-dibu-bianji:before {
-  content: "\e69c";
-}
-
-.icon-guanlian-shanchu:before {
-  content: "\e6ab";
-}
-
-.icon-shaixuan:before {
-  content: "\e6b4";
-}
-
-.icon-shengxu:before {
-  content: "\e6b5";
-}
-
-.icon-jiangxu1:before {
-  content: "\e6b6";
-}
+    font-family: "iconfont"; /* Project id 3830173 */
+    src: url('//at.alicdn.com/t/c/font_3830173_qsp7hts10nb.woff2?t=1672987410772') format('woff2'),
+         url('//at.alicdn.com/t/c/font_3830173_qsp7hts10nb.woff?t=1672987410772') format('woff'),
+         url('//at.alicdn.com/t/c/font_3830173_qsp7hts10nb.ttf?t=1672987410772') format('truetype');
+  }
+  
+  .iconfont {
+    font-family: "iconfont" !important;
+    font-size: 16px;
+    font-style: normal;
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+  }
+  
+  .icon-zanwushuju:before {
+    content: "\e652";
+  }
+  
+  .icon-a-fanshenhetuihui:before {
+    content: "\e6c7";
+  }
+  
+  .icon-a-baobeibohuituihui:before {
+    content: "\e6c8";
+  }
+  
+  .icon-tijiao:before {
+    content: "\e6c9";
+  }
+  
+  .icon-tijiaobaobei:before {
+    content: "\e6ca";
+  }
+  
+  .icon-shenhe:before {
+    content: "\e6cb";
+  }
+  
+  .icon-tabdizhi:before {
+    content: "\e6cc";
+  }
+  
+  .icon-tabgenjindongtai1:before {
+    content: "\e6cd";
+  }
+  
+  .icon-tabgongjuqingdan:before {
+    content: "\e6ce";
+  }
+  
+  .icon-tabfujian1:before {
+    content: "\e6cf";
+  }
+  
+  .icon-tabbaojiadan:before {
+    content: "\e6d0";
+  }
+  
+  .icon-tabchanpinleibie:before {
+    content: "\e6d1";
+  }
+  
+  .icon-tabgenjinjilu:before {
+    content: "\e6d2";
+  }
+  
+  .icon-tabchanpin:before {
+    content: "\e6d3";
+  }
+  
+  .icon-tabcaozuojilu1:before {
+    content: "\e6d4";
+  }
+  
+  .icon-tabkehu:before {
+    content: "\e6d5";
+  }
+  
+  .icon-tabjingzhengduishou:before {
+    content: "\e6d6";
+  }
+  
+  .icon-tabrenwu:before {
+    content: "\e6d7";
+  }
+  
+  .icon-tabkaipiaoxinxi:before {
+    content: "\e6d8";
+  }
+  
+  .icon-tabxiansuo:before {
+    content: "\e6d9";
+  }
+  
+  .icon-tabxiangxixinxi1:before {
+    content: "\e6da";
+  }
+  
+  .icon-tablianxiren:before {
+    content: "\e6db";
+  }
+  
+  .icon-tabxiangmu:before {
+    content: "\e6dc";
+  }
+  
+  .icon-tabxiangmupinggu:before {
+    content: "\e6dd";
+  }
+  
+  .icon-tabhetong:before {
+    content: "\e6de";
+  }
+  
+  .icon-a-wodemima:before {
+    content: "\e651";
+  }
+  
+  .icon-a-wodetuanduiguanli:before {
+    content: "\e640";
+  }
+  
+  .icon-a-wodeguanyuyingyong:before {
+    content: "\e646";
+  }
+  
+  .icon-a-wodebangdingweixin:before {
+    content: "\e650";
+  }
+  
+  .icon-shouhuo:before {
+    content: "\e677";
+  }
+  
+  .icon-dingdan:before {
+    content: "\e678";
+  }
+  
+  .icon-zhanghu:before {
+    content: "\e679";
+  }
+  
+  .icon-kaipiao:before {
+    content: "\e67a";
+  }
+  
+  .icon-tuifan:before {
+    content: "\e67b";
+  }
+  
+  .icon-shangcheng:before {
+    content: "\e67c";
+  }
+  
+  .icon-shujuchaxun:before {
+    content: "\e67d";
+  }
+  
+  .icon-cuxiaohuodong:before {
+    content: "\e67e";
+  }
+  
+  .icon-yejimubiao:before {
+    content: "\e67f";
+  }
+  
+  .icon-a-biaoqianlanshouyexuanzhong:before {
+    content: "\e606";
+  }
+  
+  .icon-a-biaoqianlanxiaoxi:before {
+    content: "\e609";
+  }
+  
+  .icon-a-biaoqianlanwode:before {
+    content: "\e62a";
+  }
+  
+  .icon-a-biaoqianlanwodexuanzhong:before {
+    content: "\e643";
+  }
+  
+  .icon-a-biaoqianlanxiaoxixuanzhong:before {
+    content: "\e64a";
+  }
+  
+  .icon-xiaoxigundong:before {
+    content: "\e674";
+  }
+  
+  .icon-E-dingdanxitong:before {
+    content: "\e675";
+  }
+  
+  .icon-a-sousuolansousuo:before {
+    content: "\e621";
+  }
+  
+  .icon-dibu-bianji:before {
+    content: "\e69c";
+  }
+  
+  .icon-guanlian-shanchu:before {
+    content: "\e6ab";
+  }
+  
+  .icon-shaixuan:before {
+    content: "\e6b4";
+  }
+  
+  .icon-shengxu:before {
+    content: "\e6b5";
+  }
+  
+  .icon-jiangxu1:before {
+    content: "\e6b6";
+  }
+  

+ 1 - 1
utils/Http.js

@@ -43,7 +43,7 @@ class HTTP {
                         url: '/pages/login/phone',
                     });
                     wx.showToast({
-                        title: res.data.msg,
+                        title: res.msg,
                         icon: "none"
                     })
                 }