Sfoglia il codice sorgente

客户部分功能完善,新增小满客户几个字段

cz 1 anno fa
parent
commit
0336097e92

+ 303 - 271
src/assets/styles/ruoyi.scss

@@ -4,274 +4,306 @@
  */
 
  /** 基础通用 **/
-.pt5 {
-	padding-top: 5px;
-}
-.pr5 {
-	padding-right: 5px;
-}
-.pb5 {
-	padding-bottom: 5px;
-}
-.mt5 {
-	margin-top: 5px;
-}
-.mr5 {
-	margin-right: 5px;
-}
-.mb5 {
-	margin-bottom: 5px;
-}
-.mb8 {
-	margin-bottom: 8px;
-}
-.ml5 {
-	margin-left: 5px;
-}
-.mt10 {
-	margin-top: 10px;
-}
-.mr10 {
-	margin-right: 10px;
-}
-.mb10 {
-	margin-bottom: 10px;
-}
-.ml10 {
-	margin-left: 10px;
-}
-.mt20 {
-	margin-top: 20px;
-}
-.mr20 {
-	margin-right: 20px;
-}
-.mb20 {
-	margin-bottom: 20px;
-}
-.ml20 {
-	margin-left: 20px;
-}
-
-.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
-	font-family: inherit;
-	font-weight: 500;
-	line-height: 1.1;
-	color: inherit;
-}
-
-.el-form .el-form-item__label {
-	font-weight: 700;
-}
-.el-dialog:not(.is-fullscreen) {
-	margin-top: 6vh !important;
-}
-
-.el-dialog.scrollbar .el-dialog__body {
-	overflow: auto;
-	overflow-x: hidden;
-	max-height: 70vh;
-	padding: 10px 20px 0;
-}
-
-.el-table {
-	.el-table__header-wrapper, .el-table__fixed-header-wrapper {
-		th {
-			word-break: break-word;
-			background-color: #EEEEEE !important;
-			color: #515a6e;
-			height: 50px !important;
-			font-size: 14px;
-		}
-	}
-	.el-table__body-wrapper {
-		.el-button [class*="el-icon-"] + span {
-			margin-left: 1px;
-		}
-	}
-}
-
-/** 表单布局 **/
-.form-header {
-    font-size:15px;
-	color:#6379bb;
-	border-bottom:1px solid #ddd;
-	margin:8px 10px 25px 10px;
-	padding-bottom:5px
-}
-
-/** 表格布局 **/
-.pagination-container {
-	// position: relative;
-	height: 25px;
-	margin-bottom: 10px;
-	margin-top: 15px;
-	padding: 10px 20px !important;
-}
-
-/* tree border */
-.tree-border {
-    margin-top: 5px;
-    border: 1px solid #e5e6e7;
-    background: #FFFFFF none;
-    border-radius:4px;
-    width: 100%;
-}
-
-.pagination-container .el-pagination {
-	right: 0;
-	position: absolute;
-}
-
-@media ( max-width : 768px) {
-  .pagination-container .el-pagination > .el-pagination__jump {
-    display: none !important;
-  }
-  .pagination-container .el-pagination > .el-pagination__sizes {
-    display: none !important;
-  }
-}
-
-.el-table .fixed-width .el-button--small {
-	padding-left: 0;
-	padding-right: 0;
-	width: inherit;
-}
-
-/** 表格更多操作下拉样式 */
-.el-table .el-dropdown-link {
-	cursor: pointer;
-	color: #409EFF;
-	margin-left: 10px;
-}
-
-.el-table .el-dropdown, .el-icon-arrow-down {
-	font-size: 12px;
-}
-
-.el-tree-node__content > .el-checkbox {
-	margin-right: 8px;
-}
-
-.list-group-striped > .list-group-item {
-	border-left: 0;
-	border-right: 0;
-	border-radius: 0;
-	padding-left: 0;
-	padding-right: 0;
-}
-
-.list-group {
-	padding-left: 0px;
-	list-style: none;
-}
-
-.list-group-item {
-	border-bottom: 1px solid #e7eaec;
-	border-top: 1px solid #e7eaec;
-	margin-bottom: -1px;
-	padding: 11px 0px;
-	font-size: 13px;
-}
-
-.pull-right {
-	float: right !important;
-}
-
-.el-card__header {
-	padding: 14px 15px 7px !important;
-	min-height: 40px;
-}
-
-.el-card__body {
-	padding: 15px 20px 20px 20px !important;
-}
-
-.card-box {
-	padding-right: 15px;
-	padding-left: 15px;
-	margin-bottom: 10px;
-}
-
-/* button color */
-.el-button--cyan.is-active,
-.el-button--cyan:active {
-  background: #20B2AA;
-  border-color: #20B2AA;
-  color: #FFFFFF;
-}
-
-.el-button--cyan:focus,
-.el-button--cyan:hover {
-  background: #48D1CC;
-  border-color: #48D1CC;
-  color: #FFFFFF;
-}
-
-.el-button--cyan {
-  background-color: #20B2AA;
-  border-color: #20B2AA;
-  color: #FFFFFF;
-}
-
-/* text color */
-.text-navy {
-	color: #1ab394;
-}
-
-.text-primary {
-	color: inherit;
-}
-
-.text-success {
-	color: #1c84c6;
-}
-
-.text-info {
-	color: #23c6c8;
-}
-
-.text-warning {
-	color: #f8ac59;
-}
-
-.text-danger {
-	color: #ed5565;
-}
-
-.text-muted {
-	color: #888888;
-}
-
-/* image */
-.img-circle {
-	border-radius: 50%;
-}
-
-.img-lg {
-	width: 120px;
-	height: 120px;
-}
-
-.avatar-upload-preview {
-	position: absolute;
-	top: 50%;
-	transform: translate(50%, -50%);
-	width: 200px;
-	height: 200px;
-	border-radius: 50%;
-	box-shadow: 0 0 4px #ccc;
-	overflow: hidden;
-}
-
-/* 拖拽列样式 */
-.sortable-ghost{
-	opacity: .8;
-	color: #fff!important;
-	background: #42b983!important;
-}
-
-/* 表格右侧工具栏样式 */
-.top-right-btn {
-	margin-left: auto;
-}
+ .pt5 {
+ 	padding-top: 5px;
+ }
+
+ .pr5 {
+ 	padding-right: 5px;
+ }
+
+ .pb5 {
+ 	padding-bottom: 5px;
+ }
+
+ .mt5 {
+ 	margin-top: 5px;
+ }
+
+ .mr5 {
+ 	margin-right: 5px;
+ }
+
+ .mb5 {
+ 	margin-bottom: 5px;
+ }
+
+ .mb8 {
+ 	margin-bottom: 8px;
+ }
+
+ .ml5 {
+ 	margin-left: 5px;
+ }
+
+ .mt10 {
+ 	margin-top: 10px;
+ }
+
+ .mr10 {
+ 	margin-right: 10px;
+ }
+
+ .mb10 {
+ 	margin-bottom: 10px;
+ }
+
+ .ml10 {
+ 	margin-left: 10px;
+ }
+
+ .mt20 {
+ 	margin-top: 20px;
+ }
+
+ .mr20 {
+ 	margin-right: 20px;
+ }
+
+ .mb20 {
+ 	margin-bottom: 20px;
+ }
+
+ .ml20 {
+ 	margin-left: 20px;
+ }
+
+ .h1,
+ .h2,
+ .h3,
+ .h4,
+ .h5,
+ .h6,
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6 {
+ 	font-family: inherit;
+ 	font-weight: 500;
+ 	line-height: 1.1;
+ 	color: inherit;
+ }
+
+ .el-form .el-form-item__label {
+ 	font-weight: 700;
+ }
+
+ .el-dialog:not(.is-fullscreen) {
+ 	margin-top: 6vh !important;
+ }
+
+ .el-dialog.scrollbar .el-dialog__body {
+ 	overflow: auto;
+ 	overflow-x: hidden;
+ 	max-height: 70vh;
+ 	padding: 10px 20px 0;
+ }
+
+ .el-table {
+
+ 	.el-table__header-wrapper,
+ 	.el-table__fixed-header-wrapper {
+ 		th {
+ 			word-break: break-word;
+ 			// background-color: #EEEEEE !important;
+ 			color: #515a6e;
+ 			height: 50px !important;
+ 			font-size: 14px;
+ 		}
+ 	}
+
+ 	.el-table__body-wrapper {
+ 		.el-button [class*="el-icon-"]+span {
+ 			margin-left: 1px;
+ 		}
+ 	}
+ }
+
+ /** 表单布局 **/
+ .form-header {
+ 	font-size: 15px;
+ 	color: #6379bb;
+ 	border-bottom: 1px solid #ddd;
+ 	margin: 8px 10px 25px 10px;
+ 	padding-bottom: 5px
+ }
+
+ /** 表格布局 **/
+ .pagination-container {
+ 	// position: relative;
+ 	height: 25px;
+ 	margin-bottom: 10px;
+ 	margin-top: 15px;
+ 	padding: 10px 20px !important;
+ }
+
+ /* tree border */
+ .tree-border {
+ 	margin-top: 5px;
+ 	border: 1px solid #e5e6e7;
+ 	background: #FFFFFF none;
+ 	border-radius: 4px;
+ 	width: 100%;
+ }
+
+ .pagination-container .el-pagination {
+ 	right: 0;
+ 	position: absolute;
+ }
+
+ @media (max-width : 768px) {
+ 	.pagination-container .el-pagination>.el-pagination__jump {
+ 		display: none !important;
+ 	}
+
+ 	.pagination-container .el-pagination>.el-pagination__sizes {
+ 		display: none !important;
+ 	}
+ }
+
+ .el-table .fixed-width .el-button--small {
+ 	padding-left: 0;
+ 	padding-right: 0;
+ 	width: inherit;
+ }
+
+ /** 表格更多操作下拉样式 */
+ .el-table .el-dropdown-link {
+ 	cursor: pointer;
+ 	color: #409EFF;
+ 	margin-left: 10px;
+ }
+
+ .el-table .el-dropdown,
+ .el-icon-arrow-down {
+ 	font-size: 12px;
+ }
+
+ .el-tree-node__content>.el-checkbox {
+ 	margin-right: 8px;
+ }
+
+ .list-group-striped>.list-group-item {
+ 	border-left: 0;
+ 	border-right: 0;
+ 	border-radius: 0;
+ 	padding-left: 0;
+ 	padding-right: 0;
+ }
+
+ .list-group {
+ 	padding-left: 0px;
+ 	list-style: none;
+ }
+
+ .list-group-item {
+ 	border-bottom: 1px solid #e7eaec;
+ 	border-top: 1px solid #e7eaec;
+ 	margin-bottom: -1px;
+ 	padding: 11px 0px;
+ 	font-size: 13px;
+ }
+
+ .pull-right {
+ 	float: right !important;
+ }
+
+ .el-card__header {
+ 	padding: 14px 15px 7px !important;
+ 	min-height: 40px;
+ }
+
+ .el-card__body {
+ 	padding: 15px 20px 20px 20px !important;
+ }
+
+ .card-box {
+ 	padding-right: 15px;
+ 	padding-left: 15px;
+ 	margin-bottom: 10px;
+ }
+
+ /* button color */
+ .el-button--cyan.is-active,
+ .el-button--cyan:active {
+ 	background: #20B2AA;
+ 	border-color: #20B2AA;
+ 	color: #FFFFFF;
+ }
+
+ .el-button--cyan:focus,
+ .el-button--cyan:hover {
+ 	background: #48D1CC;
+ 	border-color: #48D1CC;
+ 	color: #FFFFFF;
+ }
+
+ .el-button--cyan {
+ 	background-color: #20B2AA;
+ 	border-color: #20B2AA;
+ 	color: #FFFFFF;
+ }
+
+ /* text color */
+ .text-navy {
+ 	color: #1ab394;
+ }
+
+ .text-primary {
+ 	color: inherit;
+ }
+
+ .text-success {
+ 	color: #1c84c6;
+ }
+
+ .text-info {
+ 	color: #23c6c8;
+ }
+
+ .text-warning {
+ 	color: #f8ac59;
+ }
+
+ .text-danger {
+ 	color: #ed5565;
+ }
+
+ .text-muted {
+ 	color: #888888;
+ }
+
+ /* image */
+ .img-circle {
+ 	border-radius: 50%;
+ }
+
+ .img-lg {
+ 	width: 120px;
+ 	height: 120px;
+ }
+
+ .avatar-upload-preview {
+ 	position: absolute;
+ 	top: 50%;
+ 	transform: translate(50%, -50%);
+ 	width: 200px;
+ 	height: 200px;
+ 	border-radius: 50%;
+ 	box-shadow: 0 0 4px #ccc;
+ 	overflow: hidden;
+ }
+
+ /* 拖拽列样式 */
+ .sortable-ghost {
+ 	opacity: .8;
+ 	color: #fff !important;
+ 	background: #42b983 !important;
+ }
+
+ /* 表格右侧工具栏样式 */
+ .top-right-btn {
+ 	margin-left: auto;
+ }

