Bladeren bron

工具退返单

xiaohaizhao 2 jaren geleden
bovenliggende
commit
89f75b6794

+ 4 - 1
app.json

@@ -49,7 +49,10 @@
         "toolBill/modules/selectOrder/index",
         "borrow/index",
         "borrow/detail",
-        "betweenFee/index"
+        "betweenFee/index",
+        "returnOne/index",
+        "returnOne/detail",
+        "returnOne/update"
       ]
     },
     {

+ 219 - 0
packageA/returnOne/detail.js

@@ -0,0 +1,219 @@
+const _Http = getApp().globalData.http;
+let sa_aftersalesmagid = null;
+Page({
+  data: {
+    tabsList: [{
+      label: "详细信息",
+      icon: "icon-tabchanpin"
+    }, {
+      label: "商品明细",
+      icon: "icon-tabcaozuojilu1",
+      model: "#Product"
+    }],
+  },
+  onLoad(options) {
+    sa_aftersalesmagid = options.id;
+    this.setData({
+      userrole: wx.getStorageSync('userrole')
+    })
+    this.getDetail();
+  },
+  //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_aftersalesmagid;
+      if (total == null || init) {
+        Component.getList(id, init);
+      } else if (pageNumber < pageTotal) {
+        Component.getList(id, false);
+      }
+    }
+  },
+  getDetail() {
+    _Http.basic({
+      "id": 20230104160603,
+      "version": 1,
+      "content": {
+        sa_aftersalesmagid
+      }
+    }).then(res => {
+      console.log("退返单", res)
+      if (res.msg != '成功') {
+        wx.showToast({
+          title: res.msg,
+          icon: "none",
+          mask: true
+        })
+        setTimeout(() => {
+          wx.navigateBack()
+        }, 500)
+        return;
+      };
+      this.setPreview(res.data);
+      this.partialRenewal();
+    })
+  },
+  /* 设置详情信息 */
+  setPreview(data) {
+    let list1 = [{
+        label: "单号",
+        value: data.billno
+      }, {
+        label: "单据日期",
+        value: data.billdate
+      }, {
+        label: "状态",
+        value: data.status
+      }, {
+        label: '来源单号',
+        value: data.sonum
+      }, {
+        label: '订单使用返利金占比',
+        value: data.rebate_userate + '%'
+      }, {
+        label: '是否实物返回',
+        value: data.isitemreturn ? '是' : '否'
+      }, {
+        label: '定金账户',
+        value: data.accountname
+      }, {
+        label: "提交日期",
+        value: data.submitdate
+      }, {
+        label: "原因",
+        value: data.reason
+      }],
+      list2 = [{
+        label: "创建人",
+        value: data.createby
+      }, {
+        label: "创建时间",
+        value: data.createdate
+      }, {
+        label: "审核人",
+        value: data.checkby
+      }, {
+        label: "审核时间",
+        value: data.checkdate
+      }];
+    this.setData({
+      list1,
+      list2,
+      detail: data
+    })
+  },
+  submit() {
+    let that = this;
+    wx.showModal({
+      title: '提示',
+      content: '是否确定提交申请单?',
+      complete: ({
+        confirm
+      }) => {
+        if (confirm) _Http.basic({
+          "id": 20230105161603,
+          "version": 1,
+          "content": {
+            sa_aftersalesmagid
+          }
+        }).then(res => {
+          console.log("提交订单", res)
+          wx.showToast({
+            title: res.msg == '成功' ? '提交成功!' : res.msg,
+            icon: "none",
+            mask: true
+          });
+          if (res.msg == '成功') that.setData({
+            "detail.status": "提交"
+          })
+        })
+      }
+    })
+  },
+  notarize() {
+    let that = this;
+    wx.showModal({
+      title: '提示',
+      content: '是否确定取消提交申请单?',
+      complete: ({
+        confirm
+      }) => {
+        if (confirm) _Http.basic({
+          "id": 20230105161703,
+          "version": 1,
+          "content": {
+            sa_aftersalesmagid
+          }
+        }).then(res => {
+          console.log("取消提交订单", res)
+          wx.showToast({
+            title: res.msg == '成功' ? '取消成功!' : res.msg,
+            icon: "none",
+            mask: true
+          });
+          if (res.msg == '成功') that.setData({
+            "detail.status": "新建"
+          })
+        })
+      }
+    })
+  },
+  deleteItem() {
+    wx.showModal({
+      title: '提示',
+      content: '是否确定删除申请单?',
+      complete: ({
+        confirm
+      }) => {
+        if (confirm) _Http.basic({
+          "id": 20230104160803,
+          "version": 1,
+          "content": {
+            "sa_aftersalesmagids": [sa_aftersalesmagid]
+          }
+        }).then(res => {
+          console.log("删除", res)
+          wx.showToast({
+            title: res.msg == '成功' ? '删除成功!' : res.msg,
+            icon: "none",
+            mask: true
+          });
+          if (res.msg == '成功') setTimeout(() => {
+            wx.navigateBack()
+          }, 500)
+        })
+      }
+    })
+  },
+  onUnload() {
+    let page = getCurrentPages().find(v => v.__route__ == 'packageA/returnOne/index');
+    let content = JSON.parse(JSON.stringify(page.data.content));
+    content.pageNumber = 1;
+    content.pageSize = (page.data.content.pageNumber - 1) * page.data.content.pageSize;
+    _Http.basic({
+      "id": 20230105161503,
+      content
+    }).then(res => {
+      console.log("更新申请单", res)
+      page.setData({
+        list: res.data,
+      })
+    })
+  },
+})

