zouzs hace 1 día
padre
commit
fe22200e1b

+ 28 - 38
src/views/login/index.vue

@@ -89,19 +89,29 @@ const getVerifySmsCode = () => {
     loginName: AesEncode(ruleForm.loginName),
     loginPwd: AesEncode(md5(ruleForm.loginPwd).toUpperCase())
   })
-    .then(() => {
-      sendInterval.value = setInterval(function () {
-        if (countdown.value === 0) {
-          clearInterval(sendInterval.value);
-          sendVerifySmsCodeText.value = "点击发送验证码";
-          canSendSecond.value = true;
-          countdown.value = 60;
-          sendInterval.value = null;
-        } else {
-          countdown.value = countdown.value - 1;
-          sendVerifySmsCodeText.value = `${countdown.value}秒后重试`;
-        }
-      }, 1000);
+    .then(res => {
+      if (res.code === 0) {
+        message("发送成功", {
+          type: "success"
+        });
+        sendInterval.value = setInterval(function () {
+          if (countdown.value === 0) {
+            clearInterval(sendInterval.value);
+            sendVerifySmsCodeText.value = "点击发送验证码";
+            canSendSecond.value = true;
+            countdown.value = 60;
+            sendInterval.value = null;
+          } else {
+            countdown.value = countdown.value - 1;
+            sendVerifySmsCodeText.value = `${countdown.value}秒后重试`;
+          }
+        }, 1000);
+      } else {
+        message(res.msg, {
+          type: "error"
+        });
+        canSendSecond.value = true;
+      }
     })
     .catch(() => {
       canSendSecond.value = true;
@@ -127,31 +137,6 @@ const onLogin = async (formEl: FormInstance | undefined) => {
           console.log(res);
           let { code, msg } = res;
           if (code === 0 || code === 3) {
-            // 存储输入信息
-            /*const { storageExpires } = commonSetting;
-              if (formData.agree) {
-                storage.setCookie(
-                  "loginRemember",
-                  "1",
-                  storageExpires * 24 * 60 * 60
-                );
-                storage.setCookie(
-                  "loginRememberName",
-                  loginName,
-                  storageExpires * 24 * 60 * 60
-                );
-                storage.setCookie(
-                  "loginRememberPwd",
-                  loginPwd,
-                  storageExpires * 24 * 60 * 60
-                );
-              } else {
-                storage.setCookie(
-                  "loginRemember",
-                  "0",
-                  storageExpires * 24 * 60 * 60
-                );
-              }*/
             message("登录成功,即将进入系统", {
               type: "success",
               duration: 1000,
@@ -217,6 +202,11 @@ const onLogin = async (formEl: FormInstance | undefined) => {
             ElMessage.warning(msg);
             // getVerifyCode();
             showVerifySms.value = false;
+            clearInterval(sendInterval.value);
+            sendVerifySmsCodeText.value = "点击发送验证码";
+            canSendSecond.value = true;
+            countdown.value = 60;
+            sendInterval.value = null;
           }
         })
         .catch(e => {

+ 204 - 5
src/views/order/detail/detail.vue

@@ -1,14 +1,60 @@
 <script setup lang="ts">
-import { type PlusColumn, PlusDescriptions } from "plus-pro-components";
+import {
+  type FieldValues,
+  type PlusColumn,
+  PlusDescriptions,
+  PlusDialog,
+  PlusDialogForm
+} from "plus-pro-components";
 import { useRoute } from "vue-router";
-import { onMounted, ref } from "vue";
-import { merchantFollowInfoDetail } from "@/api/order";
+import { onMounted, reactive, ref, toRefs } from "vue";
+import {
+  merchantFollowInfoDetail,
+  merchantFollowInfoList,
+  updateStartLevel
+} from "@/api/order";
 import { getDictionary } from "@/utils/dictionary";
+import { ElMessage, FormRules } from "element-plus";
 
 defineOptions({
   name: "OrderLoanDetail"
 });
 
+interface State {
+  dialogVisible: boolean;
+  detailsVisible: boolean;
+  confirmLoading: boolean;
+  form: {};
+  detailForm: {
+    list: any;
+  };
+  rules: FormRules;
+}
+
+const state = reactive<State>({
+  dialogVisible: false,
+  detailsVisible: false,
+  confirmLoading: false,
+  form: {},
+  detailForm: {
+    list: []
+  },
+  rules: {
+    starLevel: [
+      { required: true, message: "请选择客户星级", trigger: "change" }
+    ]
+  }
+});
+
+const {
+  form,
+  detailForm,
+  confirmLoading,
+  rules,
+  dialogVisible,
+  detailsVisible
+} = toRefs(state);
+
 const route = useRoute();
 console.log(route.query.id);
 
@@ -26,6 +72,41 @@ const getDetail = async (id: string) => {
   console.log(data.value);
 };
 
+const handleOpenFormDialog = () => {
+  form.value = {};
+  form.value.orderId = route.query.orderNo;
+  dialogVisible.value = true;
+};
+
+const handleOpenDetailDialog = () => {
+  detailForm.value = data.value;
+  detailForm.value.list = [];
+  merchantFollowInfoList({ orderNo: route.query.orderNo }).then(res => {
+    detailForm.value.list = res.data;
+  });
+  detailsVisible.value = true;
+};
+
+const handleClose = () => {};
+
+const handleSubmit = async (values: FieldValues) => {
+  confirmLoading.value = true;
+  try {
+    let params = form.value;
+    console.log(params);
+    let res = await updateStartLevel(params);
+    if (res.code === 0) {
+      ElMessage.success("修改成功");
+      confirmLoading.value = false;
+      dialogVisible.value = false;
+    } else {
+      ElMessage.error(res.msg);
+    }
+  } finally {
+    confirmLoading.value = false;
+  }
+};
+
 const data = ref();
 
 const columns: PlusColumn[] = [
@@ -113,6 +194,62 @@ const columns5: PlusColumn[] = [
     formatter: val => getDictionary("HouseBuyType", val)
   }
 ];
+
+const formColumns: PlusColumn[] = [
+  {
+    label: "客户星级",
+    prop: "starLevel",
+    valueType: "select",
+    tooltip: {
+      content:
+        "<span>客户星级说明</span></br>" +
+        "<span>0星:未接通</span></br>" +
+        "<span>1星:接通但无办理意向</span></br>" +
+        "<span>2星:有意向但无可贷点</span></br>" +
+        "<span>3星:有可贷点但资质一般</span></br>" +
+        "<span>4星:有可贷点且条件较好</span></br>" +
+        "<span>5星:马上需要或条件优质</span></br>",
+      rawContent: true
+    },
+    options: [
+      { label: "1星", value: 1 },
+      { label: "2星", value: 2 },
+      { label: "3星", value: 3 },
+      { label: "4星", value: 4 },
+      { label: "5星", value: 5 }
+    ]
+  },
+  {
+    label: "备注",
+    prop: "remark",
+    valueType: "input",
+    fieldProps: {
+      type: "textarea",
+      rows: 4,
+      maxlength: 200,
+      showWordLimit: true
+    }
+  }
+];
+
+const detailsColumns: PlusColumn[] = [
+  {
+    label: "姓名:",
+    prop: "userName"
+  },
+  {
+    label: "需求资金:",
+    prop: "loanAmount"
+  },
+  {
+    label: "年龄:",
+    prop: "age"
+  },
+  {
+    label: "需求周期:",
+    prop: "loanTerm"
+  }
+];
 </script>
 
 <template>
@@ -163,11 +300,73 @@ const columns5: PlusColumn[] = [
         <PlusDescriptions :columns="columns5" :data="data" :border="false" />
       </el-card>
       <el-row class="mt-5">
-        <el-col :span="12">
-          <el-button type="primary" @click="$router.back()">返回</el-button>
+        <el-col :span="4">
+          <el-button type="primary" class="w-full" @click="$router.back()"
+            >返回</el-button
+          >
+        </el-col>
+        <el-col :span="4" :offset="1">
+          <el-button type="success" class="w-full" @click="handleOpenFormDialog"
+            >跟进</el-button
+          >
+        </el-col>
+        <el-col :span="4" :offset="1">
+          <el-button
+            type="warning"
+            class="w-full"
+            @click="handleOpenDetailDialog"
+            >跟进记录</el-button
+          >
         </el-col>
       </el-row>
     </el-card>
+    <!-- 跟进弹窗编辑 -->
+    <PlusDialogForm
+      ref="dialogForm"
+      v-model="form"
+      v-model:visible="dialogVisible"
+      :form="{
+        columns: formColumns,
+        labelPosition: 'left',
+        labelWidth: 100,
+        rules
+      }"
+      :dialog="{ title: '跟进', width: 600, confirmLoading }"
+      @confirm="handleSubmit"
+      @close="handleClose"
+    />
+    <!-- 跟进状态弹窗 -->
+    <plusDialog
+      v-model="detailsVisible"
+      :hasFooter="false"
+      title="跟进状态"
+      width="600"
+    >
+      <plus-descriptions
+        :column="4"
+        :data="detailForm"
+        :columns="detailsColumns"
+        :border="false"
+      />
+      <el-timeline>
+        <el-timeline-item
+          v-for="item in detailForm.list"
+          :key="item.id"
+          :timestamp="item.createTime"
+        >
+          <el-card>
+            <el-row>
+              <el-col :span="8">
+                <el-rate v-model="item.starLevel" disabled />
+              </el-col>
+              <el-col :span="16">
+                <el-tag>{{ item.remark }}</el-tag>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-timeline-item>
+      </el-timeline>
+    </plusDialog>
   </div>
 </template>
 

+ 5 - 4
src/views/order/orderLoan/index.vue

@@ -27,7 +27,7 @@
         </el-row>
       </template>
     </PlusPage>
-    <!-- 弹窗编辑 -->
+    <!-- 跟进弹窗编辑 -->
     <PlusDialogForm
       ref="dialogForm"
       v-model="form"
@@ -38,7 +38,7 @@
         labelWidth: 100,
         rules
       }"
-      :dialog="{ title: dialogTitle + '菜单', width: 600, confirmLoading }"
+      :dialog="{ title: '跟进', width: 600, confirmLoading }"
       @confirm="handleSubmit"
       @close="handleClose"
     />
@@ -466,7 +466,8 @@ buttons.value = [
     },
     onClick(val) {
       let params = {
-        id: val.row.id
+        id: val.row.id,
+        orderNo: val.row.orderNo
       };
       Object.keys(params).forEach(param => {
         if (!isString(params[param])) {
@@ -504,7 +505,7 @@ buttons.value = [
   },
   {
     // 修改
-    text: "跟进状态",
+    text: "跟进记录",
     props: {
       type: "primary"
     },

+ 8 - 16
src/views/order/orderMy/index.vue

@@ -17,16 +17,7 @@
         onSelectionChange: handleSelectionChange
       }"
       :pageInfoMap="{ page: 'pageNum', pageSize: 'pageSize' }"
-    >
-      <template #table-title>
-        <el-row class="button-row">
-          <el-button type="danger" @click="handleReliveOrder">
-            解除分配
-          </el-button>
-          <el-button type="primary" @click="handleReset"> 重新分配 </el-button>
-        </el-row>
-      </template>
-    </PlusPage>
+    />
     <!-- 弹窗编辑 -->
     <PlusDialogForm
       ref="dialogForm"
@@ -219,7 +210,7 @@ const tableConfig: PlusColumn[] = [
     width: 100,
     hideInSearch: true
   },
-  {
+  /*{
     label: "微信",
     prop: "wxCode",
     tableColumnProps: {
@@ -231,7 +222,7 @@ const tableConfig: PlusColumn[] = [
     label: "优先联系方式",
     prop: "headContractType",
     hideInSearch: true
-  },
+  },*/
   {
     label: "申请产品",
     prop: "planName",
@@ -253,12 +244,12 @@ const tableConfig: PlusColumn[] = [
     width: 170,
     hideInSearch: true
   },
-  {
+  /*{
     label: "分配子账号",
     prop: "follower",
     width: 120,
     hideInSearch: true
-  },
+  },*/
   {
     label: "状态",
     prop: "followStatus",
@@ -467,7 +458,8 @@ buttons.value = [
     },
     onClick(val) {
       let params = {
-        id: val.row.id
+        id: val.row.id,
+        orderNo: val.row.orderNo
       };
       Object.keys(params).forEach(param => {
         if (!isString(params[param])) {
@@ -505,7 +497,7 @@ buttons.value = [
   },
   {
     // 修改
-    text: "跟进状态",
+    text: "跟进记录",
     props: {
       type: "primary"
     },