+ 2 - 1
src/components/byTable/index.vue

@@ -72,7 +72,8 @@
       </div>
 
       <div style="display: flex">
-        <el-input :placeholder="$t('common.pleaseEnterKeywords')" suffix-icon="search" size="mini" v-model="pagination.keyword"
+        <!-- suffix-icon="search" -->
+        <el-input :placeholder="$t('common.pleaseEnterKeywords')" size="mini" v-model="pagination.keyword" clearable @clear="searchFn"
                   @keyup.enter="searchFn">
         </el-input>
         <el-button type="primary" style="margin-left: 10px" size="default" @click="searchFn">{{ $t("common.search") }}</el-button>

+ 66 - 0
src/views/customer/addCustomer.vue

@@ -234,6 +234,13 @@ const getDtl = () => {
     } else {
       res.tags = [];
     }
+    if (res.source) {
+      res.source = res.source.split(",");
+      console.log(res.source, "adwsa");
+    } else {
+      res.source = [];
+    }
+
     formData.data = res;
     getCityData(formData.data.countryId, "20");
     if (formData.data.provinceId) {
@@ -254,6 +261,7 @@ if (props && props.modalType) {
           email: "",
         },
       ],
+      source: [],
     };
     if (props.customerMail) {
       formData.data.customerUserList[0].email = props.customerMail;
@@ -296,6 +304,7 @@ const formConfig = computed(() => {
       type: "select",
       label: "客户来源",
       prop: "source",
+      multiple: true,
       itemWidth: 50,
       data: customerSource.value,
     },
@@ -375,6 +384,62 @@ const formConfig = computed(() => {
       itemType: "text",
     },
     {
+      type: "input",
+      prop: "shortName",
+      label: "小满客户简称",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "homepage",
+      label: "小满公司网址",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "scaleId",
+      label: "小满客户规模",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "fax",
+      label: "小满传真",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "telAreaCode",
+      label: "小满电话区号",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "tel",
+      label: "小满电话",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "小满备注",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "countryName",
+      label: "小满国家",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
       type: "slot",
       slotName: "person",
       label: "客户联系人",
@@ -472,6 +537,7 @@ const handleSubmit = () => {
       formData.data.customerUserList &&
       formData.data.customerUserList.length > 0
     ) {
+      formData.data.source = formData.data.source.join(",");
       formData.data.tag = formData.data.tags.join(",");
       loading.value = true;
       proxy.post("/customer/" + modalType.value, formData.data).then(

+ 145 - 5
src/views/customer/file/index.vue

@@ -92,11 +92,16 @@
       <div style="width:calc(100% - 250px);height:100%;overflow:auto">
         <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :statConfig="[]"
                  :selectConfig="selectConfig" highlight-current-row :action-list="[
-          {
-            text: '添加客户',
-            action: () => openModal(),
+          
+              {
+            text: '更新小满客户',
+            action: () => updateList(),
           },
         ]" @moreSearch="moreSearch" @get-list="getList" ref="table">
+          <!-- {
+            text: '添加客户',
+            action: () => openModal(),
+          }, -->
           <template #isTop="{ item }">
             <div>
               <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/isTop.png'" @click="deleteTop(item)"
@@ -134,6 +139,19 @@
               </template>
             </div>
           </template>
+          <template #companyId="{item}">
+            <div style="width: 100%;">
+              <div v-if="item.companyId" style="display:flex;justify-content:space-between">
+                <span>{{item.companyId}}</span>
+                <el-icon style="cursor:pointer;position:relative;top:6px" size="18" color="#409EFF" @click="handleDeleteCompanyId(item)">
+                  <Delete />
+                </el-icon>
+              </div>
+              <div v-else style="text-align:right"><el-icon style="cursor:pointer" size="18" color="#409EFF" @click="handleBindCompanyId(item)">
+                  <CirclePlus />
+                </el-icon></div>
+            </div>
+          </template>
           <template #follow="{ item }">
             <div :class="'getWidth' + item.id" style="width: 100%">
               <div style="width: 100%; display: flex">
@@ -343,6 +361,32 @@
         <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="手动绑定小满客户" v-if="xmDialog" v-model="xmDialog" width="600">
+      <byForm :formConfig="xmFormConfig" :formOption="xmFormOption" v-model="xmFormData.data" :rules="xmRules" ref="xmFormDom">
+        <template #companyId>
+          <div style="width:100%;display:flex">
+            <div style="width:calc(100% - 85px)">
+              <el-form-item label="" prop="companyName" label-width="0px">
+                <el-input disabled v-model="xmFormData.data.companyName" placeholder="请选择"></el-input>
+              </el-form-item>
+            </div>
+            <el-button type="primary" style="width:68px;margin-left:15px" @click="openSelectXm = true" plain>选择</el-button>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="xmDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitXmForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="'选择小满客户'" v-if="openSelectXm" v-model="openSelectXm" width="80%">
+      <XmCustomer :isSelect="true" @selectXmCustomer="selectXmCustomer"></XmCustomer>
+      <template #footer>
+        <el-button @click="openSelectXm = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -355,6 +399,8 @@ import useUserStore from "@/store/modules/user";
 import selectCity from "@/components/selectCity/index.vue";
 import TitleInfo from "@/components/TitleInfo/index.vue";
 import AddCustomer from "@/views/customer/addCustomer.vue";
+import XmCustomer from "@/views/xiaoman/index.vue";
+
 const AddCustomerDom = ref(null);
 const customerId = ref("");
 const { proxy } = getCurrentInstance();
@@ -528,10 +574,22 @@ const config = computed(() => {
       attrs: {
         label: "客户来源",
         prop: "source",
-        width: 120,
+        width: 150,
       },
       render(type) {
-        return proxy.dictValueLabel(type, customerSource.value);
+        let arr = type.split(",");
+        if (arr && arr.length > 0) {
+          let str = "";
+          for (let i = 0; i < arr.length; i++) {
+            const val = arr[i];
+            str =
+              str +
+              proxy.dictValueLabel(val, customerSource.value) +
+              (i < arr.length - 1 ? " , " : "");
+          }
+          return str;
+        }
+        // return proxy.dictValueLabel(type, customerSource.value);
       },
     },
     {
@@ -566,6 +624,14 @@ const config = computed(() => {
         }
       },
     },
+    // {
+    //   attrs: {
+    //     label: "小满客户ID",
+    //     slot: "companyId",
+    //     width: 170,
+    //   },
+    // },
+
     {
       attrs: {
         label: "跟进",
@@ -1302,6 +1368,80 @@ const refreshList = () => {
   dialogVisible.value = false;
   getList();
 };
+
+const updateList = () => {
+  proxy.msgTip("更新中", 2);
+  proxy.post("/xiaomanCustomer/updateList").then((res) => {
+    setTimeout(() => {
+      proxy.msgTip("更新成功", 1);
+    }, 300);
+  });
+};
+
+const handleDeleteCompanyId = (row) => {
+  proxy
+    .msgConfirm()
+    .then((res) => {
+      proxy
+        .post("/afterSalesRecords/delete", {
+          id: row.id,
+        })
+        .then(() => {
+          proxy.msgTip("解绑成功", 1);
+          getList();
+        });
+    })
+    .catch((err) => {});
+};
+const openSelectXm = ref(false);
+const xmDialog = ref(false);
+const xmFormDom = ref(null);
+const xmFormData = reactive({
+  data: {},
+});
+const xmFormOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+});
+const xmFormConfig = computed(() => {
+  return [
+    {
+      type: "slot",
+      slotName: "companyId",
+      label: "小满客户",
+      prop: "companyName",
+      itemWidth: 100,
+    },
+  ];
+});
+const xmRules = ref({
+  companyName: [{ required: true, message: "请选择小满客户", trigger: "blur" }],
+});
+
+const handleBindCompanyId = (row) => {
+  xmDialog.value = true;
+  xmFormData.data = {
+    id: row.id,
+  };
+};
+
+const selectXmCustomer = (row) => {
+  console.log(row, "sada");
+};
+
+const submitXmForm = () => {
+  xmFormDom.value.handleSubmit(() => {
+    proxy.post("/customer/CustomerAllocationss", xmFormData.data).then(() => {
+      ElMessage({
+        message: "绑定成功",
+        type: "success",
+      });
+      xmDialog.value = false;
+      getList();
+    });
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 75 - 5
src/views/customer/highseas/index.vue

@@ -92,9 +92,9 @@
       <div style="width:calc(100% - 250px);height:100%;overflow:auto">
         <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :statConfig="[]"
                  :selectConfig="selectConfig" highlight-current-row :action-list="[
-          {
-            text: '添加客户',
-            action: () => openModal(),
+            {
+            text: '更新小满客户',
+            action: () => updateList(),
           },
         ]" @moreSearch="moreSearch" @get-list="getList" ref="table">
           <template #isTop="{ item }">
@@ -134,6 +134,19 @@
               </template>
             </div>
           </template>
+          <template #companyId="{item}">
+            <div style="width: 100%;">
+              <div v-if="item.companyId" style="display:flex;justify-content:space-between">
+                <span>{{item.companyId}}</span>
+                <el-icon style="cursor:pointer;position:relative;top:6px" size="18" color="#409EFF" @click="handleDeleteCompanyId(item)">
+                  <Delete />
+                </el-icon>
+              </div>
+              <div v-else style="text-align:right"><el-icon style="cursor:pointer" size="18" color="#409EFF" @click="handleBindCompanyId(item)">
+                  <CirclePlus />
+                </el-icon></div>
+            </div>
+          </template>
           <template #follow="{ item }">
             <div :class="'getWidth' + item.id" style="width: 100%">
               <div style="width: 100%; display: flex">
@@ -330,6 +343,33 @@
         <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="手动绑定小满客户" v-if="xmDialog" v-model="xmDialog" width="600">
+      <byForm :formConfig="xmFormConfig" :formOption="xmFormOption" v-model="xmFormData.data" :rules="xmRules" ref="xmFormDom">
+        <template #companyId>
+          <div style="width:100%;display:flex">
+            <div style="width:calc(100% - 85px)">
+              <el-form-item label="" prop="companyName" label-width="0px">
+                <el-input disabled v-model="xmFormData.data.companyName" placeholder="请选择"></el-input>
+              </el-form-item>
+            </div>
+            <el-button type="primary" style="width:68px;margin-left:15px" @click="openSelectXm = true" plain>选择</el-button>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="xmDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitXmForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="'选择小满客户'" v-if="openSelectXm" v-model="openSelectXm" width="80%">
+      <XmCustomer :isSelect="true" @selectXmCustomer="selectXmCustomer"></XmCustomer>
+      <template #footer>
+        <el-button @click="openSelectXm = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -342,6 +382,8 @@ import useUserStore from "@/store/modules/user";
 import selectCity from "@/components/selectCity/index.vue";
 import TitleInfo from "@/components/TitleInfo/index.vue";
 import AddCustomer from "@/views/customer/addCustomer.vue";
+import XmCustomer from "@/views/xiaoman/index.vue";
+
 const AddCustomerDom = ref(null);
 const customerId = ref("");
 const { proxy } = getCurrentInstance();
@@ -476,10 +518,22 @@ const config = computed(() => {
       attrs: {
         label: "客户来源",
         prop: "source",
-        width: 120,
+        width: 150,
       },
       render(type) {
-        return proxy.dictValueLabel(type, customerSource.value);
+        let arr = type.split(",");
+        if (arr && arr.length > 0) {
+          let str = "";
+          for (let i = 0; i < arr.length; i++) {
+            const val = arr[i];
+            str =
+              str +
+              proxy.dictValueLabel(val, customerSource.value) +
+              (i < arr.length - 1 ? " , " : "");
+          }
+          return str;
+        }
+        // return proxy.dictValueLabel(type, customerSource.value);
       },
     },
     {
@@ -514,6 +568,13 @@ const config = computed(() => {
         }
       },
     },
+    // {
+    //   attrs: {
+    //     label: "小满客户ID",
+    //     slot: "companyId",
+    //     width: 170,
+    //   },
+    // },
     {
       attrs: {
         label: "跟进",
@@ -1324,6 +1385,15 @@ const refreshList = () => {
   dialogVisible.value = false;
   getList();
 };
+
+const updateList = () => {
+  proxy.msgTip("更新中", 2);
+  proxy.post("/xiaomanCustomer/updateList").then((res) => {
+    setTimeout(() => {
+      proxy.msgTip("更新成功", 1);
+    }, 300);
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 75 - 5
src/views/customer/privatesea/index.vue

@@ -91,9 +91,9 @@
       <div style="width:calc(100% - 250px);height:100%;overflow:auto">
         <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :statConfig="[]"
                  :selectConfig="selectConfig" highlight-current-row :action-list="[
-          {
-            text: '添加客户',
-            action: () => openModal(),
+             {
+            text: '更新小满客户',
+            action: () => updateList(),
           },
         ]" @moreSearch="moreSearch" @get-list="getList" ref="table">
           <template #isTop="{ item }">
@@ -133,6 +133,19 @@
               </template>
             </div>
           </template>
+          <template #companyId="{item}">
+            <div style="width: 100%;">
+              <div v-if="item.companyId" style="display:flex;justify-content:space-between">
+                <span>{{item.companyId}}</span>
+                <el-icon style="cursor:pointer;position:relative;top:6px" size="18" color="#409EFF" @click="handleDeleteCompanyId(item)">
+                  <Delete />
+                </el-icon>
+              </div>
+              <div v-else style="text-align:right"><el-icon style="cursor:pointer" size="18" color="#409EFF" @click="handleBindCompanyId(item)">
+                  <CirclePlus />
+                </el-icon></div>
+            </div>
+          </template>
           <template #follow="{ item }">
             <div :class="'getWidth' + item.id" style="width: 100%">
               <div style="width: 100%; display: flex">
@@ -329,6 +342,33 @@
         <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="手动绑定小满客户" v-if="xmDialog" v-model="xmDialog" width="600">
+      <byForm :formConfig="xmFormConfig" :formOption="xmFormOption" v-model="xmFormData.data" :rules="xmRules" ref="xmFormDom">
+        <template #companyId>
+          <div style="width:100%;display:flex">
+            <div style="width:calc(100% - 85px)">
+              <el-form-item label="" prop="companyName" label-width="0px">
+                <el-input disabled v-model="xmFormData.data.companyName" placeholder="请选择"></el-input>
+              </el-form-item>
+            </div>
+            <el-button type="primary" style="width:68px;margin-left:15px" @click="openSelectXm = true" plain>选择</el-button>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="xmDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitXmForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="'选择小满客户'" v-if="openSelectXm" v-model="openSelectXm" width="80%">
+      <XmCustomer :isSelect="true" @selectXmCustomer="selectXmCustomer"></XmCustomer>
+      <template #footer>
+        <el-button @click="openSelectXm = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -341,6 +381,8 @@ import useUserStore from "@/store/modules/user";
 import selectCity from "@/components/selectCity/index.vue";
 import TitleInfo from "@/components/TitleInfo/index.vue";
 import AddCustomer from "@/views/customer/addCustomer.vue";
+import XmCustomer from "@/views/xiaoman/index.vue";
+
 const AddCustomerDom = ref(null);
 const customerId = ref("");
 const { proxy } = getCurrentInstance();
@@ -476,10 +518,22 @@ const config = computed(() => {
       attrs: {
         label: "客户来源",
         prop: "source",
-        width: 120,
+        width: 150,
       },
       render(type) {
-        return proxy.dictValueLabel(type, customerSource.value);
+        let arr = type.split(",");
+        if (arr && arr.length > 0) {
+          let str = "";
+          for (let i = 0; i < arr.length; i++) {
+            const val = arr[i];
+            str =
+              str +
+              proxy.dictValueLabel(val, customerSource.value) +
+              (i < arr.length - 1 ? " , " : "");
+          }
+          return str;
+        }
+        // return proxy.dictValueLabel(type, customerSource.value);
       },
     },
     {
@@ -514,6 +568,13 @@ const config = computed(() => {
         }
       },
     },
+    // {
+    //   attrs: {
+    //     label: "小满客户ID",
+    //     slot: "companyId",
+    //     width: 170,
+    //   },
+    // },
     {
       attrs: {
         label: "跟进",
@@ -1324,6 +1385,15 @@ const refreshList = () => {
   dialogVisible.value = false;
   getList();
 };
+
+const updateList = () => {
+  proxy.msgTip("更新中", 2);
+  proxy.post("/xiaomanCustomer/updateList").then((res) => {
+    setTimeout(() => {
+      proxy.msgTip("更新成功", 1);
+    }, 300);
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 79 - 54
src/views/xiaoman/index.vue

@@ -1,25 +1,18 @@
 <template>
   <div class="tenant">
     <div class="content">
-      <byTable
-        :source="sourceList.data"
-        :pagination="sourceList.pagination"
-        :config="config"
-        :loading="loading"
-        :selectConfig="selectConfig"
-        highlight-current-row
-        :action-list="[
-             {
-            text: '全量同步',
-            action: () => initAllList(),
-          },
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
+               highlight-current-row :action-list="[
+           
              {
             text: '更新近8小时内数据',
             action: () => updateList(),
           },
-        ]"
-        @get-list="getList"
-      >
+        ]" @get-list="getList">
+        <!-- {
+            text: '全量同步',
+            action: () => initAllList(),
+          }, -->
       </byTable>
     </div>
   </div>
@@ -32,6 +25,12 @@ import moment from "moment";
 import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
+const props = defineProps({
+  isSelect: {
+    type: Boolean,
+    default: false,
+  },
+});
 const accountList = ref([]);
 const corporationList = ref([]);
 const tradeMethods = ref([]);
@@ -50,8 +49,7 @@ const sourceList = ref({
 });
 const loading = ref(false);
 const selectConfig = computed(() => {
-  return [
-  ];
+  return [];
 });
 const config = computed(() => {
   return [
@@ -62,32 +60,32 @@ const config = computed(() => {
         width: 200,
       },
     },
-    {
-      attrs: {
-        label: "小满用户ID",
-        prop: "user_id",
-        "min-width": 220,
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "小满用户ID",
+    //     prop: "user_id",
+    //     "min-width": 220,
+    //   },
+    // },
     {
       attrs: {
         label: "公司名称",
         prop: "name",
-        width: 160,
+        "min-width": 160,
       },
     },
     {
       attrs: {
         label: "公司简称",
         prop: "short_name",
-        width: 160,
+        "min-width": 160,
       },
     },
     {
       attrs: {
         label: "客户编号id",
         prop: "serial_id",
-        "min-width": 220,
+        width: 150,
       },
     },
     {
@@ -101,24 +99,49 @@ const config = computed(() => {
       attrs: {
         label: "建档时间",
         prop: "create_time",
-        width: 140,
+        width: 160,
       },
     },
     {
       attrs: {
         label: "更新时间",
         prop: "update_time",
-        width: 120,
+        width: 160,
       },
     },
     {
       attrs: {
         label: "匹配客户列表信息",
         prop: "customer_id",
-        width: 120,
+        width: 150,
       },
     },
-
+    props.isSelect
+      ? {
+          attrs: {
+            label: "操作",
+            width: "80",
+            align: "center",
+            fixed: "right",
+          },
+          // 渲染 el-button,一般用在最后一列。
+          renderHTML(row) {
+            return [
+              {
+                attrs: {
+                  label: "选择",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickSelect(row);
+                },
+              },
+            ];
+          },
+        }
+      : {},
   ];
 });
 
@@ -152,23 +175,25 @@ const getDict = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/xiaomanCustomer/page", sourceList.value.pagination).then((res) => {
-    res.rows.forEach((x) => {
-      x.addTagShow = false;
-      if (x.tag) {
-        x.tags = x.tag.split(",");
-      } else {
-        x.tags = [];
-      }
+  proxy
+    .post("/xiaomanCustomer/page", sourceList.value.pagination)
+    .then((res) => {
+      res.rows.forEach((x) => {
+        x.addTagShow = false;
+        if (x.tag) {
+          x.tags = x.tag.split(",");
+        } else {
+          x.tags = [];
+        }
+      });
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
     });
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
 };
-getDict();
+// getDict();
 getList();
 
 const getLabel = (key, list, label) => {
@@ -183,20 +208,20 @@ const getLabel = (key, list, label) => {
 };
 
 const initAllList = () => {
-
-  proxy.post("/xiaomanCustomer/initAllList").then((res) => {
-
-
-  });
+  proxy.post("/xiaomanCustomer/initAllList").then((res) => {});
 };
 const updateList = () => {
-
+  proxy.msgTip("更新中", 2);
   proxy.post("/xiaomanCustomer/updateList").then((res) => {
-
-
+    setTimeout(() => {
+      proxy.msgTip("更新成功", 1);
+    }, 300);
   });
 };
 
+const clickSelect = (item) => {
+  proxy.$emit("selectXmCustomer", item);
+};
 </script>
 
 <style lang="scss" scoped>