瀏覽代碼

修改bug

qukaidi 3 年之前
父節點
當前提交
c995ec58c4

+ 68 - 139
src/views/basicData/customerInformation/index.vue

@@ -6,78 +6,32 @@
           <div class="box">
             <el-scrollbar>
               <basic-container>
-                <avue-tree
-                    :option="treeOption"
-                    :data="treeData"
-                    @node-click="nodeClick"
-                />
+                <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
               </basic-container>
             </el-scrollbar>
           </div>
         </el-col>
         <el-col :span="19">
           <basic-container class="page-crad">
-            <avue-crud
-                :option="option"
-                :data="dataList"
-                ref="crud"
-                v-model="form"
-                :page.sync="page"
-                @row-del="rowDel"
-                @row-update="rowUpdate"
-                :before-open="beforeOpen"
-                :before-close="beforeClose"
-                @row-save="rowSave"
-                :search.sync="search"
-                @search-change="searchChange"
-                @search-reset="searchReset"
-                @selection-change="selectionChange"
-                @current-change="currentChange"
-                @size-change="sizeChange"
-                @refresh-change="refreshChange"
-                @saveColumn="saveColumn"
-                @resetColumn="resetColumn"
-                @on-load="onLoad"
-                @tree-load="treeLoad"
-                @search-criteria-switch="searchCriteriaSwitch"
-            >
+            <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" @row-del="rowDel"
+              @row-update="rowUpdate" :before-open="beforeOpen" :before-close="beforeClose" @row-save="rowSave"
+              :search.sync="search" @search-change="searchChange" @search-reset="searchReset"
+              @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+              @refresh-change="refreshChange" @saveColumn="saveColumn" @resetColumn="resetColumn" @on-load="onLoad"
+              @tree-load="treeLoad" @search-criteria-switch="searchCriteriaSwitch">
               <template slot="menuLeft">
-                <el-button
-                    type="primary"
-                    size="small"
-                    icon="el-icon-bottom"
-                    @click="excelBox = true"
-                >导入
+                <el-button type="primary" size="small" icon="el-icon-bottom" @click="excelBox = true">导入
                 </el-button>
-                <el-button
-                    icon="el-icon-printer"
-                    size="small"
-                    type="primary"
-                    @click.stop="openReport()"
-                >报表打印
+                <el-button icon="el-icon-printer" size="small" type="primary" @click.stop="openReport()">报表打印
                 </el-button>
               </template>
               <template slot-scope="scope" slot="menu">
-                <el-button
-                    type="text"
-                    icon="el-icon-view"
-                    size="small"
-                    @click.stop="editOpen(scope.row, 1)"
-                >查看
+                <el-button type="text" icon="el-icon-view" size="small" @click.stop="editOpen(scope.row, 1)">查看
                 </el-button>
-                <el-button
-                    type="text"
-                    icon="el-icon-edit"
-                    size="small"
-                    @click.stop="editOpen(scope.row, 1)"
-                >编辑
+                <el-button type="text" icon="el-icon-edit" size="small" @click.stop="editOpen(scope.row, 1)">编辑
                 </el-button>
-                <el-button
-                    type="text"
-                    icon="el-icon-delete"
-                    size="small"
-                    @click.stop="rowDel(scope.row, scope.index)"
-                >删除
+                <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(scope.row, scope.index)">
+                  删除
                 </el-button>
               </template>
               <template slot="adminProfiles" slot-scope="{ row }">
@@ -87,34 +41,14 @@
                 <span>{{ row.belongCompany }}</span>
               </template>
             </avue-crud>
-            <report-dialog
-                :switchDialog="switchDialog"
-                reportName="客户资料-客户资料"
-                @onClose="onClose()"
-                v-if="$store.getters.userInfo.tenant_id == '096359'"
-            ></report-dialog>
-            <report-dialog
-                :switchDialog="switchDialog"
-                reportName="客户信息"
-                corpType="KH"
-                @onClose="onClose()"
-                v-else
-            ></report-dialog>
-            <el-dialog
-                title="导入客户"
-                append-to-body
-                :visible.sync="excelBox"
-                width="555px"
-                :close-on-click-modal="false"
-                v-dialog-drag
-            >
-              <avue-form
-                  :option="excelOption"
-                  v-model="excelForm"
-                  table-loading="excelLoading"
-                  :upload-before="uploadBefore"
-                  :upload-after="uploadAfter"
-              >
+            <report-dialog :switchDialog="switchDialog" reportName="客户资料-客户资料" @onClose="onClose()"
+              v-if="$store.getters.userInfo.tenant_id == '096359'"></report-dialog>
+            <report-dialog :switchDialog="switchDialog" reportName="客户信息" corpType="KH" @onClose="onClose()" v-else>
+            </report-dialog>
+            <el-dialog title="导入客户" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+              v-dialog-drag>
+              <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
+                :upload-before="uploadBefore" :upload-after="uploadAfter">
                 <template slot="excelTemplate">
                   <el-button type="primary" @click="derivation">
                     点击下载<i class="el-icon-download el-icon--right"></i>