+ 6 - 0
packageA/returnOne/detail.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "Preview": "/packageA/shipment/modules/preview/index",
+    "Product": "/packageA/returnOne/modules/product/index"
+  }
+}

+ 91 - 0
packageA/returnOne/detail.scss

@@ -0,0 +1,91 @@
+.intr {
+	position: relative;
+	width: 100vw;
+	box-sizing: border-box;
+	background-color: #fff;
+	padding: 20rpx 30rpx;
+
+	.num {
+		height: 40rpx;
+		line-height: 40rpx;
+		font-size: 32rpx;
+		font-family: PingFang SC-Bold, PingFang SC;
+		font-weight: bold;
+		color: #333333;
+	}
+
+	.tags {
+		margin-bottom: 15rpx;
+
+		text {
+			display: inline-block;
+			height: 40rpx;
+			line-height: 40rpx;
+			background: #E7EEFF;
+			border-radius: 20rpx;
+			padding: 0 15rpx;
+			font-size: 20rpx;
+			color: #fff;
+			margin-right: 10rpx;
+		}
+	}
+
+	.exp {
+		height: 34rpx;
+		line-height: 34rpx;
+		font-size: 26rpx;
+		margin-bottom: 8rpx;
+		color: #666;
+	}
+
+}
+
+
+.footer {
+	display: flex;
+	justify-content: space-between;
+	padding: 0 30rpx;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	box-sizing: border-box;
+	z-index: 9999;
+	padding-top: 10rpx;
+
+	.price {
+		line-height: 90rpx;
+		view {
+			font-size: 24rpx;
+			color: rgb(163, 162, 162);
+		}
+
+		.count {
+			font-size: 32rpx;
+			font-weight: bold;
+			color: var(--error);
+			margin: 2rpx 0 10rpx 0;
+		}
+	}
+
+
+
+	.but-box {
+		.but {
+			min-width: 156rpx;
+			height: 90rpx;
+			background: #3874F6;
+			border-radius: 8rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC-Bold, PingFang SC;
+			font-weight: bold;
+			color: #FFFFFF;
+		}
+
+		.delete {
+			background: var(--warning);
+		}
+	}
+}

