Procházet zdrojové kódy

客户管理-增加客户联系人页签中的行查看、编辑、删除按钮和功能;改变客户负责人、客户科室的删除接口类型;增加客户列表的枚举和科室页签列表和表单的枚举。

DongZ před 1 rokem
rodič
revize
24b203c0cc

+ 4 - 3
src/api/business/spd/cm/customersDepartment.js

@@ -36,9 +36,10 @@ export function updateCustomersDepartment(data) {
 }
 
 // 删除客户科室
-export function delCustomersDepartment(id) {
+export function delCustomersDepartment(ids) {
   return request({
-    url: '/cm/customersDepartment/' + id,
-    method: 'delete'
+    url: '/cm/customersDepartment/delete',
+    method: 'post',
+    data: ids
   })
 }

+ 4 - 3
src/api/business/spd/cm/customersResponsiblePerson.js

@@ -36,9 +36,10 @@ export function updateCustomersResponsiblePerson(data) {
 }
 
 // 删除客户负责人
-export function delCustomersResponsiblePerson(id) {
+export function delCustomersResponsiblePerson(ids) {
   return request({
-    url: '/cm/customersResponsiblePerson/' + id,
-    method: 'delete'
+    url: '/cm/customersResponsiblePerson/delete',
+    method: 'post',
+    data: ids
   })
 }

+ 94 - 57
src/views/business/spd/cm/customers/index.vue

@@ -372,7 +372,7 @@
                     <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMkCmCustomersContact">添加
                     </el-button>
                     <el-button type="danger" icon="el-icon-delete" size="mini"
-                      @click="handleDeleteMkCmCustomersContact">
+                      @click="handleDeleteTab('0')">
                       删除
                     </el-button>
                   </el-col>
@@ -408,6 +408,19 @@
                       <dict-tag :options="dict.type.mk_bo_contact_state" :value="scope.row.state"/>
                     </template>
                   </el-table-column>
+                  <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180px"
+                    fixed="right">
+                    <template slot-scope="scope">
+                      <el-button size="mini" type="text" icon="el-icon-search" @click="handleCheckAdd(scope.row, '0')">
+                        查看
+                      </el-button>
+                      <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdateAdd(scope.row, '0')">修改
+                      </el-button>
+                      <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteAdd(scope.row, '0')">
+                        删除
+                      </el-button>
+                    </template>
+                  </el-table-column>
                 </el-table>
               </el-tab-pane>
 
@@ -418,7 +431,7 @@
                       @click="handleAddMkCmCustomersResponsiblePerson">添加
                     </el-button>
                     <el-button type="danger" icon="el-icon-delete" size="mini"
-                      @click="handleDeleteMkCmCustomersResponsiblePerson">
+                      @click="handleDeleteTab('1')">
                       删除
                     </el-button>
                   </el-col>
@@ -469,7 +482,7 @@
                       添加
                     </el-button>
                     <el-button type="danger" icon="el-icon-delete" size="mini"
-                      @click="handleDeleteMkCmCustomersDepartment">
+                      @click="handleDeleteTab('2')">
                       删除
                     </el-button>
                   </el-col>
@@ -478,7 +491,12 @@
                   @selection-change="handleMkCmCustomersDepartmentSelectionChange" ref="mkCmCustomersDepartment">
                   <el-table-column type="selection" width="55" align="center" />
                   <el-table-column type="index" label="序号" min-width="50" align="center" />
-                  <el-table-column label="科室名称" align="center" prop="name" min-width="150" />
+                  <el-table-column label="科室名称" align="center" prop="name" min-width="150">
+                    <template slot-scope="scope">
+                      <dict-tag :options="dict.type.mk_bo_section" :value="scope.row.name"
+                        show-overflow-tooltip />
+                    </template>
+                  </el-table-column>
                   <el-table-column label="客户名称" align="center" prop="customersName" min-width="150" />
                   <el-table-column label="负责人姓名" align="center" prop="responsiblePersonName" min-width="150" />
                   <el-table-column label="联系人手机" align="center" prop="phone" min-width="150" />
@@ -510,7 +528,7 @@
         </el-form>
       </div>
     </div>
-    <AddContact v-model="isAdd0" v-if="isAdd0" :operatingState="operatingSta" :state="state" :customersId="form.id"
+    <AddContact v-model="isAdd0" v-if="isAdd0" :operatingState="operatingSta" :state="state" :row="rowDetail" :customersId="form.id"
       :customersName="form.name" />
 
     <AddPerson v-model="isAdd1" v-if="isAdd1" :pageStu="page" :disable="disable" :row="rowDetail" :customersId="form.id"
@@ -561,7 +579,7 @@
     },
     dicts: ['mk_cm_yes_no', 'mk_cm_classification', 'mk_cm_type', 'mk_cm_category', 'mk_cm_channel',
       'mk_cm_business_type', 'mk_cm_industry', 'mk_cm_tax_type', 'mk_cm_enterprise_type', 'mk_cm_relationship_type',
-      'mk_cm_production_line'
+      'mk_cm_production_line', 'mk_bo_section', 'sys_user_sex', 'mk_bo_position', 'mk_bo_power', 'mk_bo_contact_state'
     ],
     data() {
       return {
@@ -833,7 +851,12 @@
       },
       /** Add查看按钮操作 */
       handleCheckAdd(row, type) {
-        if (type == '1') {
+        if (type == '0') {
+          this.isAdd0 = true;
+          this.operatingSta = 'Browse';
+          this.rowDetail = row;
+          this.disable = true;
+        } else if (type == '1') {
           this.isAdd1 = true;
           this.page = 'check';
           this.rowDetail = row;
@@ -860,7 +883,12 @@
       },
       /** Add修改按钮操作 */
       handleUpdateAdd(row, type) {
-        if (type == '1') {
+        if (type == '0') {
+          this.isAdd0 = true;
+          this.operatingSta = 'Update';
+          this.rowDetail = row;
+          this.disable = false;
+        } else if (type == '1') {
           this.isAdd1 = true;
           this.page = 'update';
           this.rowDetail = row;
@@ -914,9 +942,20 @@
       },
       /** Add删除按钮操作 */
       handleDeleteAdd(row, type) {
-        const ids = row.id || this.ids;
-        if (type == '1') {
-          this.$modal.confirm('是否确认删除人员姓名为"' + row.personName + '"的数据项?').then(function () {
+        let ids = [];
+        ids[0] = row.id;
+        if (type == '0') {
+          console.log(row, 'row')
+          this.$modal.confirm('是否确认删除序号为"' + row.index + '"的数据项?').then(function () {
+            return delContact(ids);
+          }).then(() => {
+            getContactInfo(this.form.id).then(res => {
+              this.mkCmCustomersContactList = res.data;
+            })
+            this.$modal.msgSuccess("删除成功");
+          }).catch(() => {});
+        } else if (type == '1') {
+          this.$modal.confirm('是否确认删除序号为"' + row.index + '"的数据项?').then(function () {
             return delCustomersResponsiblePerson(ids);
           }).then(() => {
             getCustomers(row.customersId).then(res => {
@@ -925,7 +964,7 @@
             this.$modal.msgSuccess("删除成功");
           }).catch(() => {});
         } else if (type == '2') {
-          this.$modal.confirm('是否确认删除科室名称为"' + row.name + '"的数据项?').then(function () {
+          this.$modal.confirm('是否确认删除序号为"' + row.index + '"的数据项?').then(function () {
             return delCustomersDepartment(ids);
           }).then(() => {
             getCustomers(row.customersId).then(res => {
@@ -978,52 +1017,50 @@
         this.page = 'add';
         this.disable = false;
       },
-      /** 客户联系人删除按钮操作 */
-      handleDeleteMkCmCustomersContact() {
+      /** 客户页签删除按钮操作 */
+      handleDeleteTab(type) {
         let that = this;
-        if (that.checkedMkCmCustomersContact.length == 0) {
-          that.$modal.msgError("请先选择要删除的客户联系人数据");
-        } else {
-          that.$modal.confirm('是否确认删除序号为"' + that.checkedMkCmCustomersContact + '"的数据项?').then(function () {
-            return delContact(that.checkedMkCmCustomersContactIds);
-          }).then(() => {
-            getContactInfo(that.form.id).then(res => {
-              that.mkCmCustomersContactList = res.data;
-            })
-            that.$modal.msgSuccess("删除成功");
-          }).catch((e) => {
-            console.log(e, 'e');
-          });
-        }
-      },
-      /** 客户负责人删除按钮操作 */
-      handleDeleteMkCmCustomersResponsiblePerson() {
-        if (this.checkedMkCmCustomersResponsiblePerson.length == 0) {
-          this.$modal.msgError("请先选择要删除的客户负责人数据");
-        } else {
-          this.$modal.confirm('是否确认删除序号为"' + this.checkedMkCmCustomersResponsiblePerson + '"的数据项?').then(function () {
-            return delCustomersResponsiblePerson(this.checkedMkCmCustomersResponsiblePersonIds);
-          }).then(() => {
-            getCustomers(this.form.id).then(res => {
-              this.mkCmCustomersResponsiblePersonList = res.data.mkCmCustomersResponsiblePersonList;
-            })
-            this.$modal.msgSuccess("删除成功");
-          }).catch(() => {});
-        }
-      },
-      /** 客户科室删除按钮操作 */
-      handleDeleteMkCmCustomersDepartment() {
-        if (this.checkedMkCmCustomersDepartment.length == 0) {
-          this.$modal.msgError("请先选择要删除的客户科室数据");
-        } else {
-          this.$modal.confirm('是否确认删除序号为"' + this.checkedMkCmCustomersDepartment + '"的数据项?').then(function () {
-            return delCustomersDepartment(this.checkedMkCmCustomersDepartmentIds);
-          }).then(() => {
-            getCustomers(this.form.id).then(res => {
-              this.mkCmCustomersDepartmentList = res.data.mkCmCustomersDepartmentList;
-            })
-            this.$modal.msgSuccess("删除成功");
-          }).catch(() => {});
+        if (type == '0') {
+          if (that.checkedMkCmCustomersContact.length == 0) {
+            that.$modal.msgError("请先选择要删除的客户联系人数据");
+          } else {
+            that.$modal.confirm('是否确认删除序号为"' + that.checkedMkCmCustomersContact + '"的数据项?').then(function () {
+              return delContact(that.checkedMkCmCustomersContactIds);
+            }).then(() => {
+              getContactInfo(that.form.id).then(res => {
+                that.mkCmCustomersContactList = res.data;
+              })
+              that.$modal.msgSuccess("删除成功");
+            }).catch((e) => {
+              console.log(e, 'e');
+            });
+          }
+        } else if (type == '1') {
+          if (that.checkedMkCmCustomersResponsiblePerson.length == 0) {
+            that.$modal.msgError("请先选择要删除的客户负责人数据");
+          } else {
+            that.$modal.confirm('是否确认删除序号为"' + that.checkedMkCmCustomersResponsiblePerson + '"的数据项?').then(function () {
+              return delCustomersResponsiblePerson(that.checkedMkCmCustomersResponsiblePersonIds);
+            }).then(() => {
+              getCustomers(that.form.id).then(res => {
+                that.mkCmCustomersResponsiblePersonList = res.data.mkCmCustomersResponsiblePersonList;
+              })
+              that.$modal.msgSuccess("删除成功");
+            }).catch(() => {});
+          }
+        } else if (type == '2') {
+          if (that.checkedMkCmCustomersDepartment.length == 0) {
+            that.$modal.msgError("请先选择要删除的客户科室数据");
+          } else {
+            that.$modal.confirm('是否确认删除序号为"' + that.checkedMkCmCustomersDepartment + '"的数据项?').then(function () {
+              return delCustomersDepartment(that.checkedMkCmCustomersDepartmentIds);
+            }).then(() => {
+              getCustomers(that.form.id).then(res => {
+                that.mkCmCustomersDepartmentList = res.data.mkCmCustomersDepartmentList;
+              })
+              that.$modal.msgSuccess("删除成功");
+            }).catch(() => {});
+          }
         }
       },
       /** 复选框选中数据 */

+ 9 - 28
src/views/business/spd/cm/customersContact/index.vue

@@ -183,10 +183,10 @@
       </el-row>
       <el-tabs v-model="activeName" v-if="this.operatingState != 'Insert'">
         <el-tab-pane label="学历信息" name="first">
-          <EducationList :key="timer" :supForm="this.form" />
+          <EducationList :key="timer" :supForm="this.row" />
         </el-tab-pane>
         <el-tab-pane label="社会关系" name="second">
-          <RelationshipList :key="timer" :supForm="this.form" />
+          <RelationshipList :key="timer" :supForm="this.row" />
         </el-tab-pane>
       </el-tabs>
       <div class="md-auditInfo">
@@ -348,17 +348,14 @@
         submitButtonEditStatus: false,
       };
     },
-    created() {},
+    created() {
+      if (this.operatingState == 'Browse') {
+        this.handleBrowse(this.row);
+      } else if (this.operatingState == 'Update') {
+        this.handleUpdate(this.row);
+      }
+    },
     methods: {
-      /** 查询联系人管理列表 */
-      getList() {
-        this.loading = true;
-        listContact(this.queryParams).then(response => {
-          this.contactList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        });
-      },
       // 取消按钮
       cancel() {
         this.$emit('jugislist', false);
@@ -403,12 +400,6 @@
         };
         this.resetForm("form");
       },
-      /** 新增按钮操作 */
-      handleAdd() {
-        this.operatingState = "Insert";
-        this.reset();
-        this.form.state = '1';
-      },
       /** 修改按钮操作 */
       handleUpdate(row) {
         this.operatingState = "Update";
@@ -453,16 +444,6 @@
           }
         });
       },
-      /** 删除按钮操作 */
-      handleDelete(row) {
-        const ids = []
-        ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除联系人管理编号为"' + ids + '"的数据项?').then(function () {
-          return delContact(ids);
-        }).then(() => {
-          this.$modal.msgSuccess("删除成功");
-        }).catch(() => {});
-      },
       additionalCondition() {
         return {
           parame: {