Browse Source

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI

ct 3 days ago
parent
commit
359aed9a26

+ 1 - 1
.env.prod-ddgy

@@ -16,7 +16,7 @@ ENV = 'production'
 VUE_APP_BASE_API = '/prod-api'
 
 #默认 1、会员 2、企微
-VUE_APP_COURSE_DEFAULT = 2
+VUE_APP_COURSE_DEFAULT = 1
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 1
src/api/qw/sop.js

@@ -49,9 +49,11 @@ export function courseList() {
     method: 'get',
   })
 }
-export function videoList(id) {
+export function videoList(id,query) {
+
   return request({
     url: '/qw/sop/videoList/' + id,
+    params: query,
     method: 'get'
   })
 }

+ 104 - 40
src/views/company/companyConfig/index.vue

@@ -82,56 +82,103 @@
               <el-button type="primary" @click="onSubmit2">提交</el-button>
             </div>
         </el-tab-pane>
-        <el-tab-pane label="企微配置" name="qwConfig">
-          <el-form ref="qwConfig" :model="qwConfig" label-width="200px">
-            <el-form-item label="企业CoripID">
-              <el-input v-model="qwConfig.corpId" style="width:400px"   ></el-input>
+<!--        <el-tab-pane label="企微配置" name="qwConfig">-->
+<!--          <el-form ref="qwConfig" :model="qwConfig" label-width="200px">-->
+<!--            <el-form-item label="企业CoripID">-->
+<!--              <el-input v-model="qwConfig.corpId" style="width:400px"   ></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="通讯录Secret">-->
+<!--              <el-input v-model="qwConfig.bookSecret" style="width:400px"   ></el-input>-->
+<!--            </el-form-item>-->
+
+<!--            <el-form-item label="应用Secret">-->
+<!--              <el-input v-model="qwConfig.appSecret" style="width:400px"   ></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="应用AgentId">-->
+<!--              <el-input v-model="qwConfig.AgentId" style="width:400px"   ></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="Token">-->
+<!--              <el-input v-model="qwConfig.token" style="width:400px"   :readonly="true"></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="EncodingAESKey">-->
+<!--              <el-input v-model="qwConfig.encodingAESKey" style="width:400px"   :readonly="true"></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="域名地址">-->
+<!--              <el-input v-model="qwConfig.realmNameURL" style="width:600px"></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="回调地接">-->
+<!--              <el-input v-model="qwConfig.notifyUrl" style="width:600px"   :readonly="true"></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="聊天工具栏跳转地址">-->
+<!--              <el-input v-model="qwConfig.chatToolbar" style="width:600px"   :readonly="true"></el-input>-->
+<!--            </el-form-item>-->
+<!--            <el-form-item label="聊天工具栏实际运用地址">-->
+<!--              <el-input v-model="qwConfig.chatToolbarOAuth2" :rows="2"  type="textarea" style="width:1000px;"   :readonly="true"></el-input>-->
+<!--            </el-form-item>-->
+<!--            <div class="line"></div>-->
+<!--            <div style="float:right;margin-right:20px">-->
+<!--              <el-button type="primary" @click="onSubmit4">提交</el-button>-->
+<!--            </div>-->
+<!--          </el-form>-->
+<!--        </el-tab-pane>-->
+        <el-tab-pane label="AI客服配置" name="AiKfConfig">
+          <el-form ref="AiKfConfig" :model="AiKfConfig" label-width="120px">
+            <el-form-item label="通用Key">
+              <el-input  v-model="AiKfConfig.Key" style="width:600px"   ></el-input>
             </el-form-item>
-            <el-form-item label="通讯录Secret">
-              <el-input v-model="qwConfig.bookSecret" style="width:400px"   ></el-input>
+            <el-form-item label="调用地址">
+              <el-input  v-model="AiKfConfig.url" style="width:600px"   ></el-input>
             </el-form-item>
-
-            <el-form-item label="应用Secret">
-              <el-input v-model="qwConfig.appSecret" style="width:400px"   ></el-input>
+            <div class="line"></div>
+            <div style="float:right;margin-right:20px">
+              <el-button type="primary" @click="onSubmit5">提交</el-button>
+            </div>
+          </el-form>
+        </el-tab-pane>
+        <el-tab-pane label="红包商户配置" name="redPacketConfig" >
+          <el-form ref="redPacketConfig" :model="redPacketConfig"  label-width="150px">
+            <el-form-item   label="红包接口类型" prop="isNew">
+              <el-radio-group v-model="redPacketConfig.isNew">
+                <el-radio label="0">商家转账到零钱(旧)</el-radio>
+                <el-radio label="1">商家转账(新)</el-radio>
+              </el-radio-group>
             </el-form-item>
-            <el-form-item label="应用AgentId">
-              <el-input v-model="qwConfig.AgentId" style="width:400px"   ></el-input>
+            <el-form-item   label="公众号appid" prop="appId">
+              <el-input   v-model="redPacketConfig.appId"  label="请输入appId"></el-input>
             </el-form-item>
-            <el-form-item label="Token">
-              <el-input v-model="qwConfig.token" style="width:400px"   :readonly="true"></el-input>
+            <el-form-item   label="小程序appid" prop="appId">
+              <el-input   v-model="redPacketConfig.miniappId"  label="请输入appId"></el-input>
             </el-form-item>
-            <el-form-item label="EncodingAESKey">
-              <el-input v-model="qwConfig.encodingAESKey" style="width:400px"   :readonly="true"></el-input>
+            <el-form-item   label="商户号" prop="mchId">
+              <el-input   v-model="redPacketConfig.mchId"  label="请输入mchId"></el-input>
             </el-form-item>
-            <el-form-item label="域名地址">
-              <el-input v-model="qwConfig.realmNameURL" style="width:600px"></el-input>
+            <el-form-item   label="商户密钥" prop="mchKey">
+              <el-input   v-model="redPacketConfig.mchKey"  label="mchKey"></el-input>
             </el-form-item>
-            <el-form-item label="回调地接">
-              <el-input v-model="qwConfig.notifyUrl" style="width:600px"   :readonly="true"></el-input>
+            <el-form-item   label="p12证书路径" prop="keyPath">
+              <el-input   v-model="redPacketConfig.keyPath"  label="请输入keyPath"></el-input>
             </el-form-item>
-            <el-form-item label="聊天工具栏跳转地址">
-              <el-input v-model="qwConfig.chatToolbar" style="width:600px"   :readonly="true"></el-input>
+            <el-form-item   label="apiV3密钥" prop="apiV3Key">
+              <el-input   v-model="redPacketConfig.apiV3Key"  label="请输入apiV3Key"></el-input>
             </el-form-item>
-            <el-form-item label="聊天工具栏实际运用地址">
-              <el-input v-model="qwConfig.chatToolbarOAuth2" :rows="2"  type="textarea" style="width:1000px;"   :readonly="true"></el-input>
+            <el-form-item   label="公钥ID" prop="publicKeyId">
+              <el-input   v-model="redPacketConfig.publicKeyId"  label="请输入公钥ID"></el-input>
             </el-form-item>
-            <div class="line"></div>
-            <div style="float:right;margin-right:20px">
-              <el-button type="primary" @click="onSubmit4">提交</el-button>
-            </div>
-          </el-form>
-        </el-tab-pane>
-        <el-tab-pane label="AI客服配置" name="AiKfConfig">
-          <el-form ref="AiKfConfig" :model="AiKfConfig" label-width="120px">
-            <el-form-item label="通用Key">
-              <el-input  v-model="AiKfConfig.Key" style="width:600px"   ></el-input>
+            <el-form-item   label="公钥证书" prop="publicKeyPath">
+              <el-input   v-model="redPacketConfig.publicKeyPath"  label="请输入publicKeyPath"></el-input>
             </el-form-item>
-            <el-form-item label="调用地址">
-              <el-input  v-model="AiKfConfig.url" style="width:600px"   ></el-input>
+            <el-form-item   label="key路径" prop="privateKeyPath">
+              <el-input   v-model="redPacketConfig.privateKeyPath"  label="请输入"></el-input>
             </el-form-item>
-            <div class="line"></div>
+            <el-form-item   label="cert路径" prop="privateCertPath">
+              <el-input   v-model="redPacketConfig.privateCertPath"  label="请输入"></el-input>
+            </el-form-item>
+            <el-form-item   label="回调地址" prop="notifyUrl">
+              <el-input   v-model="redPacketConfig.notifyUrl"  label="请输入"></el-input>
+            </el-form-item>
+
             <div style="float:right;margin-right:20px">
-              <el-button type="primary" @click="onSubmit5">提交</el-button>
+              <el-button type="primary" @click="onSubmit4">提交</el-button>
             </div>
           </el-form>
         </el-tab-pane>
@@ -258,6 +305,9 @@ export default {
       companyUserConfig: {},
       adminIsShowForm:{},
       userIsDefaultBlack: null,
+      redPacketConfig:{},
+
+      redPacketConfigForm:{}
     };
   },
   created() {
@@ -408,6 +458,11 @@ export default {
               if(response.data.configValue != null){
                 this.adminIsShow = JSON.parse(response.data.configValue);
               }
+            }else if(key=="redPacket:config"){
+              this.redPacketConfigForm=response.data;
+              if(response.data.configValue!=null){
+                this.redPacketConfig=JSON.parse(response.data.configValue);
+              }
             }
         });
     },