+ 35 - 0
packageA/returnOne/detail.wxml

@@ -0,0 +1,35 @@
+<view class="intr">
+	<view class="num">
+		{{detail.billno}}
+	</view>
+	<view style="height: 20rpx;" />
+	<block wx:if="{{userrole!='经销商'}}">
+		<view class="exp">经销商:{{detail.enterprisename || '暂无'}}</view>
+		<view class="exp">经销编号:{{detail.agentnum || '暂无'}}</view>
+	</block>
+	<view class="exp">单据类型/日期:{{detail.type}} / {{detail.billdate || '暂无'}}</view>
+	<view class="exp">来源单号:{{detail.sonum || '暂无'}}</view>
+	<view class="exp">订单使用返利金占比:{{detail.rebate_userate+'%'}}</view>
+	<view class="exp">是否实物退回:{{detail.isitemreturn==1?'是':'否'}}</view>
+	<view class="exp">订单账户:{{detail.accountname||"--"}}</view>
+	<view class="exp">订单状态:{{detail.status}}</view>
+</view>
+
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+	<Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+	<Product disabled="{{detail.status != '新建'}}" detail="{{detail}}" slot="商品明细" id="Product" bind:onSuccess="getDetail" />
+	<view style="height: 160rpx;" />
+</Yl_FunTabs>
+
+<view class="footer">
+	<view class="price">
+		<view class="count">
+			¥{{detail.returnamount||'0'}}元
+		</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>

+ 61 - 0
packageA/returnOne/index.js

@@ -0,0 +1,61 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    list: [],
+    loading: true,
+    "content": {
+      nocache: true,
+      "isExport": 0,
+      "pageNumber": 1,
+      "pageTotal": 1,
+      "pageSize": 20,
+      "where": {
+        "condition": "",
+        "tablefilter": {},
+        "status": ""
+      },
+      "type": "退货单"
+    },
+  },
+  onLoad(options) {
+    this.setData({
+      userrole: wx.getStorageSync('userrole')
+    })
+    this.getList(true)
+  },
+  /* 获取产品 */
+  getList(init = false) {
+    if (init.detail != undefined) init = init.detail;
+    let content = this.data.content;
+    if (init) content.pageNumber = 1;
+    if (content.pageNumber > content.pageTotal) return;
+    _Http.basic({
+      "id": 20230105161503,
+      content
+    }).then(res => {
+      console.log("退返列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      this.setData({
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+        "content.pageNumber": res.pageNumber + 1,
+        "content.pageTotal": res.pageTotal,
+        "content.sort": res.sort,
+        "content.total": res.total,
+        loading: false,
+      })
+    })
+  },
+  tabsChange(e) {
+    this.data.content.where.status = e.detail.title == '全部' ? '' : e.detail.title;
+    this.getList(true);
+  },
+  onReady() {
+    this.selectComponent("#ListBox").setHeight(".tab", this);
+  },
+  toAdd(e) {
+    wx.navigateTo({
+      url: '/packageA/returnOne/update'
+    })
+  }
+})

+ 5 - 0
packageA/returnOne/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "List": "./modules/list/index"
+  }
+}

+ 0 - 0
packageA/returnOne/index.scss


+ 17 - 0
packageA/returnOne/index.wxml

@@ -0,0 +1,17 @@
+<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<van-tabs class="tab" active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+	<van-tab title="全部" />
+	<van-tab title="新建" />
+	<van-tab title="提交" />
+	<van-tab title="审核" />
+	<van-tab title="复核" />
+</van-tabs>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<view style="height: 20rpx;" />
+	<List list="{{list}}" userrole="{{userrole}}" />
+	<view style="height: 20px;" />
+</Yl_ListBox>
+<!-- 新建浮动按钮 -->
+<Yl_FloatingButton bindtap="toAdd" />
+<!-- 筛选条件 -->
+<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />

+ 6 - 0
packageA/returnOne/modules/list/index.js

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

