Prechádzať zdrojové kódy

提交客户管家代码

Lijy 11 mesiacov pred
rodič
commit
82412fe44a

+ 2 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/api.ts

@@ -12,9 +12,5 @@ export const URL_RECYCLELIST = `${PREFIX}/deleteList`
 export const URL_ROWBACK = `${PREFIX}/rollback`
 export const URL_THOROUGHLYDETELE = `${PREFIX}/reallyDelete`
 export const URL_CLAIM = `${PREFIX}/claim`
-
-export const stageStatus = [
-    { id: 1, name: "赢单", progress: "100%" },
-    { id: 2, name: "输单", progress: "0%" },
-    { id: 3, name: "无效", progress: "0%" }
-]
+export const URL_FETALL = `${PREFIX}/getAll`
+export const URL_GETDETAIL = `${PREFIX}/getInfo`

+ 40 - 35
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/detail/index.vue

@@ -7,13 +7,13 @@
         </el-link>
       </div>
       <div class="mr-8">
-        <el-select v-model="value" placeholder="请选择" style="width: 150px">
+        <el-select v-model="values" placeholder="请选择" style="width: 150px" @change="getDetail()">
           <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </div>
     </div>
     <!-- 内容 -->
-    <div class="flex-1 flex flex-col overflow-y-auto overflow-x-hidden scroll-bar">
+    <div class="flex-1 flex flex-col overflow-y-auto overflow-x-hidden scroll-bar" v-loading="allLoading.customerDetailLoading">
       <div class="w-full h-auto flex justify-between">
         <div class="bg-white shadow-md rounded-md" style="width: 46%;">
           <Information />
@@ -58,7 +58,9 @@ import { ref, reactive, onMounted, inject } from "vue";
 import type { FormInstance, FormRules } from 'element-plus'
 import { backPath } from '@/utils/tools'
 import { Edit, ArrowLeft as IconView } from '@element-plus/icons-vue'
-import { stageStatus } from '../api'
+import { URL_FETALL, URL_GETDETAIL } from '../api'
+import { post, get } from "@/utils/request";
+import { useRoute } from "vue-router";
 
 import Information from '../component/information.vue'
 import Attachment from '../component/attachment.vue'
@@ -67,40 +69,43 @@ import OperationRecord from '../component/operationRecord.vue';
 import RelatedBusiness from '../component/relatedBusiness.vue';
 import RelatedContacts from "../component/relatedContacts.vue";
 import RelatedOrders from "../component/relatedOrders.vue"
+import { number } from "echarts";
+
+const route = useRoute()
+const globalPopup = inject<GlobalPopup>('globalPopup')
+const rowId = ref(+(route.query.id || ''))
+const values = ref<any>('')
+const options = ref<optionType[]>([])
+const information = ref<any>({})
+const allLoading = reactive({
+  customerDetailLoading: false
+})
+
+function getDetail() {
+  allLoading.customerDetailLoading = true
+  post(URL_GETDETAIL, { id: values.value }).then((res) => {
+    information.value = res.data
+  }).finally(() => {
+    allLoading.customerDetailLoading = false
+  })
+}
 
-const value = ref('')
-const stageStatusVal = ref('')
-const options = [
-  {
-    value: 'Option1',
-    label: 'Option1',
-  },
-  {
-    value: 'Option2',
-    label: 'Option2',
-  },
-  {
-    value: 'Option3',
-    label: 'Option3',
-  },
-  {
-    value: 'Option4',
-    label: 'Option4',
-  },
-  {
-    value: 'Option5',
-    label: 'Option5',
-  },
-]
-
-
-function handleScroll(event: any) { // 滚表横向滚动
-  if (event.deltaY) {
-    event.preventDefault();
-    const element = event.currentTarget;
-    element.scrollLeft += event.deltaY;
-  }
+function getAllCustomer() {
+  get(URL_FETALL).then(({ data }) => {
+      options.value = data.map((item: any) => {
+        return {
+          value: item.id,
+          label: item.customName
+        }
+      })
+  })
 }
+
+onMounted(() => {
+  values.value = rowId.value || ''
+  getAllCustomer()
+  getDetail()
+})
 </script>
   
 <style lang="scss" scoped>