@@ -438,12 +493,21 @@ export default {
         }
       });
     },
+    // onSubmit4() {
+    //   this.qwConfigForm.configValue=JSON.stringify(this.qwConfig);
+    //   updateConfig(this.qwConfigForm).then(response => {
+    //     if (response.code === 200) {
+    //       this.msgSuccess("修改成功");
+    //       this.getConfigKey("sys:qw:config");
+    //     }
+    //   });
+    // },
     onSubmit4() {
-      this.qwConfigForm.configValue=JSON.stringify(this.qwConfig);
-      updateConfig(this.qwConfigForm).then(response => {
+      this.redPacketConfigForm.configValue=JSON.stringify(this.redPacketConfig);
+      updateConfig(this.redPacketConfigForm).then(response => {
         if (response.code === 200) {
           this.msgSuccess("修改成功");
-          this.getConfigKey("sys:qw:config");
+          this.getConfigKey("redPacket:config");
         }
       });
     },

+ 194 - 1
src/views/course/courseFinishTemp/index.vue

@@ -224,7 +224,52 @@
                       </el-card>
                     </div>
                     <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
+
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
 
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
                     </div>
                     <div v-if="item.contentType == 5 ">
 
@@ -361,7 +406,52 @@
                       </el-card>
                     </div>
                     <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
 
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
+
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
                     </div>
                     <div v-if="item.contentType == 5 ">
 
@@ -513,6 +603,9 @@ export default {
   components: {Tip, ImageUpload,userVideo},
   data() {
     return {
+      videoOptionsLoading: false,
+      videoOptions: [],
+      videoLoading: false,
       videoNumOptions: {
         title: '选择视频号',
         open: false,
@@ -576,6 +669,7 @@ export default {
       chatSetting: [],
       // 表单参数
       form: {
+        companyUserIds: [],
         setting: null,
         chatSetting: null,
         videoIdSet: null,
@@ -614,7 +708,83 @@ export default {
     this.getList();
   },
   methods: {
+    // 处理规则中课程变化
+    handleRuleCourseChange(item) {
+      // 为当前规则项单独加载视频列表
+      videoList(item.courseId).then((response) => {
+        // 只保存视频列表,不保存整个响应对象
+        this.videoOptions = response.list;
+
+        this.$set(item, 'videoId', null); // Reset video selection when course changes
+
+        // 自动设置封面为课程封面
+        const selectedCourse = this.courseList.find(
+          course => parseInt(course.dictValue) === item.courseId
+        );
+        if (selectedCourse) {
+          this.$set(item, 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+        }
+      });
+    },
+
+
+    // 处理规则中视频变化
+    handleRuleVideoChange(item) {
+      if (!item.videoId) return;
+
+      // 自动设置标题为视频标题
+      const selectedVideo = (this.videoOptions || []).find(
+        video => parseInt(video.dictValue) === item.videoId
+      );
+      if (selectedVideo) {
+        this.$set(item, 'miniprogramTitle', selectedVideo.dictLabel);
+      }
+    },
+
+    // 远程搜索规则中的视频
+    remoteMethodRuleVideo(query, item) {
+      if (!item.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoOptions = [];
+        reject();
+        return;
+      }
 
+      this.videoOptionsLoading = true;
+      const data = query ? { title: query } : {};
+
+      videoList(item.courseId, data).then((response) => {
+        this.videoOptions =  response.list;
+        this.videoOptionsLoading =  false;
+        resolve(response);
+      }).catch((error) => {
+        this.videoOptionsLoading = false;
+        reject(error);
+      });
+    },
+    remoteMethodVideo(query) {
+      if (!this.form.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoList = []; // 清空小节列表
+        return;
+      }
+      if (query !== '') {
+        this.videoLoading = true;
+        // 这里调用接口搜索小节,假设 videoList 方法支持搜索参数
+        var data = {
+          title:query
+        }
+        videoList(this.form.courseId, data).then((response) => {
+          this.videoList = response.list;
+          this.videoLoading = false;
+        });
+      } else {
+        // 如果查询为空,则加载全部
+        videoList(this.form.courseId).then((response) => {
+          this.videoList = response.list;
+        });
+      }
+    },
     qwUserVideoResult(val) {
 
       // 根据选中的内容,将返回的数据更新到相应的表单项
@@ -826,7 +996,18 @@ export default {
         videoList(this.form.courseId).then(response => {
           this.videoList = response.list;
         });
+        this.setting.forEach(item => {
+          if (item.contentType == 4 && item.courseId) {
+            // 初始化 videoOptions
+            this.videoOptions = [];
+            this.videoOptionsLoading = false;
 
+            // 获取课程对应的小节列表
+            videoList(item.courseId).then((videoResponse) => {
+              this.videoOptions = videoResponse.list;
+            });
+          }
+        });
 
         this.open = true;
         this.title = "修改完课模板";
@@ -844,7 +1025,19 @@ export default {
           this.form.companyUserIds = this.companyUserIds.toString()
           this.form.parentId = this.parentId
 
-          this.form.setting = JSON.stringify(this.setting)
+
+          const processedSetting = this.setting.map(item => {
+            const newItem = {...item};
+            if (newItem.videoOptions) {
+              delete newItem.videoOptions;
+            }
+            if (newItem.videoLoading !== undefined) {
+              delete newItem.videoLoading;
+            }
+            return newItem;
+          });
+
+          this.form.setting = JSON.stringify(processedSetting);
           this.form.chatSetting = JSON.stringify(this.chatSetting)
 
           if (this.setting.length <= 0) {

+ 185 - 3
src/views/course/courseFinishTempParent/index.vue

@@ -178,7 +178,52 @@
                       </el-card>
                     </div>
                     <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
+
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
 
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
                     </div>
                     <div v-if="item.contentType == 5 ">
 
@@ -315,7 +360,52 @@
                       </el-card>
                     </div>
                     <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
+
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
 
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
                     </div>
                     <div v-if="item.contentType == 5 ">
 
@@ -449,7 +539,7 @@
 
 <script>
 import { listCourseFinishTempParent, getCourseFinishTempParent, delCourseFinishTempParent, addCourseFinishTempParent, updateCourseFinishTempParent, exportCourseFinishTempParent } from "@/api/course/courseFinishTempParent";
-import {courseList} from '@/api/qw/sop'
+import {courseList, videoList} from '@/api/qw/sop'
 import ImageUpload from '@/views/qw/sop/ImageUpload.vue'
 import { getUserList } from '@/api/company/companyUser'
 import userVideo from "@/views/qw/userVideo/userVideo.vue";
@@ -460,6 +550,9 @@ export default {
   components: { ImageUpload ,userVideo},
   data() {
     return {
+      videoOptionsLoading: false,
+      videoOptions: [],
+      videoLoading: false,
       videoNumOptions: {
         title: '选择视频号',
         open: false,
@@ -508,7 +601,7 @@ export default {
         courseId: null,
       },
       // 表单参数
-      form: {},
+      form: {companyUserIds: [],},
       // 表单校验
       rules: {
         name:[
@@ -544,6 +637,83 @@ export default {
     this.getList();
   },
   methods: {
+    // 处理规则中课程变化
+    handleRuleCourseChange(item) {
+      // 为当前规则项单独加载视频列表
+      videoList(item.courseId).then((response) => {
+        // 只保存视频列表,不保存整个响应对象
+        this.videoOptions = response.list;
+
+        this.$set(item, 'videoId', null); // Reset video selection when course changes
+
+        // 自动设置封面为课程封面
+        const selectedCourse = this.courseList.find(
+          course => parseInt(course.dictValue) === item.courseId
+        );
+        if (selectedCourse) {
+          this.$set(item, 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+        }
+      });
+    },
+
+
+    // 处理规则中视频变化
+    handleRuleVideoChange(item) {
+      if (!item.videoId) return;
+
+      // 自动设置标题为视频标题
+      const selectedVideo = (this.videoOptions || []).find(
+        video => parseInt(video.dictValue) === item.videoId
+      );
+      if (selectedVideo) {
+        this.$set(item, 'miniprogramTitle', selectedVideo.dictLabel);
+      }
+    },
+
+    // 远程搜索规则中的视频
+    remoteMethodRuleVideo(query, item) {
+      if (!item.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoOptions = [];
+        reject();
+        return;
+      }
+
+      this.videoOptionsLoading = true;
+      const data = query ? { title: query } : {};
+
+      videoList(item.courseId, data).then((response) => {
+        this.videoOptions =  response.list;
+        this.videoOptionsLoading =  false;
+        resolve(response);
+      }).catch((error) => {
+        this.videoOptionsLoading = false;
+        reject(error);
+      });
+    },
+    remoteMethodVideo(query) {
+      if (!this.form.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoList = []; // 清空小节列表
+        return;
+      }
+      if (query !== '') {
+        this.videoLoading = true;
+        // 这里调用接口搜索小节,假设 videoList 方法支持搜索参数
+        var data = {
+          title:query
+        }
+        videoList(this.form.courseId, data).then((response) => {
+          this.videoList = response.list;
+          this.videoLoading = false;
+        });
+      } else {
+        // 如果查询为空,则加载全部
+        videoList(this.form.courseId).then((response) => {
+          this.videoList = response.list;
+        });
+      }
+    },
     /** 查询完课模板列表 */
     getList() {
       this.loading = true;
@@ -649,7 +819,19 @@ export default {
             }
             this.form.companyUserIds = this.companyUserIds.toString()
 
-            this.form.setting = JSON.stringify(this.setting)
+
+            const processedSetting = this.setting.map(item => {
+              const newItem = {...item};
+              if (newItem.videoOptions) {
+                delete newItem.videoOptions;
+              }
+              if (newItem.videoLoading !== undefined) {
+                delete newItem.videoLoading;
+              }
+              return newItem;
+            });
+
+            this.form.setting = JSON.stringify(processedSetting);
             this.form.chatSetting = JSON.stringify(this.chatSetting)
 
             if (this.setting.length <= 0) {

+ 95 - 2
src/views/course/courseWatchLog/deptWatchLog.vue

@@ -230,6 +230,24 @@
           @change="qecCreateTimeChange"
         />
       </el-form-item>
+
+
+      <el-form-item label="营期课程时间" prop="periodTime" v-if="queryParams.sendType==1">
+        <el-date-picker
+          v-model="periodTimeText"
+          type="datetimerange"
+          align="right"
+          unlink-panels
+          value-format="yyyy-MM-dd HH:mm:ss"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          @change="qecPeriodTimeChange"
+          :default-time="['00:00:00', '23:59:59']">
+        </el-date-picker>
+      </el-form-item>
+
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -452,16 +470,19 @@ export default {
       createCalendarKey: 0,
       updateCalendarKey: 0,
       qecCalendarKey: 0,
+      periodTimeKey: 0,
 
       createTimeText: '',
       scheduleTimeText: '',  // 新增
       updateTimeText: '',    // 新增
       qecCreateTimeText: '', // 新增
+      periodTimeText: '', // 营期课程时间
 
       scheduleTime: [],  // 改为数组
       createTime: [],    // 改为数组
       updateTime: [],    // 改为数组
       qecCreateTime: [], // 改为数组
+      periodTime: [], // 改为数组
 
       // 控制日历显隐
       showScheduleCalendar: false,
@@ -517,9 +538,9 @@ export default {
 
       pickerOptions: {
         disabledDate(time) {
-          // 获取6天前的日期(加上今天就是7天)
+          // 获取13天前的日期(加上今天就是14天)
           const sixDaysAgo = new Date();
-          sixDaysAgo.setDate(sixDaysAgo.getDate() - 6);
+          sixDaysAgo.setDate(sixDaysAgo.getDate() - 13);
           sixDaysAgo.setHours(0, 0, 0, 0);
 
           // 获取明天的日期(不包括今天)
@@ -554,6 +575,8 @@ export default {
         upETime:null,
         qecSTime:null,
         qecETime:null,
+        periodSTime:null,
+        periodETime:null,
         scheduleStartTime: null,
         scheduleEndTime: null,
         sendType:process.env.VUE_APP_COURSE_DEFAULT,
@@ -595,17 +618,20 @@ export default {
       this.createTime = [];
       this.updateTime = [];
       this.qecCreateTime = [];
+      this.periodTime = [];
 
       this.scheduleTimeText = '';
       this.createTimeText = '';
       this.updateTimeText = '';
       this.qecCreateTimeText = '';
+      this.periodTimeText = [];
 
       // 强制刷新日历组件
       this.scheduleCalendarKey++;
       this.createCalendarKey++;
       this.updateCalendarKey++;
       this.qecCalendarKey++;
+      this.periodTimeKey++;
     },
     formatDateRange(dates) {
       if (!dates || dates.length < 2) return '';
@@ -687,6 +713,8 @@ export default {
       this.queryParams.upETime = null;
       this.queryParams.qecSTime = null;
       this.queryParams.qecETime = null;
+      this.queryParams.periodSTime = null;
+      this.queryParams.periodDTime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
       this.queryParams.sopId = null; // 重置SOP ID
@@ -891,6 +919,71 @@ export default {
         this.queryParams.qecETime = null;
       }
     },
+
+    //营期课程时间
+    qecPeriodTimeChange(periodTime){
+
+      if (periodTime && periodTime.length >= 2) {
+        // 检查选择的日期范围是否超过7天(包括起始和结束日期)
+        const startDate = new Date(periodTime[0]);
+        const endDate = new Date(periodTime[1]);
+
+        // 设置时间为当天开始,避免时间部分影响计算
+        startDate.setHours(0, 0, 0, 0);
+        endDate.setHours(0, 0, 0, 0);
+
+        const timeDiff = Math.abs(endDate - startDate);
+        const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
+
+        // 如果超过6天的范围(总共7天,包括起始日)
+        if (diffDays > 13) {
+          this.$message.error('时间选择范围不能超过14天');
+          // 清空选择
+          this.periodTime = [];
+          this.periodTimeText = [];
+          this.queryParams.periodSTime = null;
+          this.queryParams.periodETime = null;
+          this.periodTimeKey++;
+          return;
+        }
+
+        this.queryParams.periodSTime = this.formatDate(periodTime[0]) || null;
+        this.queryParams.periodETime = this.formatDate(periodTime[1]) || null;
+
+      } else {
+
+        this.periodTimeText = '';
+        this.queryParams.periodSTime = null;
+        this.queryParams.periodETime = null;
+      }
+
+    },
+
+    formatDate(date) {
+      if (!date) return ''
+
+      // 确保 date 是 Date 对象
+      let dateObj = date
+      if (typeof date === 'string') {
+        dateObj = new Date(date)
+      }
+
+      // 如果转换失败,返回空字符串
+      if (!(dateObj instanceof Date) || isNaN(dateObj.getTime())) {
+        return ''
+      }
+
+      // 使用更安全的格式化方法
+      const year = dateObj.getFullYear()
+      const month = String(dateObj.getMonth() + 1).padStart(2, '0')
+      const day = String(dateObj.getDate()).padStart(2, '0')
+      const hours = String(dateObj.getHours()).padStart(2, '0')
+      const minutes = String(dateObj.getMinutes()).padStart(2, '0')
+      const seconds = String(dateObj.getSeconds()).padStart(2, '0')
+
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+    },
+
     /**
      * 根据名称模糊查询用户列表
      * @param query 参数

+ 92 - 2
src/views/course/courseWatchLog/index.vue

@@ -216,6 +216,23 @@
         />
       </el-form-item>
 
+
+      <el-form-item label="营期课程时间" prop="periodTime" v-if="queryParams.sendType==1">
+        <el-date-picker
+          v-model="periodTimeText"
+          type="datetimerange"
+          align="right"
+          unlink-panels
+          value-format="yyyy-MM-dd HH:mm:ss"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          @change="qecPeriodTimeChange"
+          :default-time="['00:00:00', '23:59:59']">
+        </el-date-picker>
+      </el-form-item>
+
       <el-form-item label="是否为会员" prop="isVip">
         <el-select
           filterable
@@ -564,16 +581,19 @@ export default {
       createCalendarKey: 0,
       updateCalendarKey: 0,
       qecCalendarKey: 0,
+      periodTimeKey: 0,
 
       createTimeText: '',
       scheduleTimeText: '',  // 新增
       updateTimeText: '',    // 新增
       qecCreateTimeText: '', // 新增
+      periodTimeText: '', // 营期课程时间
 
       scheduleTime: [],  // 改为数组
       createTime: [],    // 改为数组
       updateTime: [],    // 改为数组
       qecCreateTime: [], // 改为数组
+      periodTime: [], // 改为数组
 
       // 控制日历显隐
       showScheduleCalendar: false,
@@ -588,9 +608,9 @@ export default {
       activeName:"2",
       pickerOptions: {
         disabledDate(time) {
-          // 获取6天前的日期(加上今天就是7天)
+          // 获取13天前的日期(加上今天就是14天)
           const sixDaysAgo = new Date();
-          sixDaysAgo.setDate(sixDaysAgo.getDate() - 6);
+          sixDaysAgo.setDate(sixDaysAgo.getDate() - 13);
           sixDaysAgo.setHours(0, 0, 0, 0);
 
           // 获取明天的日期(不包括今天)
@@ -707,6 +727,8 @@ export default {
         upETime:null,
         qecSTime:null,
         qecETime:null,
+        periodSTime:null,
+        periodETime:null,
         scheduleStartTime: null,
         scheduleEndTime: null,
         sendType:process.env.VUE_APP_COURSE_DEFAULT,
@@ -786,17 +808,20 @@ export default {
       this.createTime = [];
       this.updateTime = [];
       this.qecCreateTime = [];
+      this.periodTime = [];
 
       this.scheduleTimeText = [];
       this.createTimeText = [];
       this.updateTimeText = [];
       this.qecCreateTimeText = [];
+      this.periodTimeText = [];
 
       // 强制刷新日历组件
       this.scheduleCalendarKey++;
       this.createCalendarKey++;
       this.updateCalendarKey++;
       this.qecCalendarKey++;
+      this.periodTimeKey++;
     },
     formatDateRange(dates) {
       if (!dates || dates.length < 2) return '';
@@ -891,6 +916,69 @@ export default {
       }
     },
 
+    //营期课程时间
+    qecPeriodTimeChange(periodTime){
+
+      if (periodTime && periodTime.length >= 2) {
+        // 检查选择的日期范围是否超过7天(包括起始和结束日期)
+        const startDate = new Date(periodTime[0]);
+        const endDate = new Date(periodTime[1]);
+
+        // 设置时间为当天开始,避免时间部分影响计算
+        startDate.setHours(0, 0, 0, 0);
+        endDate.setHours(0, 0, 0, 0);
+
+        const timeDiff = Math.abs(endDate - startDate);
+        const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
+
+        // 如果超过6天的范围(总共7天,包括起始日)
+        if (diffDays > 13) {
+          this.$message.error('时间选择范围不能超过14天');
+          // 清空选择
+          this.periodTime = [];
+          this.periodTimeText = [];
+          this.queryParams.periodSTime = null;
+          this.queryParams.periodETime = null;
+          this.periodTimeKey++;
+          return;
+        }
+
+        this.queryParams.periodSTime = this.formatDate(periodTime[0]) || null;
+        this.queryParams.periodETime = this.formatDate(periodTime[1]) || null;
+
+      } else {
+
+        this.periodTimeText = '';
+        this.queryParams.periodSTime = null;
+        this.queryParams.periodETime = null;
+      }
+
+    },
+
+    formatDate(date) {
+      if (!date) return ''
+
+      // 确保 date 是 Date 对象
+      let dateObj = date
+      if (typeof date === 'string') {
+        dateObj = new Date(date)
+      }
+
+      // 如果转换失败,返回空字符串
+      if (!(dateObj instanceof Date) || isNaN(dateObj.getTime())) {
+        return ''
+      }
+
+      // 使用更安全的格式化方法
+      const year = dateObj.getFullYear()
+      const month = String(dateObj.getMonth() + 1).padStart(2, '0')
+      const day = String(dateObj.getDate()).padStart(2, '0')
+      const hours = String(dateObj.getHours()).padStart(2, '0')
+      const minutes = String(dateObj.getMinutes()).padStart(2, '0')
+      const seconds = String(dateObj.getSeconds()).padStart(2, '0')
+
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+    },
 
 
     handleClickX(tab,event){
@@ -964,6 +1052,8 @@ export default {
       this.queryParams.upETime = null;
       this.queryParams.qecSTime = null;
       this.queryParams.qecETime = null;
+      this.queryParams.periodSTime = null;
+      this.queryParams.periodDTime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
       this.queryParams.sopId = null; // 重置SOP ID

+ 94 - 2
src/views/course/courseWatchLog/watchLog.vue

@@ -222,6 +222,23 @@
           @change="qecCreateTimeChange"
         />
       </el-form-item>
+
+      <el-form-item label="营期课程时间" prop="periodTime" v-if="queryParams.sendType==1">
+        <el-date-picker
+          v-model="periodTimeText"
+          type="datetimerange"
+          align="right"
+          unlink-panels
+          value-format="yyyy-MM-dd HH:mm:ss"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :picker-options="pickerOptions"
+          @change="qecPeriodTimeChange"
+          :default-time="['00:00:00', '23:59:59']">
+        </el-date-picker>
+      </el-form-item>
+
       <el-form-item label="是否为会员" prop="isVip">
         <el-select
           filterable
@@ -595,16 +612,19 @@ export default {
       createCalendarKey: 0,
       updateCalendarKey: 0,
       qecCalendarKey: 0,
+      periodTimeKey: 0,
 
       createTimeText: '',
       scheduleTimeText: '',  // 新增
       updateTimeText: '',    // 新增
       qecCreateTimeText: '', // 新增
+      periodTimeText: '', // 营期课程时间
 
       scheduleTime: [],  // 改为数组
       createTime: [],    // 改为数组
       updateTime: [],    // 改为数组
       qecCreateTime: [], // 改为数组
+      periodTime: [], // 改为数组
 
       // 控制日历显隐
       showScheduleCalendar: false,
@@ -619,9 +639,9 @@ export default {
       activeName:"2",
       pickerOptions: {
         disabledDate(time) {
-          // 获取6天前的日期(加上今天就是7天)
+          // 获取13天前的日期(加上今天就是14天)
           const sixDaysAgo = new Date();
-          sixDaysAgo.setDate(sixDaysAgo.getDate() - 6);
+          sixDaysAgo.setDate(sixDaysAgo.getDate() - 13);
           sixDaysAgo.setHours(0, 0, 0, 0);
 
           // 获取明天的日期(不包括今天)
@@ -740,6 +760,8 @@ export default {
         upETime:null,
         qecSTime:null,
         qecETime:null,
+        periodSTime:null,
+        periodETime:null,
         scheduleStartTime: null,
         scheduleEndTime: null,
         sendType:process.env.VUE_APP_COURSE_DEFAULT,
@@ -804,17 +826,20 @@ export default {
       this.createTime = [];
       this.updateTime = [];
       this.qecCreateTime = [];
+      this.periodTime = [];
 
       this.scheduleTimeText = '';
       this.createTimeText = '';
       this.updateTimeText = '';
       this.qecCreateTimeText = '';
+      this.periodTimeText = [];
 
       // 强制刷新日历组件
       this.scheduleCalendarKey++;
       this.createCalendarKey++;
       this.updateCalendarKey++;
       this.qecCalendarKey++;
+      this.periodTimeKey++;
     },
     formatDateRange(dates) {
       if (!dates || dates.length < 2) return '';
@@ -925,6 +950,71 @@ export default {
         this.queryParams.qecETime = null;
       }
     },
+
+    //营期课程时间
+    qecPeriodTimeChange(periodTime){
+
+      if (periodTime && periodTime.length >= 2) {
+        // 检查选择的日期范围是否超过7天(包括起始和结束日期)
+        const startDate = new Date(periodTime[0]);
+        const endDate = new Date(periodTime[1]);
+
+        // 设置时间为当天开始,避免时间部分影响计算
+        startDate.setHours(0, 0, 0, 0);
+        endDate.setHours(0, 0, 0, 0);
+
+        const timeDiff = Math.abs(endDate - startDate);
+        const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
+
+        // 如果超过6天的范围(总共7天,包括起始日)
+        if (diffDays > 13) {
+          this.$message.error('时间选择范围不能超过14天');
+          // 清空选择
+          this.periodTime = [];
+          this.periodTimeText = [];
+          this.queryParams.periodSTime = null;
+          this.queryParams.periodETime = null;
+          this.periodTimeKey++;
+          return;
+        }
+
+        this.queryParams.periodSTime = this.formatDate(periodTime[0]) || null;
+        this.queryParams.periodETime = this.formatDate(periodTime[1]) || null;
+
+      } else {
+
+        this.periodTimeText = '';
+        this.queryParams.periodSTime = null;
+        this.queryParams.periodETime = null;
+      }
+
+    },
+
+    formatDate(date) {
+      if (!date) return ''
+
+      // 确保 date 是 Date 对象
+      let dateObj = date
+      if (typeof date === 'string') {
+        dateObj = new Date(date)
+      }
+
+      // 如果转换失败,返回空字符串
+      if (!(dateObj instanceof Date) || isNaN(dateObj.getTime())) {
+        return ''
+      }
+
+      // 使用更安全的格式化方法
+      const year = dateObj.getFullYear()
+      const month = String(dateObj.getMonth() + 1).padStart(2, '0')
+      const day = String(dateObj.getDate()).padStart(2, '0')
+      const hours = String(dateObj.getHours()).padStart(2, '0')
+      const minutes = String(dateObj.getMinutes()).padStart(2, '0')
+      const seconds = String(dateObj.getSeconds()).padStart(2, '0')
+
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+    },
+
     /** 查询短链课程看课记录列表 */
     getList() {
       this.loading = true;
@@ -987,6 +1077,8 @@ export default {
       this.queryParams.upETime = null;
       this.queryParams.qecSTime = null;
       this.queryParams.qecETime = null;
+      this.queryParams.periodSTime = null;
+      this.queryParams.periodDTime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
       this.queryParams.sopId = null; // 重置SOP ID

+ 141 - 26
src/views/hisStore/components/productOrder.vue

@@ -356,10 +356,10 @@
     </el-dialog>
     <el-dialog :title="editAddress.title" :visible.sync="editAddress.open" width="600px" append-to-body>
       <el-form ref="editAddressForm" :model="editAddressForm" :rules="editAddressRules" label-width="100px">
-        <el-form-item label="收件人" prop="realName">
+        <el-form-item label="收件人" prop="realName" required>
           <el-input v-model="editAddressForm.realName" placeholder="请输入收件人" />
         </el-form-item>
-          <el-form-item label="联系电话" prop="source">
+          <el-form-item label="联系电话" prop="userPhone" required>
           <el-input v-model="editAddressForm.userPhone" placeholder="请输入联系电话" />
         </el-form-item>
         <el-form-item label="收货地址" prop="district">
@@ -396,7 +396,7 @@
           </el-col>
         </el-row>
         </el-form-item>
-        <el-form-item label="详细地址" prop="detail">
+        <el-form-item label="详细地址" prop="detail" required>
           <el-input v-model="editAddressForm.detail" placeholder="请输入收货人详细地址" />
         </el-form-item>
       </el-form>
@@ -757,35 +757,150 @@ export default {
           this.province=res.data.filter(item => item.level===0 )
         })
     },
-    handleEditAddress() {
-        this.getCityList();
-        this.editAddressForm.id=this.order.id;
-        this.editAddressForm.realName=this.order.realName;
-        this.editAddressForm.userPhone=this.order.userPhone;
-        var address=this.order.userAddress.split(' ')
-        var province=this.citys.find((item)=>{
-          return item.name==address[0]&&item.level==0;
-        })
-        if(province!=null){
-          this.editAddressForm.provinceId=province.cityId;
-          this.city=this.citys.filter(item => item.parentId===province.cityId&&item.level==1 )
-        }
-        var city=this.citys.find((item)=>{
-          return item.name==address[1]&&item.level==1;
-        })
+    flattenCityData(data, level = 0) {
+      let result = [];
+      data.forEach(item => {
+        // 转换字段名
+        const cityItem = {
+          cityId: item.value,
+          name: item.label,
+          parentId: item.pid,
+          level: level
+        };
+        result.push(cityItem);
 
-        if(city!=null){
-          this.editAddressForm.cityId=city.cityId;
-          this.district=this.citys.filter(item => item.parentId===city.cityId&&item.level==2 )
+        // 递归处理子节点
+        if (item.children && item.children.length > 0) {
+          result = result.concat(this.flattenCityData(item.children, level + 1));
         }
-        var district=this.citys.find((item)=>{
-          return item.name==address[2]&&item.level==2;
+      });
+      return result;
+    },
+    handleEditAddress() {
+      let loading = this.$loading({
+        lock: true,
+        text: "请求中...",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      const orderId = this.order.id;
+
+      getStoreOrderAddress(orderId).then(addressResponse => {
+        // 更新解密后的地址
+        this.order.userAddress = addressResponse.address;
+
+      }).then(res=>{
+        const id = this.order.id;
+        return getUserPhone(id).then(response =>{
+          this.order.userPhone = response.userPhone;
         })
-        if(district!=null){
-          this.editAddressForm.districtId=district.cityId;
+      }).then(res=>{
+        return getCitys();
+      }).then(res => {
+        this.citys = this.flattenCityData(res.data);
+        this.province = this.citys.filter(item => item.level === 0);
+
+        this.editAddressForm = {
+          id: this.order.id,
+          realName: this.order.realName,
+          userPhone: this.order.userPhone,
+          provinceId: null,
+          cityId: null,
+          districtId: null,
+          province: '',
+          city: '',
+          district: '',
+          detail: ''
+        };
+
+        // 解析地址
+        if (this.order.userAddress) {
+          var addressParts = this.order.userAddress.split(' ');
+
+          // 查找省份
+          if (addressParts.length > 0) {
+            var province = this.citys.find((item) => {
+              return item.name === addressParts[0] && item.level === 0;
+            });
+            if (province != null) {
+              this.editAddressForm.provinceId = province.cityId;
+              this.editAddressForm.province = province.name;
+
+              // 检查是否为直辖市(北京、上海、天津、重庆)
+              const isDirectMunicipality = ['北京市', '上海市', '天津市', '重庆市'].includes(province.name);
+
+              if (isDirectMunicipality) {
+                // 直辖市处理:先找到市级节点(市辖区)
+                if (addressParts.length > 1) {
+                  // 查找市级节点(第2部分,如"市辖区")
+                  var cityLevel = this.citys.find((item) => {
+                    return item.name === addressParts[1] && item.level === 1 && item.parentId === province.cityId;
+                  });
+
+                  if (cityLevel != null) {
+                    this.editAddressForm.cityId = cityLevel.cityId;
+                    this.editAddressForm.city = cityLevel.name;
+                    this.city = this.citys.filter(item => item.parentId === province.cityId && item.level === 1);
+
+                    // 使用市级节点的cityId作为parentId查找区县
+                    if (addressParts.length > 2) {
+                      var district = this.citys.find((item) => {
+                        return item.name === addressParts[2] && item.level === 2 && item.parentId === cityLevel.cityId;
+                      });
+
+                      if (district != null) {
+                        this.editAddressForm.districtId = district.cityId;
+                        this.editAddressForm.district = district.name;
+                        this.district = this.citys.filter(item => item.parentId === cityLevel.cityId && item.level === 2);
+                      }
+                    }
+
+                    // 提取详细地址(第4部分及之后)
+                    if (addressParts.length > 3) {
+                      this.editAddressForm.detail = addressParts.slice(3).join(' ');
+                    }
+                  }
+                }
+              } else {
+                // 普通省份处理:正常匹配市、区
+                this.city = this.citys.filter(item => item.parentId === province.cityId && item.level === 1);
+
+                // 查找城市
+                if (addressParts.length > 1) {
+                  var city = this.citys.find((item) => {
+                    return item.name === addressParts[1] && item.level === 1;
+                  });
+                  if (city != null) {
+                    this.editAddressForm.cityId = city.cityId;
+                    this.editAddressForm.city = city.name;
+                    this.district = this.citys.filter(item => item.parentId === city.cityId && item.level === 2);
+                  }
+                }
+                // 查找区县
+                if (addressParts.length > 2) {
+                  var district = this.citys.find((item) => {
+                    return item.name === addressParts[2] && item.level === 2;
+                  });
+                  if (district != null) {
+                    this.editAddressForm.districtId = district.cityId;
+                    this.editAddressForm.district = district.name;
+                  }
+                }
+                // 提取详细地址(第4部分及之后)
+                if (addressParts.length > 3) {
+                  this.editAddressForm.detail = addressParts.slice(3).join(' ');
+                }
+              }
+            }
+          }
         }
 
         this.editAddress.open = true;
+      }).catch(error => {
+        this.msgError("加载数据失败");
+        console.error(error);
+      }).finally(()=>{
+        loading.close();
+      })
     },
     /** 提交按钮 */
     submitEditAddressForm() {

+ 1 - 1
src/views/qw/externalContact/collection.vue

@@ -45,7 +45,7 @@
         </el-form>
         <div slot="footer" class="dialog-footer">
             <el-button type="primary" @click="submitForm">确 定</el-button>
-            <el-button @click="cancel">取 消</el-button>
+            <!-- <el-button @click="cancel">取 消</el-button> -->
         </div>
 
 

+ 47 - 33
src/views/qw/externalContact/myExternalContact.vue

@@ -464,6 +464,14 @@
           >
             <span>初诊单</span>
           </el-button>
+          <el-button
+             size="mini"
+             type="text"
+             @click="handleInfoCollection(scope.row)"
+             v-if="scope.row.fsUserId"
+             >
+             <span>信息采集</span>
+          </el-button>
 
 <!--          <el-button v-if="scope.row.customerId"-->
 <!--            size="mini"-->
@@ -838,26 +846,29 @@
 	  <info  ref="Details" />
 	</el-drawer>
     <el-dialog :title="user.title" :visible.sync="user.open" width="800px" append-to-body>
-        <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
-      </el-dialog>
-      <el-dialog title="修改客户状态" :visible.sync="statusDialog.open" width="500px" append-to-body>
-        <el-form ref="statusForm" :model="statusForm" :rules="statusRules" label-width="100px">
-          <el-form-item label="状态" prop="status">
-            <el-select v-model="statusForm.status" placeholder="请选择状态" size="small">
-              <el-option
-                v-for="dict in statusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              />
-            </el-select>
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button @click="statusDialog.open = false">取 消</el-button>
-          <el-button type="primary" @click="submitStatusForm">提 交</el-button>
-        </div>
-      </el-dialog>
+      <selectUser ref="selectUser" @bindMiniCustomerId="bindMiniCustomerId"></selectUser>
+    </el-dialog>
+    <el-dialog :title="collection.title" :visible.sync="collection.open"   width="1100px" append-to-body>
+	  <collection   ref="collection" />
+	</el-dialog>
+  <el-dialog title="修改客户状态" :visible.sync="statusDialog.open" width="500px" append-to-body>
+    <el-form ref="statusForm" :model="statusForm" :rules="statusRules" label-width="100px">
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="statusForm.status" placeholder="请选择状态" size="small">
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="statusDialog.open = false">取 消</el-button>
+      <el-button type="primary" @click="submitStatusForm">提 交</el-button>
+    </div>
+  </el-dialog>
   </div>
 </template>
 
@@ -894,23 +905,15 @@ import { editTalk,editAllTalk } from "@/api/qw/externalContactInfo";
 import {createLinkUrl} from "@/api/course/sopCourseLink";
 import {docList} from "@/api/doctor/doctor";
 import PaginationMore from "../../../components/PaginationMore/index.vue";
+import Collection from './collection.vue';
 export default {
   name: "ExternalContact",
-  components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info},
+  components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,Collection},
   data() {
     return {
-      statusDialog: {
-        open: false,
-        title: "修改客户状态"
-      },
-      statusForm: {
-        id: null,
-        status: null
-      },
-      statusRules: {
-        status: [
-          {required: true, message: '状态不能为空', trigger: 'change'}
-        ]
+      collection:{
+        titile:"信息采集",
+        open:false,
       },
       doctorList:[],
       diagnosisForm:{},
@@ -1128,6 +1131,17 @@ export default {
 
   },
   methods: {
+    handleInfoCollection(row){
+      this.collection.title = "信息采集";
+      this.collection.open = true;
+      this.userId = row.fsUserId;
+      setTimeout(() => {
+                 this.$refs.collection.getCollectionInfo(row.fsUserId);
+            }, 1);
+    },
+    closeCollection(){
+      this.collection.open = false;
+    }, 
     doctorChange(val){
       for(const doctor of this.doctorList) {
         if(doctor.id == val) {