Browse Source

营销-SPD-商机:解决无法新增商机问题;各页面增加查看功能;

001295 2 years ago
parent
commit
51b4b57f93

+ 20 - 3
src/views/business/spd/bo/basic/index.vue

@@ -168,7 +168,7 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-view"
+            icon="el-icon-search"
             @click="enterDetails(scope.row)"
           >进入详情</el-button>
           <el-button
@@ -180,6 +180,12 @@
           <el-button
             size="mini"
             type="text"
+            icon="el-icon-view"
+            @click="handleBrowse(scope.row)"
+          >查看</el-button>
+          <el-button
+            size="mini"
+            type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
           >删除</el-button>
@@ -197,7 +203,7 @@
 
     <!-- 添加或修改商机基础信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.form.winningState != 0">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.form.winningState > 0 || this.operatingState == 'Browse'">
         <el-divider content-position="left">
           <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
         </el-divider>
@@ -317,7 +323,7 @@
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -583,6 +589,17 @@ export default {
         this.title = "修改商机基础信息";
       });
     },
+    /** 查看按钮操作 */
+    handleBrowse(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getBasic(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.operatingState = "Browse";
+        this.title = "基础信息";
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {

+ 23 - 2
src/views/business/spd/bo/behavior/behaviorList.vue

@@ -85,6 +85,12 @@
           <el-button
             size="mini"
             type="text"
+            icon="el-icon-view"
+            @click="handleBrowse(scope.row)"
+          >查看</el-button>
+          <el-button
+            size="mini"
+            type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
           >删除</el-button>
@@ -102,7 +108,7 @@
 
     <!-- 添加或修改行动对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.operatingState == 'Browse'">
         <el-divider content-position="left">
           <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
         </el-divider>
@@ -265,7 +271,7 @@
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -362,6 +368,8 @@ export default {
           { required: true, message: "拜访效果不能为空", trigger: "blur" }
         ],
       },
+      //当前操作状态
+      operatingState: '',
     };
   },
   created() {
@@ -454,6 +462,7 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
+      this.operatingState = "Insert";
       //新增行动设置默认值
       if(this.source == 'BoDetails'){
         this.queryParams.bo = this.bo.id;
@@ -485,6 +494,7 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
+      this.operatingState = "Update";
       const id = row.id || this.ids
       getBehavior(id).then(response => {
         this.form = response.data;
@@ -493,6 +503,17 @@ export default {
       });
       this.getPictureList(); 
     },
+    /** 查看按钮操作 */
+    handleBrowse(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getBehavior(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.operatingState = "Browse";
+        this.title = "基础信息";
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {

+ 19 - 2
src/views/business/spd/bo/contact/contactList.vue

@@ -113,6 +113,12 @@
           <el-button
             size="mini"
             type="text"
+            icon="el-icon-view"
+            @click="handleBrowse(scope.row)"
+          >查看</el-button>
+          <el-button
+            size="mini"
+            type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
           >删除</el-button>
@@ -130,7 +136,7 @@
 
     <!-- 添加或修改联系人管理对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.operatingState == 'Browse'">
         <el-divider content-position="left">
           <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
         </el-divider>
@@ -383,7 +389,7 @@
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -602,6 +608,17 @@ export default {
         this.timer = new Date().getTime();
       });
     },
+    /** 查看按钮操作 */
+    handleBrowse(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getContact(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.operatingState = "Browse";
+        this.title = "基础信息";
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {

+ 19 - 2
src/views/business/spd/bo/task/taskList.vue

@@ -76,6 +76,12 @@
           <el-button
             size="mini"
             type="text"
+            icon="el-icon-view"
+            @click="handleBrowse(scope.row)"
+          >查看</el-button>
+          <el-button
+            size="mini"
+            type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
           >删除</el-button>
@@ -93,7 +99,7 @@
 
     <!-- 添加或修改任务对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.operatingState == 'Browse'">
         <el-row>
           <el-col :span="8">
             <el-form-item label="商机名称" prop="boName">
@@ -250,7 +256,7 @@
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -488,6 +494,17 @@ export default {
         this.timer = new Date().getTime();
       });
     },
+    /** 查看按钮操作 */
+    handleBrowse(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getTask(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.operatingState = "Browse";
+        this.title = "基础信息";
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {