Explorar el Código

试用申请调整,新增产品组件新增筛选

qymljy hace 4 meses
padre
commit
2b4952a2ae

+ 19 - 2
components/Yl_Filtrate1/modules/multilevelClass.js

@@ -35,9 +35,10 @@ Component({
                 });
             } else {
                 getApp().globalData.temporaryId = this.data.item.selectKey ? item[this.data.item.selectKey] : JSON.parse(JSON.stringify(item));
-                this.setData({
+                if(item.subarea){
+                  this.setData({
                     "item.index": i,
-                    childClass: item.subarea.length ? {
+                    childClass: item.subarea.length  ? {
                         index: null,
                         label: item.itemclassname ? item.itemclassname + getApp().globalData.Language.getMapText('的下级分类') : item.areaname + getApp().globalData.Language.getMapText('的下级区域'),
                         list: item.subarea,
@@ -49,6 +50,22 @@ Component({
                         id: getApp().globalData.temporaryId
                     } : null
                 });
+                }else{
+                  this.setData({
+                    "item.index": i,
+                    childClass: item.subdep.length ? {
+                        index: null,
+                        label: item.itemclassname ? item.itemclassname + getApp().globalData.Language.getMapText('的下级分类') : item.areaname + getApp().globalData.Language.getMapText('的下级区域'),
+                        list: item.subdep,
+                        selectKey: this.data.item.selectKey,
+                        showName: this.data.item.showName,
+                        type: this.data.item.type,
+                        value: "",
+                        valueKey: this.data.item.valueKey,
+                        id: getApp().globalData.temporaryId
+                    } : null
+                });
+                }
             };
         }
     }

+ 323 - 291
components/Yl_field/index.js

@@ -1,311 +1,343 @@
 const verify = require('../../utils/deleteMark');
 
 Component({
-    externalClasses: [],
-    properties: {
-        form: {
-            type: Array
-        },
-        showAll: {
-            type: Boolean,
-            value: true
-        }, //不显示必填项
-        onConfirm: {
-            type: Function
-        },
-        interrupt: {
-            type: Function
-        }, //打断处理,用于条件判断 把form返回到上个页面处理重新传入
+  externalClasses: [],
+  properties: {
+    form: {
+      type: Array
     },
-    lifetimes: {
-        attached: function () {
-            getApp().globalData.Language.getLanguagePackage(this)
-            this.setData({
-                languagecode: wx.getStorageSync('languagecode')
-            })
-        },
+    showAll: {
+      type: Boolean,
+      value: true
+    }, //不显示必填项
+    onConfirm: {
+      type: Function
     },
-    data: {
-        temporary: null, //route选择暂存选中项
-        voiceIndex: null,
-        seconds: 60,
+    interrupt: {
+      type: Function
+    }, //打断处理,用于条件判断 把form返回到上个页面处理重新传入
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+      this.setData({
+        languagecode: wx.getStorageSync('languagecode')
+      })
     },
-    options: {
-        multipleSlots: true, //允许使用多个slot
-        addGlobalClass: true
+  },
+  data: {
+    temporary: null, //route选择暂存选中项
+    voiceIndex: null,
+    seconds: 60,
+  },
+  options: {
+    multipleSlots: true, //允许使用多个slot
+    addGlobalClass: true
+  },
+  methods: {
+    onVoiceInput(e) {
+      this.setData({
+        [`form[${e.currentTarget.dataset.index}].value`]: e.detail
+      });
+      this.confirm();
     },
-    methods: {
-        onVoiceInput(e) {
-            this.setData({
-                [`form[${e.currentTarget.dataset.index}].value`]: e.detail
-            });
-            this.confirm();
-        },
-        toOptions(e) {
-            const {
-                item
-            } = e.currentTarget.dataset;
-            wx.navigateTo({
-                url: '/prsx/select/options/index?data=' + JSON.stringify(item),
-            })
-        },
-        route(e) {
-            const {
-                item
-            } = e.currentTarget.dataset;
-            if (item.disabled) return;
-            getApp().globalData.handleSelect = this.handleRoute.bind(this);
-            let result = (item.query && !item.query.indexOf("radio=true") && item.value[1]) ? `` : `&result=${JSON.stringify(item.value[1])}`
-            wx.navigateTo({
-                url: item.url + '?params=' + JSON.stringify(item.params) + (item.query || '') + result + `&value=${JSON.stringify(item.value)}`,
-                fail(err) {
-                    console.log(err)
-                }
-            });
-            this.setData({
-                temporary: {
-                    item: item,
-                    index: this.data.form.findIndex(v => v.valueName == item.valueName)
-                }
-            })
-        },
-        /* 处理路由返回结果 */
-        handleRoute(data) {
-            let temporary = this.data.temporary;
-            if (temporary.item.interrupt) {
-                this.triggerEvent("interrupt", {
-                    data,
-                    form: this.data.form,
-                    temporary
-                });
-            } else {
-                wx.navigateBack();
-                this.setData({
-                    [`form[${temporary.index}].value`]: data.value
-                });
-                this.confirm()
-            };
-            this.data.temporary = null;
-        },
-        onBlur(e) {
-            let item = e.target.dataset.item,
-                index = this.data.form.findIndex(v => v.valueName === item.valueName);
-            if (item.interrupt) this.triggerEvent("interrupt", {
-                data: this.data.form[index],
-                form: this.data.form,
-                temporary: {
-                    item,
-                    index
-                }
-            });
-        },
-        /* 改变值 */
-        inputChange(e) {
-            let item = e.target.dataset.item,
-                index = this.data.form.findIndex(v => v.valueName === item.valueName),
-                value = e.detail;
-            //校验规则 不填:不校验 "base":默认校验 "phone":手机号 "mail":邮箱 "telephone":固定电话 "正则表达式":以自定义内容为校验标准
-            if (item.checking) {
-                let reg = item.checking;
-                switch (item.checking) {
-                    case 'base':
-                        value = verify.queryStr(value);
-                        break;
-                    case 'phone':
-                        reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
-                        this.setData({
-                            [`form[${index}].errMsg`]: !reg.test(value) ? getApp().globalData.Language.getMapText('号码格式错误') || '请输入正确的11位手机号码!' : ''
-                        });
-                        break;
-                    case "telephone":
-                        let i = e.target.dataset.i;
-                        value = item.value;
-                        value[i] = e.detail.value;
-                        let result = value[0] + "-" + value[1];
-                        reg = /^0\d{2,3}-[1-9]\d{6,7}$/
-                        this.setData({
-                            [`form[${index}].errMsg`]: !reg.test(result) ? getApp().globalData.Language.getMapText('号码格式错误') || '请填写正确的座机电话' : '',
-                            [`form[${index}].result`]: result,
-                        });
-                        break;
-                    case 'mail':
-                        reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
-                        this.setData({
-                            [`form[${index}].errMsg`]: !reg.test(value) ? getApp().globalData.Language.getMapText('请输入正确的邮箱格式') : ''
-                        });
-                        break;
-                    case 'twoDecimalPlaces':
-                        reg = /^(\d+(?:\.\d{0,2})?)?$/;
-                        this.setData({
-                            [`form[${index}].errMsg`]: !reg.test(value) ? '仅允许保留2位小数' : ''
-                        });
-                        break;
-
-                    default:
-                        reg = new RegExp(reg);
-                        this.setData({
-                            [`form[${index}].errMsg`]: !reg.test(value) ? item.hint || getApp().globalData.Language.getMapText('输入文本不符合条件!') || '输入文本不符合条件!' : ''
-                        });
-                        break;
-                };
-            };
-            this.setData({
-                [`form[${index}].value`]: value,
-                [`form[${index}].error`]: false,
-            });
-            if (!item.required && value == '') this.setData({
-                [`form[${index}].errMsg`]: "",
-            });
-            this.confirm();
-        },
-        /* 单列选择器 */
-        bindSelectorChange(e) {
-            let {
-                item,
-                index
-            } = e.target.dataset,
-                value = e.detail.value;
-            this.setData({
-                [`form[${index}].value`]: item.range[value][item.selectKey || item.rangeKey],
-                [`form[${index}].rangeIndex`]: value,
-                [`form[${index}].error`]: false,
-            });
-            if (item.interrupt) this.triggerEvent("interrupt", {
-                data: this.data.form[index],
-                form: this.data.form,
-                temporary: {
-                    item,
-                    index
-                }
-            });
-            this.confirm();
-        },
-        /* 日期,时间 选择器 */
-        bindDateChange(e) {
-            let item = e.target.dataset.item,
-                index = this.data.form.findIndex(v => v.valueName === item.valueName),
-                value = e.detail.value;
-            this.setData({
-                [`form[${index}].value`]: value,
-                [`form[${index}].error`]: false,
-            });
-            if (item.interrupt) this.triggerEvent("interrupt", {
-                data: this.data.form[index],
-                form: this.data.form,
-                temporary: {
-                    item,
-                    index
-                }
-            });
-            this.confirm();
-        },
-        /* 时间范围选择器 */
-        rangeDateChange(e) {
-            let item = e.target.dataset.item,
-                i = e.target.dataset.index,
-                index = this.data.form.findIndex(v => v.valueName === item.valueName),
-                value = e.detail.value;
+    toOptions(e) {
+      const {
+        item
+      } = e.currentTarget.dataset;
+      wx.navigateTo({
+        url: '/prsx/select/options/index?data=' + JSON.stringify(item),
+      })
+    },
+    route(e) {
+      const {
+        item
+      } = e.currentTarget.dataset;
+      if (item.disabled) return;
+      getApp().globalData.handleSelect = this.handleRoute.bind(this);
+      let result = (item.query && !item.query.indexOf("radio=true") && item.value[1]) ? `` : `&result=${JSON.stringify(item.value[1])}`
+      wx.navigateTo({
+        url: item.url + '?params=' + JSON.stringify(item.params) + (item.query || '') + result + `&value=${JSON.stringify(item.value)}`,
+        fail(err) {
+          console.log(err)
+        }
+      });
+      this.setData({
+        temporary: {
+          item: item,
+          index: this.data.form.findIndex(v => v.valueName == item.valueName)
+        }
+      })
+    },
+    /* 处理路由返回结果 */
+    handleRoute(data) {
+      let temporary = this.data.temporary;
+      if (temporary.item.interrupt) {
+        this.triggerEvent("interrupt", {
+          data,
+          form: this.data.form,
+          temporary
+        });
+      } else {
+        wx.navigateBack();
+        this.setData({
+          [`form[${temporary.index}].value`]: data.value
+        });
+        this.confirm()
+      };
+      this.data.temporary = null;
+    },
+    onBlur(e) {
+      let item = e.target.dataset.item,
+        index = this.data.form.findIndex(v => v.valueName === item.valueName);
+      if (item.interrupt) this.triggerEvent("interrupt", {
+        data: this.data.form[index],
+        form: this.data.form,
+        temporary: {
+          item,
+          index
+        }
+      });
+    },
+    /* 改变值 */
+    inputChange(e) {
+      let item = e.target.dataset.item,
+        index = this.data.form.findIndex(v => v.valueName === item.valueName),
+        value = e.detail;
+      //校验规则 不填:不校验 "base":默认校验 "phone":手机号 "mail":邮箱 "telephone":固定电话 "正则表达式":以自定义内容为校验标准
+      if (item.checking) {
+        let reg = item.checking;
+        switch (item.checking) {
+          case 'base':
+            value = verify.queryStr(value);
+            break;
+          case 'phone':
+            reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
             this.setData({
-                [`form[${index}].value[${i}]`]: value,
-                [`form[${index}].error`]: false,
+              [`form[${index}].errMsg`]: !reg.test(value) ? getApp().globalData.Language.getMapText('号码格式错误') || '请输入正确的11位手机号码!' : ''
             });
-            this.confirm();
-        },
-        /* 省市县 */
-        bindRegionChange(e) {
-            let item = e.currentTarget.dataset.item,
-                index = this.data.form.findIndex(v => v.valueName === item.valueName),
-                value = e.detail.value;
+            break;
+          case "telephone":
+            let i = e.target.dataset.i;
+            value = item.value;
+            value[i] = e.detail.value;
+            let result = value[0] + "-" + value[1];
+            reg = /^0\d{2,3}-[1-9]\d{6,7}$/
             this.setData({
-                [`form[${index}].value`]: value,
-                [`form[${index}].error`]: false,
+              [`form[${index}].errMsg`]: !reg.test(result) ? getApp().globalData.Language.getMapText('号码格式错误') || '请填写正确的座机电话' : '',
+              [`form[${index}].result`]: result,
             });
-            this.confirm();
-        },
-        /* 自定义选项 */
-        setOption(item) {
-            let i = this.data.form.findIndex(v => v.valueName == item.valueName);
+            break;
+          case 'mail':
+            reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
             this.setData({
-                [`form[${i}].value`]: item.value
+              [`form[${index}].errMsg`]: !reg.test(value) ? getApp().globalData.Language.getMapText('请输入正确的邮箱格式') : ''
             });
-            this.confirm();
-        },
-        /* 是否完成必填项 */
-        confirm() {
-            this.triggerEvent("onConfirm", this.data.form.some(v => {
-                if (v.type == "dateRange" && v.required) {
-                    return v.value[0] == "" || v.value[1] == "";
-                } else {
-                    return v.required && v.value == '';
-                }
-            }))
-        },
-        /* 性别 */
-        sexChange(e) {
-            let item = e.currentTarget.dataset.item,
-                index = this.data.form.findIndex(v => v.valueName === item.valueName);
+            break;
+          case 'twoDecimalPlaces':
+            reg = /^(\d+(?:\.\d{0,2})?)?$/;
             this.setData({
-                [`form[${index}].value`]: e.detail,
-                [`form[${index}].error`]: false,
+              [`form[${index}].errMsg`]: !reg.test(value) ? '仅允许保留2位小数' : ''
             });
-            this.confirm();
-        },
-        /* 单选 选择器改变 */
-        radioChange(e) {
-            let item = e.currentTarget.dataset.item,
-                index = this.data.form.findIndex(v => v.valueName == item.valueName);
-            if (this.data.form[index].value == e.detail) return;
+            break;
+
+          default:
+            reg = new RegExp(reg);
             this.setData({
-                [`form[${index}].value`]: e.detail,
-                [`form[${index}].error`]: false,
-            });
-            if (item.interrupt) this.triggerEvent("interrupt", {
-                data: this.data.form[index],
-                form: this.data.form,
-                temporary: {
-                    item,
-                    index
-                }
-            });
-            this.confirm();
-        },
-        /* 提交 */
-        submit() {
-            let obj = {},
-                isPass = false;
-            this.data.form.forEach((v, i) => {
-                obj[v.valueName] = v.value;
-                // permit 无视errMsg 允许通过
-                if (!v.permit && v.errMsg != '') {
-                    this.setData({
-                        [`form[${i}].error`]: true
-                    });
-                    isPass = true;
-                }
+              [`form[${index}].errMsg`]: !reg.test(value) ? item.hint || getApp().globalData.Language.getMapText('输入文本不符合条件!') || '输入文本不符合条件!' : ''
             });
-            if (isPass) {
-                wx.showToast({
-                    title: getApp().globalData.Language.getMapText('请检查表单内容'),
-                    icon: "none"
-                })
-            } else {
-                return obj;
-            }
-        },
-        /* 查询结果 不验证是否必填 */
-        query() {
-            let obj = {};
-            this.data.form.forEach(v => obj[v.valueName] = v.value);
-            return obj;
-        },
-        clearItem(e) {
-            const {
-                index
-            } = e.currentTarget.dataset;
-            console.log(index)
-            this.setData({
-                [`form[${index}].value`]: ""
-            })
+            break;
+        };
+      };
+      this.setData({
+        [`form[${index}].value`]: value,
+        [`form[${index}].error`]: false,
+      });
+      if (!item.required && value == '') this.setData({
+        [`form[${index}].errMsg`]: "",
+      });
+      this.confirm();
+    },
+    /* 单列选择器 */
+    bindSelectorChange(e) {
+      let {
+        item,
+        index
+      } = e.target.dataset,
+        value = e.detail.value;
+      this.setData({
+        [`form[${index}].value`]: item.range[value][item.selectKey || item.rangeKey],
+        [`form[${index}].rangeIndex`]: value,
+        [`form[${index}].error`]: false,
+      });
+      if (item.interrupt) this.triggerEvent("interrupt", {
+        data: this.data.form[index],
+        form: this.data.form,
+        temporary: {
+          item,
+          index
+        }
+      });
+      this.confirm();
+    },
+    /* 多列选择器 */
+    bindMultiSelectorChange(e) {
+      let {
+        item,
+        index
+      } = e.target.dataset,
+        value = e.detail.value;
+      console.log(value, '22222////')
+      this.setData({
+        [`form[${index}].value`]: item.range[value[0]][value[1]].subarea[0][item.selectKey || item.rangeKey],
+        [`form[${index}].rangeIndex`]: value,
+        [`form[${index}].error`]: false,
+      });
+      if (item.interrupt) this.triggerEvent("interrupt", {
+        data: this.data.form[index],
+        form: this.data.form,
+        temporary: {
+          item,
+          index
+        }
+      });
+      this.confirm();
+    },
+    bindcolumnchange(e) {
+      console.log(e, '切换列')
+      let {
+        item,
+        index
+      } = e.target.dataset,
+        value = e.detail.value;
+        console.log(item,index,value)
+    },
+    /* 日期,时间 选择器 */
+    bindDateChange(e) {
+      let item = e.target.dataset.item,
+        index = this.data.form.findIndex(v => v.valueName === item.valueName),
+        value = e.detail.value;
+      this.setData({
+        [`form[${index}].value`]: value,
+        [`form[${index}].error`]: false,
+      });
+      if (item.interrupt) this.triggerEvent("interrupt", {
+        data: this.data.form[index],
+        form: this.data.form,
+        temporary: {
+          item,
+          index
+        }
+      });
+      this.confirm();
+    },
+    /* 时间范围选择器 */
+    rangeDateChange(e) {
+      let item = e.target.dataset.item,
+        i = e.target.dataset.index,
+        index = this.data.form.findIndex(v => v.valueName === item.valueName),
+        value = e.detail.value;
+      this.setData({
+        [`form[${index}].value[${i}]`]: value,
+        [`form[${index}].error`]: false,
+      });
+      this.confirm();
+    },
+    /* 省市县 */
+    bindRegionChange(e) {
+      let item = e.currentTarget.dataset.item,
+        index = this.data.form.findIndex(v => v.valueName === item.valueName),
+        value = e.detail.value;
+      this.setData({
+        [`form[${index}].value`]: value,
+        [`form[${index}].error`]: false,
+      });
+      this.confirm();
+    },
+    /* 自定义选项 */
+    setOption(item) {
+      let i = this.data.form.findIndex(v => v.valueName == item.valueName);
+      this.setData({
+        [`form[${i}].value`]: item.value
+      });
+      this.confirm();
+    },
+    /* 是否完成必填项 */
+    confirm() {
+      this.triggerEvent("onConfirm", this.data.form.some(v => {
+        if (v.type == "dateRange" && v.required) {
+          return v.value[0] == "" || v.value[1] == "";
+        } else {
+          return v.required && v.value == '';
         }
+      }))
+    },
+    /* 性别 */
+    sexChange(e) {
+      let item = e.currentTarget.dataset.item,
+        index = this.data.form.findIndex(v => v.valueName === item.valueName);
+      this.setData({
+        [`form[${index}].value`]: e.detail,
+        [`form[${index}].error`]: false,
+      });
+      this.confirm();
+    },
+    /* 单选 选择器改变 */
+    radioChange(e) {
+      let item = e.currentTarget.dataset.item,
+        index = this.data.form.findIndex(v => v.valueName == item.valueName);
+      if (this.data.form[index].value == e.detail) return;
+      this.setData({
+        [`form[${index}].value`]: e.detail,
+        [`form[${index}].error`]: false,
+      });
+      if (item.interrupt) this.triggerEvent("interrupt", {
+        data: this.data.form[index],
+        form: this.data.form,
+        temporary: {
+          item,
+          index
+        }
+      });
+      this.confirm();
+    },
+    /* 提交 */
+    submit() {
+      let obj = {},
+        isPass = false;
+      this.data.form.forEach((v, i) => {
+        obj[v.valueName] = v.value;
+        // permit 无视errMsg 允许通过
+        if (!v.permit && v.errMsg != '') {
+          this.setData({
+            [`form[${i}].error`]: true
+          });
+          isPass = true;
+        }
+      });
+      if (isPass) {
+        wx.showToast({
+          title: getApp().globalData.Language.getMapText('请检查表单内容'),
+          icon: "none"
+        })
+      } else {
+        return obj;
+      }
+    },
+    /* 查询结果 不验证是否必填 */
+    query() {
+      let obj = {};
+      this.data.form.forEach(v => obj[v.valueName] = v.value);
+      return obj;
+    },
+    clearItem(e) {
+      const {
+        index
+      } = e.currentTarget.dataset;
+      console.log(index)
+      this.setData({
+        [`form[${index}].value`]: ""
+      })
     }
+  }
 })

+ 19 - 0
components/Yl_field/index.wxml

@@ -20,6 +20,25 @@
         <view wx:if="{{item.errMsg}}" class="error-tips">{{language[item.errMsg]||item.errMsg}}</view>
       </view>
     </view>
+    <!-- 多列选择器 -->
+    <view class="picker" wx:elif="{{item.type=='multiSelector'}}">
+      <view class="label">
+        <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
+        <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{language[item.label]||item.label}}</text>
+      </view>
+      <view style="position: relative;">
+        <view class="picker-slot" wx:if="{{item.slot}}">
+          <slot name="{{item.slot}}" />
+        </view>
+        <picker mode='multiSelector' range="{{item.range}}" range-key='{{item.rangeKey}}' value="{{item.rangeIndex}}" disabled="{{item.disabled}}" data-item="{{item}}" data-index="{{index}}" bindchange="bindMultiSelectorChange" bindcolumnchange="bindcolumnchange">
+          <view class="content">
+            <text wx:if="{{item.value}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{language[item.value]||item.value}}</text>
+            <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{language[item.placeholder]||item.placeholder}}</text>
+          </view>
+        </picker>
+        <view wx:if="{{item.errMsg}}" class="error-tips">{{language[item.errMsg]||item.errMsg}}</view>
+      </view>
+    </view>
     <!-- 日期选择器 -->
     <view class="picker" wx:elif="{{item.type=='date'}}">
       <view class="label">

+ 7 - 0
project.private.config.json

@@ -10,6 +10,13 @@
     "condition": {
         "miniprogram": {
             "list": [
+                {
+                    "name": "prsx/dealer/Salesperson/insert",
+                    "pathName": "prsx/dealer/Salesperson/insert",
+                    "query": "sa_agentsid=3529&name=undefined",
+                    "scene": null,
+                    "launchMode": "default"
+                },
                 {
                     "name": "prsx/dealer/detail",
                     "pathName": "prsx/dealer/detail",

+ 125 - 184
prsx/dealer/Salesperson/index.js

@@ -1,197 +1,138 @@
 const _Http = getApp().globalData.http;
 
 Component({
-    properties: {
-        disabled: {
-            type: Boolean,
-            value: true
+  properties: {
+    disabled: {
+      type: Boolean,
+      value: true
+    }
+  },
+  options: {
+    addGlobalClass: true
+  },
+  data: {
+    sys_enterpriseid: 0,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageSize: 10,
+      pageTotal: 1,
+      total: null,
+      where: {
+        condition: ""
+      }
+    },
+    list: [],
+    showSearch: false,
+    focus: false,
+    condition: ""
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+    }
+  },
+  methods: {
+    getList(id,init = false) {
+      let content = {
+        ...this.data.content,
+        sys_enterpriseid: id || this.data.sys_enterpriseid
+      };
+      if (init) {
+        content.pageNumber = 1
+        content.pageTotal = 1
+      }
+      _Http.basic({
+        "id": 2025061911194602,
+        content
+      }).then(res => {
+        console.log("授权业务员", res)
+        if (res.code != '1') return wx.showToast({
+          title: res.data,
+          icon: "none"
+        });
+        let list = res.data
+        this.setData({
+          "content.pageNumber": res.pageNumber + 1,
+          "content.pageTotal": res.pageTotal,
+          "content.total": res.total,
+          list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+          sys_enterpriseid: content.sys_enterpriseid
+        })
+      })
+    },
+    insetr() {
+      const page = getCurrentPages().find(v => v.__route__ == 'prsx/dealer/detail'),
+        detail = page.data.detail;
+      wx.navigateTo({
+        url: `/prsx/dealer/Salesperson/insert?sa_agentsid=${detail.sa_agentsid}&sys_enterpriseid=${detail.sys_enterpriseid}`,
+        complete(e) {
         }
+      })
+      console.log('新增数据-----')
+      let that = this
+      that.getList("", true)
+      getCurrentPages().find(v => v.__route__ == 'prsx/dealer/detail').getDetail()
     },
-    options: {
-        addGlobalClass: true
+    toSearch() {
+      if (this.data.showSearch && this.data.content.where.condition) {
+        this.data.content.where.condition = '';
+        this.getList("", true);
+      } else if (this.data.condition) {
+        this.data.content.where.condition = this.data.condition;
+        this.setData({
+          condition: this.data.condition
+        })
+        this.getList("", true);
+      }
+      this.setData({
+        showSearch: !this.data.showSearch
+      })
+      setTimeout(() => {
+        this.setData({
+          focus: this.data.showSearch
+        })
+      }, 300)
     },
-    data: {
-        sat_campaignid: 0,
-        content: {
-            nocache: true,
-            pageNumber: 1,
-            pageSize: 10,
-            pageTotal: 1,
-            total: null,
-            where: {
-                condition: ""
-            }
-        },
-        list: [],
-        showSearch: false,
-        focus: false,
-        condition: ""
+    onChange({
+      detail
+    }) {
+      this.data.condition = detail;
     },
-    lifetimes: {
-        attached: function () {
-            getApp().globalData.Language.getLanguagePackage(this)
-        }
+    onSearch({
+      detail
+    }) {
+      this.data.content.where.condition = detail;
+      this.getList("", true)
     },
-    methods: {
-        getList(id, init = false) {
-            let content = {
-                ...this.data.content,
-                sys_enterpriseid: id || this.data.sys_enterpriseid
-            };
-            if (init) {
-                content.pageNumber = 1
-                content.pageTotal = 1
-            }
-            _Http.basic({
-                "id": 2025061911194602,
-                content
-            }).then(res => {
-                console.log("授权业务员", res)
-                if (res.code != '1') return wx.showToast({
-                    title: res.data,
-                    icon: "none"
-                });
-                let list = res.data
-                this.setData({
-                    "content.pageNumber": res.pageNumber + 1,
-                    "content.pageTotal": res.pageTotal,
-                    "content.total": res.total,
-                    list: res.pageNumber == 1 ? list : this.data.list.concat(list),
-                    sat_campaignid: content.sat_campaignid
-                })
-            })
-        },
-        insetr() {
-            let params = {
-                "id": 2025103013523102,
-                "content": {
-                    "sat_campaignid": this.data.sat_campaignid,
-                    pageNumber: 1,
-                    pageSize: 20,
-                    "where": {
-                        "condition": ""
-                    }
-                }
-            };
-            wx.navigateTo({
-                url: '/prsx/select/docter/index?params=' + JSON.stringify(params) + '&radio=true',
+    deleteItem(e) {
+      const {
+        item
+      } = e.currentTarget.dataset,
+        that = this;
+      wx.showModal({
+        content: `是否确定删除“${item.name}”`,
+        complete: ({
+          confirm
+        }) => {
+          if (confirm) _Http.basic({
+            "id": 20221223141702,
+            "content": {
+              "sys_enterprise_tradefieldids": [item.sys_enterprise_tradefieldid]
+            },
+          }).then(res => {
+            console.log("删除授权业务员", res)
+            wx.showToast({
+              title: res.code == 1 ? '删除成功' : res.data,
+              icon: 'none'
             })
-            let that = this;
-            getApp().globalData.handleSelect = function ({
-                item
-            }) {
-                wx.showModal({
-                    content: `是否确定添加“${item.doctorname}”`,
-                    complete: ({
-                        confirm
-                    }) => {
-                        if (confirm) _Http.basic({
-                            "id": 2025103013511502,
-                            "content": {
-                                "sat_campaignid": that.data.sat_campaignid,
-                                "doctors": [{
-                                    "sat_campaign_doctorid": 0,
-                                    "sa_doctorid": item.sa_doctorid,
-                                    "amount": 0
-                                }]
-                            },
-                        }).then(res => {
-                            console.log("添加医生", res)
-                            wx.showToast({
-                                title: res.code == 1 ? '添加成功' : res.data,
-                                icon: 'none'
-                            })
-                            if (res.code == 1) {
-                                that.getList("", true)
-                                getCurrentPages().find(v => v.__route__ == 'prsx/select/docter/index').uploadList()
-                            }
-                        })
-
-                    }
-                })
-
-                console.log(item)
-            }.bind(this)
-        },
-        toSearch() {
-            if (this.data.showSearch && this.data.content.where.condition) {
-                this.data.content.where.condition = '';
-                this.getList("", true);
-            } else if (this.data.condition) {
-                this.data.content.where.condition = this.data.condition;
-                this.setData({
-                    condition: this.data.condition
-                })
-                this.getList("", true);
+            if (res.code == 1) {
+              that.getList("", true)
+              getCurrentPages().find(v => v.__route__ == 'prsx/dealer/detail').getDetail()
             }
-            this.setData({
-                showSearch: !this.data.showSearch
-            })
-            setTimeout(() => {
-                this.setData({
-                    focus: this.data.showSearch
-                })
-            }, 300)
-        },
-        onChange({
-            detail
-        }) {
-            this.data.condition = detail;
-        },
-        onSearch({
-            detail
-        }) {
-            this.data.content.where.condition = detail;
-            this.getList("", true)
-        },
-        deleteItem(e) {
-            const {
-                item
-            } = e.currentTarget.dataset,
-                that = this;
-            wx.showModal({
-                content: `是否确定删除“${item.doctorname}”`,
-                complete: ({
-                    confirm
-                }) => {
-                    if (confirm) _Http.basic({
-                        "id": 2025103013514902,
-                        "content": {
-                            "sat_campaignid": that.data.sat_campaignid,
-                            "sa_doctorid": [item.sa_doctorid]
-                        },
-                    }).then(res => {
-                        console.log("添加医生", res)
-                        wx.showToast({
-                            title: res.code == 1 ? '删除成功' : res.data,
-                            icon: 'none'
-                        })
-                        if (res.code == 1) {
-                            that.getList("", true)
-                            getCurrentPages().find(v => v.__route__ == 'prsx/activity/detail').getDetail()
-                        }
-                    })
-                }
-            })
-        },
-        changeAmount(e) {
-            let value = e.detail.value,
-                index = e.currentTarget.dataset.index;
-            this.data.list[index].amount = value;
-            _Http.basic({
-                "id": 2025103013511502,
-                "content": {
-                    "sat_campaignid": this.data.sat_campaignid,
-                    doctors: this.data.list
-                }
-            }).then(res => {
-                console.log("修改金额", res)
-                wx.showToast({
-                    title: res.code == 1 ? '修改成功' : res.msg,
-                    icon: "none"
-                })
-                if (res.code == 1) getCurrentPages().find(v => v.__route__ == 'prsx/activity/detail').getDetail()
-            })
+          })
         }
+      })
     }
+  }
 })

+ 14 - 12
prsx/dealer/Salesperson/index.wxml

@@ -18,25 +18,27 @@
 <view class="project-item" wx:for="{{list}}" wx:key="sa_doctorid">
 	<view class="main">
 		<view class="label">
-			{{item.doctorname}}
+			{{item.name}}
 		</view>
 		<view class="replenish">
-			<text style="color: #666;">职称:</text>
-			<text>{{item.professional}}</text>
+			<text style="color: #666;">编号:</text>
+			<text>{{item.hrcode}}</text>
 		</view>
 		<view class="replenish">
-			<text style="color: #666;">科室:</text>
-			<text>{{item.hospitaldepname || '--'}}</text>
+			<text style="color: #666;">营销区域:</text>
+			<text>{{item.areaname || '--'}}</text>
 		</view>
 		<view class="replenish">
-			<text style="color: #666;">医院:</text>
-			<text>{{item.hospitalname || '--'}}</text>
+			<text style="color: #666;">部门:</text>
+			<text>{{item.depname || '--'}}</text>
 		</view>
-
-		<view class="bottom">
-			<text style="color: #666;">产品培训费用:</text>
-			<input placeholder="费用(元)" type="digit" value="{{item.amount ||''}}" bindblur="changeAmount"
-				data-index="{{index}}" />
+    <view class="replenish">
+			<text style="color: #666;">职位:</text>
+			<text>{{item.position || '--'}}</text>
+		</view>
+    <view class="replenish">
+			<text style="color: #666;">手机号:</text>
+			<text>{{item.phonenumber || '--'}}</text>
 		</view>
 		<view wx:if="{{disabled}}" class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">
 			<view class="iconfont icon-shanchu1" />

+ 226 - 0
prsx/dealer/Salesperson/insert.js

@@ -0,0 +1,226 @@
+let _Http = getApp().globalData.http,
+  count = null;
+
+Page({
+  data: {
+    loading: false,
+    showAll: false,
+    repetitionShow: false,
+    repetitionList: [],
+    content: {
+      sys_enterprise_tradefieldid: 0,
+      sa_saleareaid: ''
+    },
+    disabled: true
+  },
+  async onLoad(options) {
+    console.log(options)
+    let form = [{
+      label: "营销区域",
+      error: false,
+      errMsg: "",
+      type: "selector",
+      range: [],
+      rangeKey: "areaname",
+      selectKey: "areaname",
+      rangeIndex: '',
+      value: '',
+      placeholder: "营销区域",
+      valueName: "sa_saleareaid",
+      required: true, //必填
+      interrupt: true
+    }, {
+      label: "业务员",
+      error: false,
+      errMsg: "",
+      type: "route",
+      url: "/prsx/select/saler/index",
+      value: "",
+      placeholder: "业务员",
+      valueName: "hrid",
+      checking: "base",
+      required: true,
+      params: {
+        "content": {
+          "sa_saleareaid": 0,
+          "pageNumber": 1,
+          "pageSize": 20,
+          "where": {
+            "condition": ""
+          }
+        },
+        "id": 20221011144603,
+      },
+      query: "&radio=true",
+      required: true,
+      interrupt: true,
+      disabled: true
+    }, ]
+    if (options.data) {
+      let data = JSON.parse(options.data);
+      form = form.map(v => {
+        v.value = data[v.valueName] || "";
+        return v
+      })
+      this.setData({
+        disabled: false,
+        content: {
+          sa_hospitaldepid: data.sa_hospitaldepid,
+        },
+        form
+      })
+    } else if (options.sa_customersid) {
+      let item = form.find(v => v.label == '所属医院')
+      item.value = [options.name, [options.sa_customersid]];
+      item.disabled = true;
+    } else if (options.sa_agentsid || options.sys_enterpriseid) {
+      this.setData({
+        content: {
+          sys_enterprise_tradefieldid: 0,
+          sa_agentsid: options.sa_agentsid,
+          sys_enterpriseid: options.sys_enterpriseid
+        }
+      })
+    }
+    await _Http.basic({
+      "classname": "webmanage.sale.salearea.salearea",
+      "method": "query_area",
+      "content": {}
+    }).then(res => {
+      if (res.code != '1') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      });
+      let item = form.find(v => v.label == '营销区域')
+      item.range = res.data;
+      // item.rangeIndex = [0,0]
+      // console.log(item.range,'range')
+      // console.log(item.rangeIndex,'rangeIndex')
+      // let state = {
+      //   arr: [],
+      //   arr1: [],
+      //   arr2: [],
+      //   arr3: [],
+      //   multiIds: []
+      // }
+      // res.data.map((v, vk) => {
+
+      //   state.arr1.push(v);
+
+      //   if (res.data[0][0] === vk) {
+      //     state.multiIds[0] = v;
+      //   }
+      //   if (state.arr2.length <= 0) {
+      //     v.subarea.map((c, ck) => {
+      //       state.arr2.push(c);
+      //       if (res.data[0][1] === ck) {
+      //         state.multiIds[1] = c;
+      //       }
+      //       if (state.arr3.length <= 0) {
+      //         c.subarea.map((t, tk) => {
+      //           state.arr3.push(t);
+      //           if (res.data[0][2] === tk) {
+      //             state.multiIds[2] = t;
+      //           }
+      //         });
+      //       }
+      //     });
+      //   }
+      // });
+      // state.arr[0] = state.arr1;
+      // state.arr[1] = state.arr2;
+      // // state.arr[2] = state.arr3;
+
+      // item.range = state.arr
+      // item.rangeIndex = state.multiIds
+
+    })
+    this.setData({
+      form
+    })
+    getApp().globalData.Language.getLanguagePackage(this, options.data ? '编辑科室' : '授权业务员');
+
+  },
+  interrupt(e) {
+    const {
+      data,
+      form,
+      temporary
+    } = e.detail;
+    console.log(data, form, temporary)
+    if (temporary.item.label == '营销区域') {
+      // form.find(v => v.label == '营销区域').value = [data.range[0].areaname];
+      let obj = form.find(v => v.label == '业务员')
+      obj.disabled = false;
+      obj.params.content.sa_saleareaid = data.range[0].sa_saleareaid
+      this.data.content.sa_saleareaid = obj.params.content.sa_saleareaid
+      // wx.navigateBack()
+    } else if (temporary.item.label == '业务员') {
+      form.find(v => v.label == '业务员').value = [data.item.name, [data.item.hrid]];
+      wx.navigateBack()
+    }
+    this.selectComponent("#Form").confirm();
+    this.setData({
+      form
+    })
+  },
+  /* 表单必填项是否完成 */
+  onConfirm({
+    detail
+  }) {
+    this.setData({
+      disabled: detail
+    })
+  },
+  // 是否显示全部
+  onChange({
+    detail
+  }) {
+    this.setData({
+      showAll: detail
+    })
+  },
+  async submit() {
+    this.setData({
+      loading: true
+    })
+    let data = this.selectComponent("#Form").submit(),
+      content = this.data.content
+    data.hrid = data.hrid.length ? data.hrid[1][0] : 0
+    data.sa_saleareaid = content.sa_saleareaid
+    _Http.basic({
+      "id": 20221223141602,
+      "content": {
+        ...content,
+        ...data,
+      }
+    }).then(res => {
+      this.setData({
+        loading: false
+      })
+      wx.showToast({
+        title: res.code != '1' ? res.msg : '添加成功',
+        icon: "none",
+        mask: res.code == '1'
+      })
+      if (res.code != '1') return;
+      getCurrentPages().forEach(v => {
+        switch (v.route) {
+          case 'prsx/dealer/detail':
+            v.getDetail()
+            break;
+        }
+      })
+      setTimeout(() => {
+        getCurrentPages().forEach(v => {
+          //更新列表
+          if (v.selectComponent("#Salesperson")) {
+            let page = v.selectComponent("#Salesperson");
+            page.getList('', true)
+            wx.navigateBack();
+          };
+        })
+      }, 300)
+    })
+  },
+})

+ 3 - 0
prsx/dealer/Salesperson/insert.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 32 - 0
prsx/dealer/Salesperson/insert.scss

@@ -0,0 +1,32 @@
+.new-footer {
+	display: flex;
+	align-items: center;
+	justify-content: flex-end;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	z-index: 999;
+
+	.new-submit {
+		width: 156rpx;
+		height: 90rpx;
+		border-radius: 8rpx;
+		font-size: 28rpx;
+		font-family: PingFang SC-Bold, PingFang SC;
+		font-weight: bold;
+		color: #FFFFFF;
+		margin-right: 30rpx;
+	}
+
+	.blue {
+		background: #3874F6;
+	}
+
+	.orange {
+		background: #F29C37;
+	}
+
+}

+ 8 - 0
prsx/dealer/Salesperson/insert.wxml

@@ -0,0 +1,8 @@
+<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 style="height: 160rpx;" />
+<view class="new-footer" style="padding-bottom:12rpx;">
+	<van-button custom-class="new-submit {{content.sa_hospitaldepid ? 'orange' : 'blue' }}" disabled='{{disabled ||loading}}' loading='{{loading}}' bindclick='submit'>
+		{{content.sa_hospitaldepid ? '保存' : '确定'}}
+	</van-button>
+</view>

+ 1 - 0
prsx/dealer/detail.js

@@ -358,6 +358,7 @@ Page({
             pageTotal
           } = Component.data.content,
           id = model == "#Address" ? this.data.detail.sys_enterpriseid : this.data.detail.sa_agentsid;
+          id = model == "#Salesperson" ? this.data.detail.sys_enterpriseid : this.data.detail.sa_agentsid;
         if (model == "#Files") init = true;
         if (total == null || init) {
           Component.getList(id, init);

+ 1 - 1
prsx/dealer/detail.wxml

@@ -18,7 +18,7 @@
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Trace resource='经销商管理' slot='跟进动态' id='Trace' ownertable='sa_agents' ownerid='{{sys_enterpriseid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sa_agentsid}}' />
-    <Salesperson slot='授权业务员' id="Salesperson" disabled="{{per.query(appAuth.options,'salesAuth')}}"></Salesperson>
+    <Salesperson slot='授权业务员' id="Salesperson"   disabled="{{per.query(appAuth.options,'salesAuth')}}"></Salesperson>
     <Department slot='科室' id='Department'></Department>
     <Hospital slot='医院' id='Hospital'></Hospital>
     <Contract slot='合同' id='Contract' />

+ 176 - 0
prsx/department/Dealer/index.js

@@ -0,0 +1,176 @@
+const _Http = getApp().globalData.http;
+
+Component({
+  properties: {
+    disabled: {
+      type: Boolean,
+      value: true
+    }
+  },
+  options: {
+    addGlobalClass: true
+  },
+  data: {
+    sa_hospitaldepid: 0,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageSize: 10,
+      pageTotal: 1,
+      total: null,
+      where: {
+        condition: ""
+      }
+    },
+    list: [],
+    showSearch: false,
+    focus: false,
+    condition: ""
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+    }
+  },
+  methods: {
+    getList(id, init = false) {
+      let content = {
+        ...this.data.content,
+        sa_hospitaldepid: id || this.data.sa_hospitaldepid
+      };
+      if (init) {
+        content.pageNumber = 1
+        content.pageTotal = 1
+      }
+      _Http.basic({
+        "id": 2025111911232002,
+        content
+      }).then(res => {
+        console.log("科室经销商", res)
+        if (res.code != '1') return wx.showToast({
+          title: res.data,
+          icon: "none"
+        });
+        let list = res.data
+        this.setData({
+          "content.pageNumber": res.pageNumber + 1,
+          "content.pageTotal": res.pageTotal,
+          "content.total": res.total,
+          list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+          sa_hospitaldepid: content.sa_hospitaldepid
+        })
+        getCurrentPages().find(v => v.__route__ == 'prsx/department/detail').getDetail()
+      })
+    },
+    insetr() {
+      let params = {
+        "id": 2025102714042402,
+        "content": {
+          "sa_hospitaldepid": this.data.sa_hospitaldepid,
+          pageNumber: 1,
+          pageSize: 20,
+          "where": {
+            "condition": ""
+          }
+        }
+      };
+      wx.navigateTo({
+        url: '/prsx/select/dealer/index?params=' + JSON.stringify(params) + '&radio=true',
+      })
+      let that = this;
+      getApp().globalData.handleSelect = function ({
+        item
+      }) {
+        wx.showModal({
+          content: `是否确定添加“${item.enterprisename}”`,
+          complete: ({
+            confirm
+          }) => {
+            console.log(item, '数据')
+            if (confirm) _Http.basic({
+              "id": 2025102713181402,
+              "content": {
+                "sa_hospitaldepid": that.data.sa_hospitaldepid,
+                "sa_agentsids": [item.sa_agentsid]
+              },
+            }).then(res => {
+              console.log("添加经销商", res)
+              wx.showToast({
+                title: res.code == 1 ? '添加成功' : res.data,
+                icon: 'none',
+                mask: res.code == 1
+              })
+              if (res.code == 1) {
+                that.getList("", true)
+                getCurrentPages().find(v => v.__route__ == 'prsx/department/detail').getDetail()
+                wx.navigateBack()
+              }
+            })
+
+          }
+        })
+
+        console.log(item)
+      }.bind(this)
+    },
+    deleteItem(e) {
+      console.log(e)
+      const {
+        item
+      } = e.currentTarget.dataset,
+        that = this;
+
+      wx.showModal({
+        content: `是否确定删除“${item.enterprisename}”`,
+        complete: ({
+          confirm
+        }) => {
+          if (confirm) _Http.basic({
+            "id": 2025102713243702,
+            "content": {
+              sa_agents_hospitalid: item.sa_agents_hospitalid
+            },
+          }).then(res => {
+            console.log("删除关联经销商", res)
+            wx.showToast({
+              title: res.code == 1 ? '删除成功' : res.msg,
+              icon: "none"
+            });
+            if (res.code == 1) that.getList("", true)
+          })
+        }
+      })
+    },
+    toSearch() {
+      if (this.data.showSearch && this.data.content.where.condition) {
+        this.data.content.where.condition = '';
+        this.getList("", true);
+      } else if (this.data.condition) {
+        this.data.content.where.condition = this.data.condition;
+        this.setData({
+          condition: this.data.condition
+        })
+        this.getList("", true);
+      }
+      this.setData({
+        showSearch: !this.data.showSearch
+      })
+      setTimeout(() => {
+        this.setData({
+          focus: this.data.showSearch
+        })
+      }, 300)
+    },
+    onChange({
+      detail
+    }) {
+      this.data.condition = detail;
+    },
+    onSearch({
+      detail
+    }) {
+      this.data.content.where.condition = detail;
+      this.getList("", true)
+    },
+  }
+})

+ 4 - 0
prsx/department/Dealer/index.json

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

+ 266 - 0
prsx/department/Dealer/index.scss

@@ -0,0 +1,266 @@
+.head {
+	display: flex;
+	align-items: center;
+	width: 100vw;
+	height: 120rpx;
+	padding: 0 20rpx 0 30rpx;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.expand {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+
+		.but {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			background: #FFFFFF;
+			border-radius: 8rpx;
+			border: 2rpx solid #CCCCCC;
+			margin-left: 20rpx;
+			color: #666666;
+		}
+	}
+}
+
+.custom-class {
+	--search-background-color: #fff !important;
+	padding-right: 10rpx !important;
+}
+
+.project-item {
+	display: flex;
+	align-items: center;
+	background-color: #fff;
+	width: 690rpx;
+	border-radius: 8rpx;
+	margin: 0 auto 20rpx;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+
+	.main {
+		position: relative;
+		overflow: hidden;
+
+		.label {
+			font-size: 30rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+		}
+
+		.tag-box {
+			display: flex;
+			align-items: center;
+			width: 100%;
+
+			.datatag,
+			.systemtag {
+				flex-shrink: 0;
+				margin-top: 6rpx;
+				background: #3874f6;
+				color: #ffffff;
+				margin-right: 10rpx;
+				display: flex;
+				align-items: center;
+				height: 40rpx;
+				font-size: 20rpx;
+				padding: 0 10rpx;
+				border-radius: 20rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+			}
+
+			.datatag {
+				background: #FA8C16;
+			}
+		}
+
+		.replenish {
+			display: flex;
+			min-height: 34rpx;
+			font-size: 24rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+			margin-top: 8rpx;
+			word-break: break-all;
+			white-space: pre-wrap;
+		}
+	}
+}
+
+.project-item {
+	display: flex;
+	align-items: center;
+	background-color: #fff;
+	width: 690rpx;
+	border-radius: 8rpx;
+	margin: 0 auto 20rpx;
+
+	.chart {
+		margin: 0 30rpx;
+		width: 100rpx;
+		flex-shrink: 0;
+
+		.circle {
+			width: 100rpx;
+			height: 100rpx;
+			position: relative;
+			border-radius: 50%;
+			box-shadow: inset 0 0 0 8rpx var(--assist);
+
+			.ab {
+				position: absolute;
+				left: 0;
+				right: 0;
+				top: 0;
+				bottom: 0;
+				margin: auto;
+			}
+
+			&_left {
+				border: 8rpx solid #ccc;
+				border-radius: 50%;
+				clip: rect(0, 50rpx, 100rpx, 0);
+			}
+
+			&_right {
+				border: 8rpx solid #ccc;
+				border-radius: 50%;
+				clip: rect(0, 100rpx, 100rpx, 50rpx);
+			}
+
+			&_text {
+				height: 100%;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				font-size: 16rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #666666;
+
+				.value {
+					margin-top: -6rpx;
+				}
+
+				.name {
+					margin-top: 6rpx;
+				}
+			}
+		}
+	}
+
+	.main {
+		position: relative;
+		box-sizing: border-box;
+    overflow: hidden;
+    width: 690rpx;
+
+    .delete {
+      padding: 0rpx;
+      border-radius: 8rpx;
+      position: absolute;
+      right: 0;
+      top: 0;
+      color: #999;
+    }
+    
+		.label {
+			display: flex;
+			height: 42rpx;
+
+			.title {
+				flex: 1;
+				width: 0;
+				font-size: 30rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #333333;
+				margin-right: 20rpx;
+			}
+
+			.state {
+				flex-shrink: 0;
+				width: 132rpx;
+				height: 40rpx;
+				line-height: 40rpx;
+				border-radius: 20rpx 0px 0px 20rpx;
+				font-size: 24rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #FFFFFF;
+				text-align: center;
+			}
+
+		}
+
+		.tag-box {
+			display: flex;
+			align-items: center;
+			width: 100%;
+
+			.datatag,
+			.systemtag {
+				flex-shrink: 0;
+				margin-top: 6rpx;
+				background: #3874f6;
+				color: #ffffff;
+				margin-right: 10rpx;
+				display: flex;
+				align-items: center;
+				height: 40rpx;
+				font-size: 20rpx;
+				padding: 0 10rpx;
+				border-radius: 20rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+			}
+
+			.datatag {
+				background: #FA8C16;
+			}
+		}
+
+		.replenish {
+			display: flex;
+			min-height: 34rpx;
+			font-size: 24rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #333333;
+			margin-top: 8rpx;
+			word-break: break-all;
+			white-space: pre-wrap;
+		}
+
+		.leader {
+			position: absolute;
+			width: 60rpx;
+			height: 60rpx;
+			border-radius: 50%;
+			right: 30rpx;
+			bottom: 10rpx;
+			overflow: hidden;
+
+			image {
+				width: 100%;
+				height: 100%;
+			}
+
+			>view {
+				font-size: 28rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #FFFFFF;
+				background-color: #3874F6;
+				line-height: 60rpx;
+				text-align: center;
+			}
+		}
+	}
+}

+ 58 - 0
prsx/department/Dealer/index.wxml

@@ -0,0 +1,58 @@
+<view class="head">
+	<view class="count">
+		关联经销商
+	</view>
+	<view class="expand">
+		<van-search wx:if="{{showSearch}}" custom-class='custom-class' focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索关键词" background='#F4F5F7' />
+		<navigator url="#" class="but" bindtap="toSearch">
+			<van-icon name="search" />
+		</navigator>
+		<navigator wx:if="{{disabled}}" url="#" class="but" bindtap="insetr">
+			<van-icon name="plus" />
+		</navigator>
+	</view>
+</view>
+
+<navigator url="/prsx/dealer/detail?id={{item.sa_agentsid}}" class="project-item" wx:for="{{list}}" wx:key="sa_agentsid">
+	<view class="main">
+    <navigator wx:if="{{disabled}}" class="delete" url="#" data-item="{{item}}" catch:tap="deleteItem">
+      <text class="iconfont icon-shanchu1"></text>
+    </navigator>
+		<view class="label">
+			{{item.enterprisename}}
+		</view>
+		<view class="tag-box">
+			<view class="systemtag" wx:for="{{item.tag_sys}}" wx:key="item">{{item}}</view>
+			<view class="datatag" wx:for="{{item.tag}}" wx:key="item">{{item}}</view>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">编号:</text>
+			<text>{{item.agentnum}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">合作类型:</text>
+			<text>{{item.cooperatetype}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">营销区域:</text>
+			<text>{{item.areanames || '--'}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">省市县:</text>
+			<text>{{item.province + item.city + item.county}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">总经理:</text>
+			<text>{{item.gmname || '--'}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">业务员:</text>
+			<text>{{item.salernames}}</text>
+		</view>
+		<view class="replenish">
+			<text style="color: #666;">备注:</text>
+			<text>{{item.remarks || '--'}}</text>
+		</view>
+	</view>
+</navigator>
+<My_empty wx:if="{{list.length==0}}" />

+ 1 - 1
prsx/department/Doctors/index.wxml

@@ -1,6 +1,6 @@
 <view class="head">
 	<view class="count">
-		科室
+		医生
 	</view>
 	<view class="expand">
 		<van-search wx:if="{{showSearch}}" custom-class='custom-class' focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索关键词" background='#F4F5F7' />

+ 5 - 1
prsx/department/detail.js

@@ -26,7 +26,11 @@ Page({
             label: "推荐产品",
             icon: "icon-tuijianchanpin",
             model: "#Product"
-        }, {
+        },{
+          label: "关联经销商",
+          icon: "icon-jingxiaoshang",
+          model: "#Dealer"
+      }, {
             label: "附件",
             icon: "icon-tabfujian1",
             model: "#Files"

+ 2 - 1
prsx/department/detail.json

@@ -2,7 +2,8 @@
     "usingComponents": {
         "Trace": "/prsx/trace/index",
         "Doctors": "/prsx/department/Doctors/index",
-        "Product": "/prsx/department/Product/index"
+        "Product": "/prsx/department/Product/index",
+        "Dealer": "/prsx/department/Dealer/index"
     },
     "navigationBarTitleText": "科室详情"
 }

+ 1 - 0
prsx/department/detail.wxml

@@ -20,6 +20,7 @@
     <Trace resource='科室管理' slot='跟进动态' id='Trace' ownertable='sa_hospitaldep' ownerid='{{sa_hospitaldepid}}' ownerid1='{{detail.sys_enterpriseid}}' />
     <Doctors slot="医生" id='Doctors' disabled="{{isLeader && isAdmin}}"/>
     <Product slot="推荐产品" id='Product' disabled="{{isLeader && isAdmin}}" />
+    <Dealer slot="关联经销商" id='Dealer' disabled="{{isLeader && isAdmin}}" />
     <Record slot="操作" id="Record" ownertable='sa_hospitaldep' ownerid='{{sa_hospitaldepid}}' />
     <Files slot="附件" id="Files" ownertable='sa_hospitaldep' ownerid='{{sa_hospitaldepid}}' disabled="{{detail.status != '已终止'}}" />
 </Yl_FunTabs>

+ 197 - 162
prsx/select/product/index.js

@@ -1,174 +1,209 @@
 const _Http = getApp().globalData.http;
 
 Page({
-    data: {
-        params: {}, //请求体
-        result: [], //返回结果
-        radio: false, //是否为单选
-        idname: "itemid", //idkey
-        showName: "enterprisename", //表单用 显示名称
-        sColors: getApp().globalData.sColors,
-        active: "Receive",
-        filterShow:true,
-        filtratelist:[ {
-          label: "阅读状态",
-          index: null,
-          showName: "name", //显示字段
-          valueKey: "readstatus", //返回Key
-          selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
-          value: "", //选中值
-          list: [{
-              name: "全部",
-              value: ""
-          }, {
-              name: "已读",
-              value: "1"
-          }, {
-              name: "未读",
-              value: "0"
-          }]
-      }]
-    },
-    onLoad(options) {
-        if (options.params) {
-            let params = JSON.parse(options.params);
-            if (!params.content.pageNumber || !params.content.pageTotal) {
-                params.content.pageNumber = 1;
-                params.content.pageTotal = 1;
-            }
-            this.setData({
-                params
-            });
-        }
-        this.setData({
-            radio: options.radio ? true : false,
-            idname: options.idname || this.data.idname,
-            showName: options.showName || this.data.showName
-        });
-        this.getList()
-    },
-    getList(init = false) {
-        //init 用于初始化分页
-        if (init.detail != undefined) init = init.detail;
-        let params = this.data.params;
-        if (init) params.content.pageNumber = 1;
-        if (params.content.pageNumber > params.content.pageTotal) return;
-        //init 用于初始化分页
-        _Http.basic(params).then(res => {
-            console.log("选择产品列表", res)
-            this.selectComponent('#ListBox').RefreshToComplete();
-            if (res.code != '1') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            })
-            res.data = res.data.map(v => {
-                v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
-                return v
-            })
-            this.setData({
-                'params.content.pageNumber': res.pageNumber + 1,
-                'params.content.pageTotal': res.pageTotal,
-                'params.content.total': res.total,
-                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
-            })
-        })
-    },
-    uploadList() {
-        let params = JSON.parse(JSON.stringify(this.data.params));
-        params.content.pageSize = (params.content.pageNumber - 1) * params.content.pageSize;
+  data: {
+    params: {}, //请求体
+    result: [], //返回结果
+    radio: false, //是否为单选
+    idname: "itemid", //idkey
+    showName: "enterprisename", //表单用 显示名称
+    sColors: getApp().globalData.sColors,
+    active: "Receive",
+    filterShow: true,
+    filterSearchShow: false,
+    filtratelist:[]
+  },
+  onLoad(options) {
+    if (options.params) {
+      let params = JSON.parse(options.params);
+      if (!params.content.pageNumber || !params.content.pageTotal) {
         params.content.pageNumber = 1;
-        _Http.basic(params).then(res => {
-            console.log("更新列表", res);
-            if (res.code != '1') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            })
-            res.data = res.data.map(v => {
-                v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
-                return v
-            })
-            this.setData({
-                'params.content.total': res.total,
-                list: res.data
-            })
-        })
-    },
-    /* 选中 */
-    changeResult(e) {
-        let {
-            id
-        } = e.currentTarget.dataset, result = this.data.result;
-        if (this.data.radio) {
-            result = [id];
-        } else {
-            result.some(v => v == id) ? result = result.filter(v => v != id) : result.push(id)
-        }
-        this.setData({
-            result
-        });
-        if (this.data.radio) this.submit();
-    },
-    /* 提交 */
-    submit() {
-        let result = this.data.result,
-            obj = this.data.radio ? {
-                id: result,
-                item: this.data.list.find(value => value[this.data.idname] == result),
-                value: [this.data.list.find(value => value[this.data.idname] == result)[this.data.showName], result]
-            } : {
-                result,
-                list: result.map(v => this.data.list.find(value => value[this.data.idname] == v)),
-                value: [result.map(v => {
-                    let data = this.data.list.find(value => value[this.data.idname] == v);
-                    return data ? data[this.data.showName] : ""
-                }), result]
-            }
-        _Http.handleSelect && _Http.handleSelect(obj)
-    },
+        params.content.pageTotal = 1;
+      }
+      this.setData({
+        params
+      });
+    }
+    this.setData({
+      radio: options.radio ? true : false,
+      idname: options.idname || this.data.idname,
+      showName: options.showName || this.data.showName
+    });
+    this.getList()
+  },
+  getList(init = false) {
+    //init 用于初始化分页
+    if (init.detail != undefined) init = init.detail;
+    let params = this.data.params;
+    if (init) params.content.pageNumber = 1;
+    if (params.content.pageNumber > params.content.pageTotal) return;
+    //init 用于初始化分页
+    _Http.basic(params).then(res => {
+      console.log("选择产品列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      if (res.code != '1') return wx.showToast({
+        title: res.data,
+        icon: "none"
+      })
+      res.data = res.data.map(v => {
+        v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
+        return v
+      })
+      this.setData({
+        'params.content.pageNumber': res.pageNumber + 1,
+        'params.content.pageTotal': res.pageTotal,
+        'params.content.total': res.total,
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+      })
+    })
+  },
+  uploadList() {
+    let params = JSON.parse(JSON.stringify(this.data.params));
+    params.content.pageSize = (params.content.pageNumber - 1) * params.content.pageSize;
+    params.content.pageNumber = 1;
+    _Http.basic(params).then(res => {
+      console.log("更新列表", res);
+      if (res.code != '1') return wx.showToast({
+        title: res.data,
+        icon: "none"
+      })
+      res.data = res.data.map(v => {
+        v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
+        return v
+      })
+      this.setData({
+        'params.content.total': res.total,
+        list: res.data
+      })
+    })
+  },
+  /* 选中 */
+  changeResult(e) {
+    let {
+      id
+    } = e.currentTarget.dataset, result = this.data.result;
+    if (this.data.radio) {
+      result = [id];
+    } else {
+      result.some(v => v == id) ? result = result.filter(v => v != id) : result.push(id)
+    }
+    this.setData({
+      result
+    });
+    if (this.data.radio) this.submit();
+  },
+  /* 提交 */
+  submit() {
+    let result = this.data.result,
+      obj = this.data.radio ? {
+        id: result,
+        item: this.data.list.find(value => value[this.data.idname] == result),
+        value: [this.data.list.find(value => value[this.data.idname] == result)[this.data.showName], result]
+      } : {
+        result,
+        list: result.map(v => this.data.list.find(value => value[this.data.idname] == v)),
+        value: [result.map(v => {
+          let data = this.data.list.find(value => value[this.data.idname] == v);
+          return data ? data[this.data.showName] : ""
+        }), result]
+      }
+    _Http.handleSelect && _Http.handleSelect(obj)
+  },
 
-    /* 开始搜索 */
-    startSearch({
-        detail
-    }) {
-        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
-        if (detail == condition) return;
-        this.setData({
-            'content.where.condition': detail,
-            'params.content.where.condition': detail
-        });
-        this.getList(true);
-    },
-    /* 取消搜索 */
-    onClear() {
-        this.setData({
-            'content.where.condition': "",
-            'params.content.where.condition': ""
-        });
-        this.getList(true);
-    },
-    onUnload() {
-        //回收数据
-        getApp().globalData.handleSelect = null;
-    },
-    /* 筛选 */
-    handleFilter({
-      detail
+  /* 开始搜索 */
+  startSearch({
+    detail
   }) {
-      detail.condition = this.data.where.condition;
-      detail.today = 0
-      detail.lastthreedays = 0
-      detail.lastWeek = 0
-      if (detail.date) detail[detail.date] = 1;
-      detail.begindate = detail.startdate || ''
-      this.data.where = detail;
-
-      this.selectComponent("#" + this.data.active).getList(true);
+    let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
+    if (detail == condition) return;
+    this.setData({
+      'content.where.condition': detail,
+      'params.content.where.condition': detail
+    });
+    this.getList(true);
+  },
+  /* 取消搜索 */
+  onClear() {
+    this.setData({
+      'content.where.condition': "",
+      'params.content.where.condition': ""
+    });
+    this.getList(true);
+  },
+  onUnload() {
+    //回收数据
+    getApp().globalData.handleSelect = null;
+  },
+  /* 筛选 */
+  handleFilter({
+    detail
+  }) {
+    this.data.params.content.where = detail;
+    this.getList(true);
   },
   onClick() {
-    console.log('执行11111')
+    this.setData({
+      filterShow: true
+    })
+    console.log(this.filterShow, '返回结果')
+  },
+  async selsectClick() {
+    let filtratelist = [{
+      label: "品牌",
+      index: null,
+      showName: "brandname", //显示字段
+      valueKey: "sa_brandid", //返回Key
+      selectKey: "sa_brandid", //传参 代表选着字段 不传参返回整个选择对象
+      value: '', //选中值
+      interrupt: true,
+      list: await _Http.basic({
+        "id": "20220922085103",
+        "content": {},
+      }).then(res => {
+        console.log("获取品牌", res)
+        // this.data.sa_brandid = res.data[0].sa_brandid
+        return res.code == 1 ? res.data : []
+      })
+    }, {
+      label: "营销类别",
+      index: null,
+      showName: "itemclassname", //显示字段
+      valueKey: "itemclassid", //返回Key
+      selectKey: "itemclassid", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      type: 'multilevelClass',
+      list: []
+    }, {
+      label: "备货分类",
+      index: null,
+      showName: "value", //显示字段
+      valueKey: "goodstype", //返回Key
+      selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: await _Http.getTypes('goodstype', _Http)
+    }]
+    this.setData({
+      filterSearchShow: true,
+      filtratelist: filtratelist
+    })
+
+
+  },
+  interrupt(e) {
+    console.log(e)
+    _Http.basic({
+      "id": "20230325141103",
+      "content": {
+        sa_brandid: e.detail.data.value
+      },
+    }).then(res => {
+      console.log("获取营销类别", res)
+      if (res.code != 1) return
+      this.data.filtratelist.find(v => v.label == '营销类别').list = res.data[0].ttemclass
+      this.data.filtratelist.find(v => v.label == '品牌').value = e.detail.data.value
       this.setData({
-          filterShow: true
+        filtratelist:this.data.filtratelist
       })
-      console.log(this.filterShow,'返回结果')
+    })
   }
 })

+ 6 - 1
prsx/select/product/index.wxml

@@ -1,4 +1,6 @@
-<van-search value="{{ params.content.where.condition }}" shape='round' placeholder="请输入搜索关键词" use-action-slot bind:clear='onClear' bind:search="startSearch">
+<van-search value="{{ params.content.where.condition }}" shape='round' placeholder="请输入搜索关键词"  use-action-slot bind:clear='onClear' bind:search="startSearch">
+  <view slot="action" bind:tap="selsectClick" >
+    <text class="iconfont {{'icon-shaixuan'}}" style="color: #999999;" />筛选</view>
 </van-search>
 <view class="global-total">总共{{params.content.total}}个</view>
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
@@ -60,4 +62,7 @@
     </wxs>
 </block>
 
+<!-- 筛选条件 -->
+<Yl_Filtrate1 show='{{filterSearchShow}}' list="{{filtratelist}}"  bind:handle="handleFilter" bind:interrupt="interrupt" />
+
 <wxs src="../../../utils/nominalpressure.wxs" module="join"></wxs>

+ 4 - 0
prsx/tryOut/detail.js

@@ -330,6 +330,10 @@ Page({
       tabsList = [{
         label: "详细信息",
         icon: "icon-tabxiangxixinxi1"
+      },{
+        label: "试用明细",
+        icon: "icon-shiyongmingxi",
+        model: "#tryDetail"
       }];
     if (!isLeader) {
       let res = await getApp().agentOrNot("sa_trial", this.data.sa_trialid),

+ 2 - 1
prsx/tryOut/detail.json

@@ -1,7 +1,8 @@
 {
     "usingComponents": {
         "van-dialog": "@vant/weapp/dialog/index",
-        "Trace": "/prsx/trace/index"
+        "Trace": "/prsx/trace/index",
+        "tryDetail": "/prsx/tryOut/tryDetail/index"
     },
     "navigationBarTitleText": "试用申请详情"
 }

+ 1 - 0
prsx/tryOut/detail.wxml

@@ -32,6 +32,7 @@
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
   <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+  <tryDetail slot='试用明细' id='tryDetail' disabled="{{isLeader}}" />
   <Trace resource='安装管理' slot='跟进动态' id='Trace' ownertable='sa_trial' ownerid='{{sys_enterpriseid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sa_trialid}}' />
   <Record slot="操作" id="Record" ownertable='sa_trial' ownerid='{{sa_trialid}}' />
   <Files slot="附件" id="Files" ownertable='sa_trial' ownerid='{{sa_trialid}}' disabled="{{detail.status != '已终止'}}" />

+ 220 - 0
prsx/tryOut/tryDetail/index.js

@@ -0,0 +1,220 @@
+const _Http = getApp().globalData.http;
+
+Component({
+  properties: {
+    disabled: {
+      type: Boolean,
+      value: false
+    }
+  },
+  options: {
+    addGlobalClass: true
+  },
+  data: {
+    sa_trialid: 0,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageSize: 10,
+      pageTotal: 1,
+      total: null,
+      where: {
+        condition: ""
+      }
+    },
+    list: [],
+    showSearch: false,
+    focus: false,
+    condition: ""
+  },
+  methods: {
+    getList(id, init = false) {
+      let content = {
+        ...this.data.content,
+        sa_trialid: id || this.data.sa_trialid
+      };
+      if (init) {
+        content.pageNumber = 1
+        content.pageTotal = 1
+      }
+      _Http.basic({
+        "id": 2025110715410702,
+        content
+      }).then(res => {
+        console.log("科室推荐产品", res)
+        if (res.code != '1') return wx.showToast({
+          title: res.data,
+          icon: "none"
+        });
+        let list = res.data.map(v => {
+          try {
+            v.cover = v.attinfos.length ? _Http.getSpecifiedImage(v.attinfos[0]) : ''
+          } catch (error) {
+
+          }
+          return v
+        })
+        this.setData({
+          "content.pageNumber": res.pageNumber + 1,
+          "content.pageTotal": res.pageTotal,
+          "content.total": res.total,
+          list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+          sa_trialid: content.sa_trialid
+        })
+      })
+    },
+    /* 去添加产品 */
+    addProduct() {
+      let page = getCurrentPages().find(v => v.__route__ == 'prsx/tryOut/detail').data,
+        detail = page.detail,
+        query = "&newprice=contractprice"; /* marketprice */
+      wx.navigateTo({
+        url: `/prsx/select/product/index?params=${JSON.stringify({
+    "id":2025110715184302,
+    "content": {
+      nocache:true,
+      sa_trialid:detail.sa_trialid, //订单ID
+      "total": 0,
+      "where": {
+        "condition": ""
+      }
+    }
+  })+query}`
+      });
+      this.setData({
+        type: detail.type
+      })
+      _Http.handleSelect = this.handleSelect.bind(this);
+
+    },
+    /* 处理新增产品 */
+    handleSelect(detail) {
+      console.log(detail)
+      let that = this;
+      wx.showModal({
+        cancelText: getApp().globalData.Language.getMapText('取消'),
+        confirmText: getApp().globalData.Language.getMapText('确定'),
+        title: getApp().globalData.Language.getMapText('提示'),
+        content: getApp().globalData.Language.joint([{
+          v: '是否确认添加',
+          t: 1
+        }, {
+          v: detail.result.length,
+          t: 1,
+          r: ' ',
+          f: " "
+        }, {
+          v: '件商品',
+          t: 1,
+          r: '?',
+        }]),
+        complete: (res) => {
+          if (res.confirm) _Http.basic({
+            "id": 2025110715293102,
+            "content": {
+              ...that.data.base,
+              sa_trialid:this.data.sa_trialid,
+              "items": detail.list.map(v => {
+                return {
+                  sa_trialitemsid: 0,
+                  "itemid": v.itemid, //商品ID
+                  "qty": 1, //数量
+                  remarks: v.remarks
+                }
+              })
+            }
+          }).then(s => {
+            console.log('新增产品', s)
+            wx.showToast({
+              title: s.code == '1' ? getApp().globalData.Language.getMapText('添加成功') : s.msg,
+              icon: "none"
+            });
+            if (s.code == '1') setTimeout(() => {
+              that.getList('', true);
+              wx.navigateBack();
+              that.updateThePrice();
+            }, 300)
+          })
+        }
+      });
+    },
+    deleteItem(e) {
+      const {
+        item
+      } = e.currentTarget.dataset,
+        that = this;
+      wx.showModal({
+        content: `是否确定删除该试用明细下的产品`,
+        complete: ({
+          confirm
+        }) => {
+          if (confirm) _Http.basic({
+            "id": "2025110715414702",
+            "content": {
+              sa_trialid: this.data.sa_trialid,
+              sa_trialitemsids: [item.sa_trialitemsid]
+            },
+          }).then(res => {
+            wx.showToast({
+              title: res.code == 1 ? '删除成功' : res.msg,
+              icon: "none"
+            })
+            if (res.code == 1) {
+              that.getList('', true)
+            }
+          })
+        }
+      })
+    },
+    toSearch() {
+      if (this.data.showSearch && this.data.content.where.condition) {
+        this.data.content.where.condition = '';
+        this.getList("", true);
+      } else if (this.data.condition) {
+        this.data.content.where.condition = this.data.condition;
+        this.setData({
+          condition: this.data.condition
+        })
+        this.getList("", true);
+      }
+      this.setData({
+        showSearch: !this.data.showSearch
+      })
+      setTimeout(() => {
+        this.setData({
+          focus: this.data.showSearch
+        })
+      }, 300)
+    },
+    changeQty(e) {
+      let value = e.detail.value,
+        index = e.currentTarget.dataset.index;
+      this.data.list[index].qty = value;
+      _Http.basic({
+        "id": 2025110715293102,
+        "content": {
+          "sa_trialid": this.data.sa_trialid,
+          items: this.data.list
+        }
+      }).then(res => {
+        console.log("修改数量", res)
+        wx.showToast({
+          title: res.code == 1 ? '修改成功' : res.msg,
+          icon: "none"
+        })
+        // if (res.code == 1) getCurrentPages().find(v => v.__route__ == 'prsx/tyrOut/detail').getDetail()
+      })
+    },
+    onChange({
+      detail
+    }) {
+      this.data.condition = detail;
+    },
+    onSearch({
+      detail
+    }) {
+      this.data.content.where.condition = detail;
+      this.getList("", true)
+    },
+  }
+})

+ 4 - 0
prsx/tryOut/tryDetail/index.json

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

+ 195 - 0
prsx/tryOut/tryDetail/index.scss

@@ -0,0 +1,195 @@
+.head {
+	display: flex;
+	align-items: center;
+	width: 100vw;
+	height: 120rpx;
+	padding: 0 20rpx 0 30rpx;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.expand {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+
+		.but {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			background: #FFFFFF;
+			border-radius: 8rpx;
+			border: 2rpx solid #CCCCCC;
+			margin-left: 20rpx;
+			color: #666666;
+		}
+	}
+}
+
+.custom-class {
+	--search-background-color: #fff !important;
+	padding-right: 10rpx !important;
+}
+
+.product-item {
+	background-color: #fff;
+	box-sizing: border-box;
+	border-bottom: 1rpx solid #DDDDDD;
+	margin-bottom: 20rpx;
+
+	.product {
+		box-sizing: border-box;
+
+		.mian {
+			position: relative;
+			display: flex;
+			width: 100%;
+			box-sizing: border-box;
+			padding: 20rpx;
+
+			.img {
+				position: relative;
+				flex-shrink: 0;
+				width: 112rpx;
+				height: 112rpx;
+				border-radius: 16rpx;
+				margin-right: 20rpx;
+
+				.err {
+					display: flex;
+					width: 100%;
+					height: 100%;
+					align-items: center;
+					justify-content: center;
+					font-size: 22rpx;
+					border: 1px solid #ddd;
+					box-sizing: border-box;
+					color: #666;
+					border-radius: 16rpx;
+				}
+
+				.tag-box {
+					display: flex;
+					justify-content: center;
+					width: 100%;
+					position: absolute;
+					top: 94rpx;
+
+					.tag {
+						max-width: 70rpx;
+						font-family: PingFang SC, PingFang SC;
+						font-size: 18rpx;
+						color: #FFFFFF;
+						line-height: 32rpx;
+						border-radius: 16rpx;
+						background-color: #52C41A;
+						padding: 0 12rpx;
+					}
+        }
+        
+			}
+
+			.dec {
+				flex: 1;
+				width: 0;
+				min-height: 128rpx;
+				height: 100%;
+				font-size: 24rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #999999;
+
+				.title {
+					display: flex;
+					width: 90%;
+					height: 40rpx;
+					font-size: 28rpx;
+					font-weight: 600;
+					color: #333333;
+
+					.line-1 {
+						max-width: 380rpx;
+					}
+
+					.tag {
+						display: inline-block;
+						color: #fff;
+						background-color: #F80700;
+						padding: 0 20rpx;
+						margin-left: 20rpx;
+						border-radius: 20rpx;
+						font-weight: normal;
+						font-size: 22rpx;
+						line-height: 40rpx;
+					}
+				}
+
+				.subfield {
+					display: flex;
+					margin-top: 8rpx;
+					height: 34rpx;
+					line-height: 34rpx;
+
+					text {
+						display: inline-block;
+						width: 48%;
+					}
+				}
+
+				.price {
+					font-size: 25rpx;
+					color: #FF3B30;
+				}
+
+				.old-price {
+					font-size: 24rpx;
+					font-family: PingFang SC-Regular, PingFang SC;
+					color: #999999;
+					margin-left: 8rpx;
+					text-decoration-line: line-through;
+        }
+        
+        .bottom {
+          display: flex;
+          align-items: center;
+          height: 58rpx;
+          font-family: PingFang SC, PingFang SC;
+          font-size: 24rpx;
+          color: #333333;
+          width: 100%;
+          margin-top: 8rpx;
+          margin-left: -130rpx;
+          padding-bottom: 2rpx;
+    
+          input {
+            width: 440rpx;
+            height: 58rpx;
+            background: #FFFFFF;
+            border-radius: 8rpx;
+            border: 1rpx solid #CCCCCC;
+            padding-left: 20rpx;
+          }
+    
+        }
+      
+      }
+
+			.iconfont-box {
+				position: absolute;
+				bottom: 0rpx;
+				right: 0rpx;
+				padding: 30rpx;
+				color: #B5B5B5;
+				border-radius: 8rpx;
+      }
+		}
+
+	}
+}

+ 56 - 0
prsx/tryOut/tryDetail/index.wxml

@@ -0,0 +1,56 @@
+<view class="head">
+  <view class="count">
+    总共{{content.total}}个
+  </view>
+  <view class="expand">
+    <van-search wx:if="{{showSearch}}" custom-class='custom-class' focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索关键词" background='#F4F5F7' />
+    <navigator url="#" class="but" bindtap="toSearch">
+      <van-icon name="search" />
+    </navigator>
+    <navigator wx:if="{{disabled}}"  url="#" class="but" bindtap="addProduct">
+      <van-icon name="plus" />
+    </navigator>
+  </view>
+</view>
+
+<view class="product-item" wx:for="{{list}}" wx:key="itemid">
+  <view class="product">
+    <view class="mian">
+      <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 lazy-load>
+          <van-loading slot="loading" type="spinner" size="20" vertical />
+        </van-image>
+        <text wx:else class="err">{{language['暂无图片']||'暂无图片'}}</text>
+      </view>
+      <view class="dec">
+        <view class="title">
+          <text class="line-1">{{item.itemname}}</text>
+        </view>
+        <view class="subfield">
+          <text class="line-1" style="margin-right: 6rpx;">编号:{{item.itemno||' --'}}</text>
+          <text class="line-1" style="margin-right: 6rpx;">备货分类:{{item.goodstype||' --'}}</text>
+        </view>
+        <view class="subfield">
+          <text class="line-1" style="margin-right: 6rpx;">型号:{{item.model||' --'}}</text>
+          <text class="line-1" style="margin-right: 6rpx;">规格:{{item.spec||' --'}}</text>
+        </view>
+        <view class="subfield">
+          <text class="line-1" style="margin-right: 6rpx;">辅助说明:{{item.assistance||' --'}}</text>
+          <text class="line-1" style="margin-right: 6rpx;">俗称释义:{{item.explains||' --'}}</text>
+        </view>
+        <view class="subfield">
+          <text class="line-1" style="margin-right: 6rpx;">标准价格:<text class="price">¥{{item.marketprice}}</text></text>
+        </view>
+        <view class="bottom">
+          <text style="color: #666;">试用数量:</text>
+          <input placeholder="填写试用数量" type="digit" value="{{item.qty ||''}}" bindblur="changeQty" data-index="{{index}}" />
+        </view>
+      </view>
+      <navigator wx:if="{{disabled}}" url="#" class="iconfont-box" data-item="{{item}}" bind:tap="deleteItem">
+        <view class="iconfont icon-shanchu1" />
+      </navigator>
+    </view>
+  </view>
+</view>
+
+<My_empty wx:if="{{list.length==0}}" />

+ 3 - 6
prsx/winstall/detail.js

@@ -56,7 +56,7 @@ Page({
             label: "安装数量",
             value: res.data.qty
         }, {
-            label: "签约日期",
+            label: "安装日期",
             value: res.data.installdate
         }, {
             label: "创建日期",
@@ -79,12 +79,9 @@ Page({
             label: "安装数量",
             value: res.data.qty
         }, {
-            label: "签约日期",
+            label: "安装日期",
             value: res.data.installdate
-        }, {
-            label: "创建日期",
-            value: res.data.createdate
-        }, {
+        },  {
             label: "备注",
             value: res.data.remarks
         }];