+ 4 - 0
packageA/returnOne/modules/list/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 64 - 0
packageA/returnOne/modules/list/index.scss

@@ -0,0 +1,64 @@
+.item {
+	width: 100vw;
+	padding-left: 30rpx;
+	box-sizing: border-box;
+	margin-bottom: 20rpx;
+	background-color: #ffffff;
+
+	.top {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			height: 80rpx;
+			width: 100%;
+			border-bottom: 1rpx solid #ddd;
+			box-sizing: border-box;
+			padding-right: 30rpx;
+			font-size: 28rpx;
+	}
+
+	.content {
+			position: relative;
+
+			.num {
+					height: 40rpx;
+					line-height: 40rpx;
+					font-size: 28rpx;
+					color: #333333;
+					padding: 20rpx 0;
+			}
+
+			.exp {
+					height: 34rpx;
+					font-size: 24rpx;
+					margin-bottom: 8rpx;
+					color: #999999;
+			}
+
+			.amount {
+					position: absolute;
+					font-size: 28rpx;
+					color: #FF3B30;
+					bottom: 0;
+					right: 30rpx;
+			}
+	}
+
+	.bottom {
+			height: 72rpx;
+			line-height: 72rpx;
+			margin-top: 12rpx;
+			border-top: 1rpx solid #ddd;
+			box-sizing: border-box;
+			padding-right: 30rpx;
+			font-size: 24rpx;
+			color: #666666;
+	}
+}
+
+/* 文本行数限制 */
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}

+ 53 - 0
packageA/returnOne/modules/list/index.wxml

@@ -0,0 +1,53 @@
+<navigator url="/packageA/returnOne/detail?id={{item.sa_aftersalesmagid}}" class="item" wx:for="{{list}}" wx:key="sonum">
+	<view class="top">
+		单据日期:{{item.billdate}}
+		<view style="color: {{set.color(item.status)}};">
+			{{item.status}}
+		</view>
+	</view>
+	<view class="content">
+		<view class="num">
+			单号:{{item.billno}}
+		</view>
+		<view class="exp" wx:if="{{userrole !='经销商'}}">
+			经销商:{{item.enterprisename || ' --'}}
+		</view>
+		<view class="exp">
+			来源单号:{{item.sonum || ' --'}}
+		</view>
+		<view class="exp">
+			使用返利占比:{{item.rebate_userate+'%'}}
+		</view>
+		<view class="exp">
+			是否实物退回:{{item.isitemreturn==1?'是':'否'}}
+		</view>
+		<view class="amount">
+			退款额:¥{{item.returnamount||0}}元
+		</view>
+	</view>
+	<view class="bottom line-1">
+		原因:{{item.reason ||'--'}}
+	</view>
+</navigator>
+
+<Yl_Empty wx:if="{{list.length==0}}" />
+
+<wxs module="set">
+	module.exports = {
+		color: function (statu) {
+			var color = '#999999';
+			switch (statu) {
+				case "审核":
+					color = '#FA8C16';
+					break;
+				case "提交":
+					color = '#52C41A';
+					break;
+				case "新建":
+					color = '#333333';
+					break;
+			};
+			return color;
+		}
+	}
+</wxs>

+ 189 - 0
packageA/returnOne/modules/product/index.js