@@ -129,11 +63,7 @@
         </el-col>
       </el-row>
     </div>
-    <detail-page
-        @goBack="goBack"
-        :detailData="detailData"
-        v-if="!show"
-    ></detail-page>
+    <detail-page @goBack="goBack" :detailData="detailData" v-if="!show"></detail-page>
   </div>
 </template>
 
@@ -147,10 +77,10 @@ import {
   deleteDetails,
   getDeptLazyTree
 } from "@/api/basicData/customerInformation";
-import {getToken} from "@/util/auth";
+import { getToken } from "@/util/auth";
 import reportDialog from "@/components/report-dialog/main";
-import {customerParameter} from "@/enums/management-type";
-import {gainUser} from "@/api/basicData/customerInquiry";
+import { customerParameter } from "@/enums/management-type";
+import { gainUser } from "@/api/basicData/customerInquiry";
 
 export default {
   name: "customerInformation",
@@ -176,12 +106,12 @@ export default {
             corpType: customerParameter.code
           }).then(res => {
             resolve(
-                res.data.data.map(item => {
-                  return {
-                    ...item,
-                    leaf: !item.hasChildren
-                  };
-                })
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                };
+              })
             );
           });
         },
@@ -246,18 +176,18 @@ export default {
     this.option = await this.getColumnData(this.getColumnName(142), option);
     gainUser().then(res => {
       this.findObject(this.option.column, "adminProfiles").dicData =
-          res.data.data;
+        res.data.data;
     });
   },
   activated() {
-    if (this.$route.query.corpId) {
-      this.editOpen({id: this.$route.query.corpId}, 1)
+    if (this.$route.query.corpName) {
+      this.editOpen({ id: this.$route.query.corpId }, 1)
     } else if (this.$route.query.customerName) {
       this.show = false;
       this.detailData = {
         treeDeptId: this.treeDeptId
       };
-    } else {
+    } else if (this.$route.query.add) {
       this.beforeOpen()
     }
   },
@@ -272,9 +202,8 @@ export default {
   methods: {
     derivation() {
       window.open(
-          `/api/blade-client/corpsdesc/export-template?${
-              this.website.tokenHeader
-          }=${getToken()}`
+        `/api/blade-client/corpsdesc/export-template?${this.website.tokenHeader
+        }=${getToken()}`
       );
     },
     uploadBefore(file, done, loading) {
@@ -300,37 +229,37 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       })
-          .then(() => {
-            return deleteDetails({
-              id: row.id,
-              corpsTypeId: row.corpsTypeId,
-              corpType: "KH"
-            });
-          })
-          .then(() => {
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.page.currentPage = 1;
-            this.onLoad(this.page, {parentId: 0});
+        .then(() => {
+          return deleteDetails({
+            id: row.id,
+            corpsTypeId: row.corpsTypeId,
+            corpType: "KH"
           });
+        })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.page.currentPage = 1;
+          this.onLoad(this.page, { parentId: 0 });
+        });
     },
     //修改时的修改按钮点击触发
     rowUpdate(row, index, done, loading) {
       typeSave(row).then(
-          () => {
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            // 数据回调进行刷新
-            done(row);
-          },
-          error => {
-            window.console.log(error);
-            loading();
-          }
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
       );
     },
     //新增修改时保存触发
@@ -342,7 +271,7 @@ export default {
     },
     //查询全部
     initData() {
-      customerList({corpType: customerParameter.code}).then(res => {
+      customerList({ corpType: customerParameter.code }).then(res => {
         console.log(this.form);
         const column = this.findObject(this.option.column, "parentId");
         column.dicData = res.data.data.records;
@@ -402,7 +331,7 @@ export default {
     refreshChange() {
       this.onLoad(this.page);
     },
-    onLoad(page, params = {parentId: 0}) {
+    onLoad(page, params = { parentId: 0 }) {
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,
         current: page.currentPage,
@@ -443,8 +372,8 @@ export default {
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(
-          this.getColumnName(142),
-          this.option
+        this.getColumnName(142),
+        this.option
       );
       if (inSave) {
         this.$nextTick(() => {
@@ -469,7 +398,7 @@ export default {
     goBack(type) {
       this.detailData = this.$options.data().detailData;
       this.show = true;
-      if (type){
+      if (type) {
         this.$router.push({
           path: '/basicData/customerInformation/index'
         });

+ 53 - 14
src/views/saleLeads/detail.vue

@@ -38,11 +38,8 @@
             <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit">客户名称:</span>
           </template>
           <template slot-scope="{row,index}" slot="corpName">
-            <warehous-Kh
-                v-model="form.corpName"
-                :zhKey="true"
-                :disabled="disabled || approvalStatus"
-                @getCropId="getCropId"></warehous-Kh>
+            <warehous-Kh v-model="form.corpName" :zhKey="true" :disabled="disabled || approvalStatus"
+              @getCropId="getCropId"></warehous-Kh>
           </template>
           <template slot="fromUser">
             <el-select v-model="form.fromUser" filterable clearable size="small" :disabled="disabled || approvalStatus">
@@ -363,6 +360,23 @@ export default {
         this.$set(e, 'disabled', true)
       })
       this.queryData(this.detailData.check.billId);
+    } else {
+      //备注格式
+      let remark = "收入:\n" +
+        "1、业务名称:\n" +
+        "2、费用明细:\n" +
+        "3、业务负责人:\n" +
+        "4、优惠合计:\n" +
+        "5、实际收费:\n" +
+        "6、付款人:\n" +
+        "7、收款时间:\n" +
+        "8、收款人:\n" +
+        "9、收款方式:\n" +
+        "10、备注/特别说明:";
+
+      this.$nextTick(() => {
+        this.$set(this.form, "remarks", remark)
+      })
     }
   },
   filters: {
@@ -388,12 +402,28 @@ export default {
       this.checkScheduleDialog = false
     },
     khEdit() {
-      this.$router.push({
-        path: '/basicData/customerInformation/index', query: {
-          corpId: this.form.corpId,
-          corpName: this.form.corpName
-        }
-      })
+      if (this.form.corpId) {
+        this.$router.push({
+          path: '/basicData/customerInformation/index', query: {
+            corpId: this.form.corpId,
+            corpName: this.form.corpName
+          }
+        })
+      } else if (this.form.corpName) {
+        this.$router.push({
+          path: '/basicData/customerInformation/index', query: {
+            corpId: this.form.corpId,
+            corpName: this.form.corpName
+          }
+        })
+      } else {
+        this.$router.push({
+          path: '/basicData/customerInformation/index', query: {
+            add: "New"
+          }
+        })
+      }
+
     },
     // 查询
     queryData(id) {
@@ -491,8 +521,13 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
-          this.btnLoading = true;
+          for (let i = 0; i < this.dataList.length; i++) {
+            if (!this.dataList[i].spId) {
+              return this.$message.error('请完善第' + (i + 1) + '行的服务项目')
+            }
+          }
           this.$set(this.form, 'itemList', this.dataList)
+          this.btnLoading = true;
           typeSave(this.form).then(res => {
             this.$message({ type: "success", message: this.form.id ? "修改成功!" : "新增成功!" });
             this.queryData(res.data.data);
@@ -586,8 +621,12 @@ export default {
     spIdChange(row) {
       console.log(row)
       this.goodsDescList.forEach(e => {
-        row.serviceProjectName = e.cname
-        row.chargeProposal = e.remarks
+        if (row.spId == e.id) {
+          console.log(e)
+          row.serviceProjectName = e.cname
+          row.chargeProposal = e.remarks
+        }
+
       });
     },
     // 验证新旧值对比

+ 1 - 0
src/views/workManagement/main-items/detailsPage.vue

@@ -730,6 +730,7 @@ export default {
         this.goodsDescList = res.data.data
         let form = this.detailData.data
         this.form.corpId = form.corpId
+        this.form.remark=form.remarks
         // this.form.corpName = form.corpName
         form.itemList.forEach(e => {
           this.goodsDescList.forEach(item => {