qymljy 4 ay önce
ebeveyn
işleme
d66557c1cf
2 değiştirilmiş dosya ile 43 ekleme ve 20 silme
  1. 7 2
      components/Yl_field/index.js
  2. 36 18
      prsx/trace/add/index.js

+ 7 - 2
components/Yl_field/index.js

@@ -297,15 +297,19 @@ Component({
     },
     /* 单选 选择器改变 */
     radioChange(e) {
-      console.log(e,'输出111')
+      console.log(e,'e数据输出111')
+      // console.log(this.data.form[index].value == e.detail,'判断')
+      console.log()
       let item = e.currentTarget.dataset.item,
         index = this.data.form.findIndex(v => v.valueName == item.valueName);
+        
+        console.log(this.data.form[index].value)
+        console.log(e.detail)
       if (this.data.form[index].value == e.detail) return;
       this.setData({
         [`form[${index}].value`]: e.detail,
         [`form[${index}].error`]: false,
       });
-      this.confirm();
       console.log(item.interrupt,this.data.form[index],this.data.form,item)
       if (item.interrupt) this.triggerEvent("interrupt", {
         data: this.data.form[index],
@@ -315,6 +319,7 @@ Component({
           index
         }
       });
+      this.confirm();
       
     },
     /* 提交 */

+ 36 - 18
prsx/trace/add/index.js

@@ -243,19 +243,28 @@ Page({
       if (followObjectIndex !== -1) {
         this.data.form.splice(followObjectIndex + 1, 0, ...lcForm);
       }
+      this.setData({
+        form: this.data.form
+      })
     } else {
-      const existingJxsIndex = this.data.form.findIndex(item => item.label === "医院");
-      if (existingJxsIndex !== -1) {
-        this.data.form.splice(existingJxsIndex, 1);
-      }
-      existingJxsIndex = this.data.form.findIndex(item => item.label === "医生");
-      if (existingJxsIndex !== -1) {
-        this.data.form.splice(existingJxsIndex, 1);
-      }
-      existingJxsIndex = this.data.form.findIndex(item => item.label === "科室");
-      if (existingJxsIndex !== -1) {
-        this.data.form.splice(existingJxsIndex, 1);
+      console.log('删除医院内容')
+      const existingYyIndex = this.data.form.findIndex(item => item.label === "医院");
+      if (existingYyIndex !== -1) {
+        console.log(existingYyIndex,'执行进行删除')
+        this.data.form.splice(existingYyIndex, 3);
+        console.log(this.data.form,'输出')
+        this.setData({
+          form: this.data.form
+        })
       }
+      // const existingYsIndex = this.data.form.findIndex(item => item.label === "医生");
+      // if (existingYsIndex !== -1) {
+      //   this.data.form.splice(existingYsIndex, 1);
+      // }
+      // const existingKsIndex = this.data.form.findIndex(item => item.label === "科室");
+      // if (existingKsIndex !== -1) {
+      //   this.data.form.splice(existingKsIndex, 1);
+      // }
       let jxsForm = [{
         label: "经销商",
         error: false,
@@ -279,14 +288,20 @@ Page({
         },
         query: "&radio=true",
       }]
-      const followObjectIndex = this.data.form.findIndex(item => item.label === "跟进对象");
-      if (followObjectIndex !== -1) {
-        this.data.form.splice(followObjectIndex + 1, 0, ...jxsForm);
+      const followObjectJxsIndex = this.data.form.findIndex(item => item.label === "跟进对象");
+      if (followObjectJxsIndex !== -1) {
+        this.data.form.splice(followObjectJxsIndex + 1, 0, ...jxsForm);
+        console.log('1111',this.data.form)
+
+        this.setData({
+          form: this.data.form
+        })
       }
+      this.setData({
+        form: this.data.form
+      })
     }
-    this.setData({
-      form: this.data.form
-    })
+   
   },
   interrupt(e) {
     console.log(e, 'e的数据初始')
@@ -297,8 +312,11 @@ Page({
     } = e.detail;
     console.log(data, form, temporary)
     if (temporary.item.label == '跟进对象') {
-      this.formSetNew()
+      this.formSetNew(data.value)
     }
+    this.setData({
+      form
+  })
   },
   /* 表单必填项是否完成 */
   onConfirm({