@@ -0,0 +1,189 @@
+const _Http = getApp().globalData.http,
+  file = require("../../../../utils/FormatTheAttachment");
+Component({
+  properties: {
+    disabled: Boolean, //禁用
+  },
+  data: {
+    sa_aftersalesmagid: 0,
+    "content": {
+      nocache: true,
+      pageNumber: 1,
+      pageTotal: 1,
+      total: null
+    }
+  },
+  methods: {
+    /* 获取产品列表 */
+    getList(id, init) {
+      let content = this.data.content;
+      content.sa_aftersalesmagid = id;
+      content.sa_orderid = getCurrentPages().find(v => v.__route__ == 'packageA/returnOne/detail').data.detail.sa_orderid;
+      if (init) content.pageNumber = 1;
+
+      _Http.basic({
+        "id": "20230105111103",
+        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;
+        })
+        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_aftersalesmagid: id,
+        })
+      })
+    },
+    /* 修改 */
+    changeProduct({
+      detail
+    }) {
+      let obj = detail,
+        index = this.data.list.findIndex(v => v.itemid == detail.itemid),
+        data = this.data.list[index],
+        page = getCurrentPages()[getCurrentPages().length - 1]
+      if (data.qty == obj.qty && data.reason == obj.reason && data.price == obj.price) return;
+      _Http.basic({
+        "id": 20230105111003,
+        "content": {
+          "sa_aftersalesmagid": this.data.sa_aftersalesmagid,
+          "iteminfos": [detail]
+        }
+      }).then(res => {
+        console.log("产品修改", res)
+        if (res.msg != '成功') {
+          wx.showToast({
+            title: res.msg,
+            icon: "none"
+          });
+          obj = data;
+        };
+        data = {
+          ...data,
+          ...obj
+        };
+        data.amount = res.data[0].amount
+        this.setData({
+          [`list[${index}]`]: data
+        })
+        this.updateThePrice();
+      })
+    },
+    /* 删除 */
+    deleteItem({
+      detail
+    }) {
+      console.log(detail)
+      let that = this;
+      wx.showModal({
+        title: '提示',
+        content: `是否确认删除“${detail.itemname}”?`,
+        complete: (res) => {
+          if (res.confirm) _Http.basic({
+            "id": 20230105111203,
+            "content": {
+              sa_aftersalesmag_itemsids: [detail.sa_aftersalesmag_itemsid],
+            }
+          }).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)
+            });
+            that.updateThePrice();
+          })
+        }
+      });
+    },
+    /* 去添加产品 */
+    addProduct() {
+      let detail = getCurrentPages().find(v => v.__route__ == 'packageA/returnOne/detail').data.detail;
+      wx.navigateTo({
+        url: `/packageA/toolBill/modules/selectProduct/index?params=${JSON.stringify({
+					"id":20230105110903,
+					"content": {
+						nocache:true,
+						"sa_orderid": detail.sa_orderid, //订单ID
+						"sa_aftersalesmagid": detail.sa_aftersalesmagid, //订单ID
+						"pageNumber": 1,
+						"pageTotal": 1,
+						"total": 0,
+						"pageSize": 20,
+						"where": {
+							"condition": ""
+						}
+					}
+				})}`
+      });
+      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": 20230105111003,
+            "content": {
+              sa_aftersalesmagid: that.data.sa_aftersalesmagid,
+              "iteminfos": detail.list.map(v => {
+                return {
+                  "sa_aftersalesmag_itemsid": 0,
+                  "sa_orderitemsid": v.sa_orderitemsid,
+                  "itemid": v.itemid,
+                  "reason": '',
+                  "qty": 1,
+                  "price": v.price
+                }
+              })
+            }
+          }).then(s => {
+            console.log('新增产品', s)
+            wx.showToast({
+              title: s.msg == '成功' ? '添加成功' : s.msg,
+              icon: "none"
+            });
+
+            if (s.msg == '成功') setTimeout(() => {
+              that.getList(that.data.sa_aftersalesmagid, true);
+              that.updateThePrice();
+              wx.navigateBack();
+            }, 300)
+          })
+        }
+      });
+    },
+    updateThePrice() {
+      _Http.basic({
+        "id": 20230104160603,
+        "version": 1,
+        "content": {
+          sa_aftersalesmagid: this.data.sa_aftersalesmagid
+        }
+      }, false).then(res => {
+        let page = getCurrentPages().find(v => v.route == 'packageA/returnOne/detail');
+        if (page) page.setData({
+          "detail.returnamount": res.data.returnamount
+        })
+      })
+    }
+  }
+})

+ 6 - 0
packageA/returnOne/modules/product/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "List": "../../../toolBill/modules/toolDetail/list/index"
+  }
+}

+ 1 - 0
packageA/returnOne/modules/product/index.scss

@@ -0,0 +1 @@
+@import "../../../../static/common-head.scss";

+ 10 - 0
packageA/returnOne/modules/product/index.wxml

@@ -0,0 +1,10 @@
+<view class="head">
+  <view class="count">商品明细</view>
+  <view class="expand">
+    <navigator wx:if="{{!disabled}}" url="#" class="but" bindtap="addProduct">
+      <van-icon name="plus" />
+    </navigator>
+  </view>
+</view>
+
+<List list='{{list}}' disabled='{{disabled}}' bindchangeProduct='changeProduct' binddeleteItem="deleteItem" />

+ 194 - 0
packageA/returnOne/update.js

@@ -0,0 +1,194 @@
+const _Http = getApp().globalData.http,
+  getTime = require("../../utils/getTime");
+
+Page({
+  data: {
+    showAll: false,
+    disabled: true,
+    content: {
+      "sa_aftersalesmagid": 0,
+      "sa_orderid": "",
+      "reason": "",
+      "billdate": "",
+      "type": "退货单"
+    },
+
+  },
+  onLoad(options) {
+    let form = [{
+      label: "返退原因",
+      error: false,
+      errMsg: "",
+      type: "texteara",
+      value: "",
+      placeholder: "请输入返退原因",
+      valueName: "reason",
+      required: false,
+
+    }, {
+      label: "是否实物退回",
+      error: false,
+      errMsg: "",
+      type: "radio",
+      radioList: [{
+          name: '是',
+          id: 1
+        },
+        {
+          name: '否',
+          id: 0
+        },
+      ],
+      value: 1,
+      valueName: "isitemreturn",
+      required: true,
+    }];
+    form.unshift(wx.getStorageSync('userrole') == '业务员' ? {
+      label: "所属经销商",
+      error: false,
+      errMsg: "",
+      type: "route",
+      url: "/select/agent/index",
+      params: {
+        "id": 20220920083901,
+        "content": {
+          nocache: true,
+          "where": {
+            "condition": "",
+            "type": 9,
+          }
+        }
+      },
+      query: '&radio=true&idname=sys_enterpriseid',
+      value: "",
+      placeholder: "选择经销商",
+      valueName: "sys_enterpriseid",
+      checking: "base",
+      required: true,
+      interrupt: true
+    } : {
+      label: "订单号",
+      error: false,
+      errMsg: "",
+      type: "route",
+      url: "/packageA/toolBill/modules/selectOrder/index",
+      params: {
+        "id": 20230105110003,
+        "content": {
+          nocache: true,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      query: '&radio=true',
+      value: "",
+      placeholder: "选择订单号",
+      valueName: "sa_orderid",
+      checking: "base",
+      required: true
+    })
+    this.setData({
+      form
+    })
+    if (options.rowData) {
+      let data = JSON.parse(options.rowData);
+      console.log(data);
+      this.setData({
+        form: form.map(v => {
+          if (v.valueName != 'region') {
+            if (v.valueName == 'enterprisename') {
+              v.value = [data[v.valueName]]
+            } else {
+              v.value = data[v.valueName];
+            }
+          } else {
+            v.value = data.province ? [data.province, data.city, data.county] : []
+          }
+          return v
+        }),
+        'form[0].value': [data.sonum, [data.sa_orderid]],
+        'content.sa_aftersalesmagid': data.sa_aftersalesmagid
+      })
+      this.selectComponent('#Form').confirm()
+    }
+  },
+  /* 打断处理form */
+  interrupt({
+    detail
+  }) {
+    detail.form[detail.temporary.index].value = detail.data.value;
+    detail.form.splice(1, detail.form.some(v => v.label == '订单号') ? 1 : 0, {
+      label: "订单号",
+      error: false,
+      errMsg: "",
+      type: "route",
+      url: "/packageA/toolBill/modules/selectOrder/index",
+      params: {
+        "id": 20230105110003,
+        "content": {
+          nocache: true,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          },
+          sys_enterpriseid: detail.data.id[0]
+        }
+      },
+      query: '&radio=true',
+      value: "",
+      placeholder: "选择订单号",
+      valueName: "sa_orderid",
+      checking: "base",
+      required: true
+    })
+    this.setData({
+      form: detail.form
+    })
+    wx.navigateBack()
+  },
+  async submit() {
+    let content = {
+      ...this.data.content,
+      ...this.selectComponent("#Form").submit()
+    }
+    content.sa_orderid = content.sa_orderid[1][0] || '';
+    content.sys_enterpriseid = content.sys_enterpriseid[1][0] || '';
+    
+    let res = await _Http.basic({
+      "id": "20230104160503",
+      content
+    })
+    console.log(res)
+    wx.showToast({
+      title: res.msg == '成功' ? '创建成功' : res.msg,
+      icon: "none",
+      mask: true
+    })
+
+    setTimeout(() => {
+      wx.redirectTo({
+        url: '/packageA/returnOne/detail?id=' + res.data.sa_aftersalesmagid,
+      })
+    }, 500)
+  },
+  // 是否显示全部
+  onChange({
+    detail
+  }) {
+    this.setData({
+      showAll: detail
+    })
+  },
+  /* 表单必填项是否完成 */
+  onConfirm({
+    detail
+  }) {
+    this.setData({
+      disabled: detail
+    })
+  }
+})

+ 5 - 0
packageA/returnOne/update.json

@@ -0,0 +1,5 @@
+{
+	"usingComponents": {
+		"Yl_Headline": "/components/Yl_Headline/index"
+	}
+}

+ 26 - 0
packageA/returnOne/update.scss

@@ -0,0 +1,26 @@
+.footer {
+	display: flex;
+	justify-content: center;
+	padding: 0 30rpx;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	box-sizing: border-box;
+	z-index: 9999;
+	padding-top: 10rpx;
+
+	.but {
+			width: 690rpx;
+			height: 90rpx;
+			background: var(--warning);
+			border-radius: 16rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC-Bold, PingFang SC;
+			font-weight: bold;
+			color: #fff;
+	}
+
+}

+ 7 - 0
packageA/returnOne/update.wxml

@@ -0,0 +1,7 @@
+<Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填信息' switch='{{showAll}}' bind:callBack='onChange' />
+<Yl_Field id='Form' form='{{form}}' showAll='{{!showAll}}' bind:onConfirm='onConfirm' bind:interrupt="interrupt">
+	<view slot='discountrate' style="margin-right: 36rpx;">%</view>
+</Yl_Field>
+<view class="footer">
+	<van-button custom-class='but' disabled="{{disabled}}" bind:click="submit">提交</van-button>
+</view>

+ 1 - 1
packageA/toolBill/modules/toolDetail/list/index.wxml

@@ -40,7 +40,7 @@
 	<view class="bot">
 		<view class="row">
 			<view>
-				<view class="label">单价:{{item.price}}</view>
+				<view class="label" style="width: 200px;">单价:{{item.price}}</view>
 			</view>
 		</view>
 		<view class="row">

+ 4 - 0
pages/tabbar/home/index.js

@@ -237,6 +237,10 @@ Page({
                     name: "工具归还",
                     path: "/packageA/toolBill/index",
                     icon: "work-shujuchaxun"
+                }, {
+                    name: "退返申请",
+                    path: "/packageA/returnOne/index",
+                    icon: "work-shujuchaxun"
                 }, {
                     name: "居间费结算",
                     path: "/packageA/betweenFee/index",