فهرست منبع

1.新增评估人员可在流程中修改订单基础信息
2.修改项目参与人时可修改接单部门
3.订单编辑逻辑优化

GouGengquan 1 سال پیش
والد
کامیت
56d7a2af32
4فایلهای تغییر یافته به همراه167 افزوده شده و 92 حذف شده
  1. 4 0
      src/api/modules/assets.js
  2. 23 12
      src/views/assets/addAssetsOrder.vue
  3. 139 79
      src/views/assets/orderDetail.vue
  4. 1 1
      src/views/assets/todoList.vue

+ 4 - 0
src/api/modules/assets.js

@@ -157,5 +157,9 @@ export default {
     // 产品标记送达
     markDelivery(params){
         return request.put(`assetsProduction/markDelivery/${params}`)
+    },
+    // 更新资产订单基本信息
+    updateOrderBaseInfo(params){
+        return request.put(`assets/updateOrderBaseInfo/`,params)
     }
 }

+ 23 - 12
src/views/assets/addAssetsOrder.vue

@@ -1036,8 +1036,8 @@ export default {
             this.$api.assets.getAssetsDetailById(id).then(res => {
                 if (res.code === 200) {
                     this.assetsForm = res.data;
-                    this.assetsForm.clientManagerId=this.$store.getters.userInfo.id;
-                    this.assetsForm.clientManager=this.$store.getters.userInfo.name;
+                    this.assetsForm.clientManagerId = this.$store.getters.userInfo.id;
+                    this.assetsForm.clientManager = this.$store.getters.userInfo.name;
                     if (this.assetsForm.clienteleType === "企业") {
                         this.getCustomerCompany(0);
                         this.itemHideStatus = true;
@@ -1154,16 +1154,27 @@ export default {
         },
         // 更新订单
         updateOrder() {
-            this.$api.assets.update(this.assetsForm).then(res => {
-                if (res.code === 200) {
-                    this.$notify({
-                        title: '成功',
-                        message: '订单更新成功',
-                        type: 'success',
-                        duration: 2000
-                    });
-                }
-            })
+            this.$confirm('是否确定要修改订单信息?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.$api.assets.update(this.assetsForm).then(res => {
+                    if (res.code === 200) {
+                        this.$notify({
+                            title: '成功',
+                            message: '订单更新成功',
+                            type: 'success',
+                            duration: 2000
+                        });
+                    }
+                })
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '已取消更新'
+                });
+            });
         }
 
     }

+ 139 - 79
src/views/assets/orderDetail.vue

@@ -46,6 +46,11 @@
           <el-form ref="assetsForm" :model="assetsForm" :rules="assetsFormRules" :disabled="disabledStatus">
             <div class="createMajor-main-container">
               <div class="postInfo-container">
+                <el-row class="row-style" style="margin-top: 20px; float: right; position: relative; z-index: 2;">
+                  <el-col :xs="24" :sm="12" :lg="23" :span="12">
+                    <el-button type="danger" @click="updateOrderBaseInfo()" round>更新基本信息</el-button>
+                  </el-col>
+                </el-row>
                 <div>
                   <el-divider content-position="left">
                     <h3 class="title">
@@ -63,7 +68,7 @@
                   </el-col>
                   <el-col :xs="24" :sm="12" :lg="4" :span="6">
                     <el-form-item label="接单部门:" prop="departmentId" label-width="120px" class="postInfo-container-item">
-                      <el-select v-model="assetsForm.departmentId">
+                      <el-select v-model="assetsForm.departmentId" readonly disabled>
                         <el-option v-for="(d, id) in allotDepartment" :label="d.name" :value="d.id"
                           :key="d.id"></el-option>
                       </el-select>
@@ -98,7 +103,7 @@
                   <el-col :xs="24" :sm="12" :lg="6" :span="6">
                     <el-form-item label="客户类型:" prop="clienteleType" label-width="120px" class="postInfo-container-item">
                       <el-select v-model="assetsForm.clienteleType" placeholder="请选择"
-                        @change="changeCustomerType(assetsForm.clienteleType)">
+                        @change="changeCustomerType(assetsForm.clienteleType)" readonly disabled>
                         <el-option label="企业" value="企业"></el-option>
                         <el-option label="个人" value="个人"></el-option>
                       </el-select>
@@ -108,7 +113,7 @@
                     <el-form-item label="客户名称:" prop="clienteleId" label-width="120px" class="postInfo-container-item"
                       v-if="itemHideStatus">
                       <el-select v-model="assetsForm.clienteleId" placeholder="请选择(可搜索)" @change="findSubClientele(0)"
-                        clearable filterable>
+                        clearable filterable readonly disabled>
                         <el-option v-for="(c, id) in customerCompany" :label="c.name" :value="c.id"
                           :key="c.id"></el-option>
                       </el-select>
@@ -118,7 +123,7 @@
                     <el-form-item label="业务来源:" prop="clienteleSubId" label-width="120px" class="postInfo-container-item"
                       v-if="itemHideStatus">
                       <el-select v-model="assetsForm.clienteleSubId" placeholder="请选择(可搜索)" @change="getCustomerContract"
-                        clearable filterable>
+                        clearable filterable readonly disabled>
                         <el-option v-for="(s, id) in subCustomerCompany" :label="s.name" :value="s.id"
                           :key="s.id"></el-option>
                       </el-select>
@@ -131,7 +136,7 @@
                       class="postInfo-container-item">
                       <div>
                         <el-select v-model="assetsForm.clienteleContactId" placeholder="请选择(可搜索)" clearable filterable
-                          @change="getContactInfo();" style="width:60%">
+                          @change="getContactInfo();" style="width:60%" readonly disabled>
                           <!-- <el-option v-for="(c, id) in customerContract" :label="c.name" :value="c.id"
                             :key="c.id"></el-option> -->
                           <el-option :label="linkmanInfo.name" :value="linkmanInfo.id" :key="linkmanInfo.id"></el-option>
@@ -228,7 +233,8 @@
                   <el-col :xs="24" :sm="12" :lg="6" :span="6">
                     <el-form-item label="终端客户类型:" prop="terminalClienteleType" label-width="140px"
                       class="postInfo-container-item">
-                      <el-select v-model="assetsForm.terminalClienteleType" placeholder="请选择" style="width:205px">
+                      <el-select v-model="assetsForm.terminalClienteleType" placeholder="请选择" style="width:205px" readonly
+                        disabled>
                         <el-option label="企业" value="企业"></el-option>
                         <el-option label="个人" value="个人"></el-option>
                       </el-select>
@@ -238,14 +244,14 @@
                     <el-form-item label="终端客户名称:" prop="terminalClienteleId" label-width="140px"
                       class="postInfo-container-item">
                       <!-- <div v-if="couldEdit"> -->
-                        <el-select v-model="assetsForm.terminalClienteleId" placeholder="请选择(可搜索)"
-                          @change="findSubClientele(1)" clearable filterable style="width:80%">
-                          <!-- <el-option v-for="(c, id) in tCustomerCompany" :label="c.name" :value="c.id"
+                      <el-select v-model="assetsForm.terminalClienteleId" placeholder="请选择(可搜索)"
+                        @change="findSubClientele(1)" clearable filterable style="width:80%" readonly disabled>
+                        <!-- <el-option v-for="(c, id) in tCustomerCompany" :label="c.name" :value="c.id"
                             :key="c.id"></el-option> -->
-                            <el-option  :label="tCustomerInfo.name" :value="tCustomerInfo.id"
-                            :key="tCustomerInfo.id"></el-option>
-                        </el-select>
-                        <!-- <el-tooltip class="item" effect="dark" content="没有终端客户?点击新增" placement="top-end">
+                        <el-option :label="tCustomerInfo.name" :value="tCustomerInfo.id"
+                          :key="tCustomerInfo.id"></el-option>
+                      </el-select>
+                      <!-- <el-tooltip class="item" effect="dark" content="没有终端客户?点击新增" placement="top-end">
                           <span style="margin-left:5%;color:RGB(64,158,255);cursor:pointer"
                             @click="createTerminalClient()">新增</span>
                         </el-tooltip> -->
@@ -259,10 +265,10 @@
                       class="postInfo-container-item">
                       <div v-if="couldEdit">
                         <el-select v-model="assetsForm.terminalClienteleContactId" placeholder="请选择(可搜索)" clearable
-                          filterable @change="" style="width:80%">
+                          filterable @change="" style="width:80%" readonly disabled>
                           <!-- <el-option v-for="(c, id) in tCustomerContract" :label="c.name" :value="c.id"
                             :key="c.id"></el-option> -->
-                            <el-option  :label="tLinkmanInfo.name" :value="tLinkmanInfo.id"
+                          <el-option :label="tLinkmanInfo.name" :value="tLinkmanInfo.id"
                             :key="tLinkmanInfo.id"></el-option>
                         </el-select>
                         <!-- <el-tooltip class="item" effect="dark" content="没有联系人?点击新增" placement="top-end">
@@ -296,54 +302,69 @@
       </el-tab-pane>
       <el-tab-pane name="members" class="pane-class" :lazy=true>
         <span slot="label"><i class="el-icon-document"></i>项目人员</span>
-        <y-detail-page-layout @save="updatePrincipalAndMembers" ref="addAssetsOrder" name="assets"
-          :editStatus="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'">
-          <el-form ref="assetsForm" :model="assetsForm" :rules="assetsFormRules"
-            :disabled="currentNode.nodeCode !== 'DEPARTMENT_ALLOCATION'">
-            <div class="createMajor-main-container">
-              <div class="postInfo-container">
-                <div style="margin-top: 35px;">
-                  <el-divider content-position="left">
-                    <h3 class="title">
-                      <div class="avatar-wrapper icon-title">成员</div>
-                      <div class="icon-info">项目成员</div>
-                    </h3>
-                  </el-divider>
-                </div>
-                <el-row class="row-style">
-                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
-                    <el-form-item label="项目负责人:" prop="principalId" label-width="120px"
-                      :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']"
-                      :rules="{ required: true, message: '项目负责人不能为空', trigger: 'blur' }">
-                      <el-select v-model="assetsForm.principalId" placeholder="请选择"
-                        :filterable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
-                        :clearable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
-                        :readonly="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'"
-                        :disabled="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'">
-                        <el-option v-for="(p, id) in principals" :label="p.name" :value="p.id" :key="p.id"></el-option>
-                      </el-select>
-                    </el-form-item>
-                  </el-col>
-                </el-row>
-                <el-row class="row-style">
-                  <el-col :xs="24" :sm="12" :lg="3" :span="6">
-                    <el-form-item label="项目成员:" prop="members" label-width="120px"
-                      :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']"
-                      :rules="{ required: true, message: '项目成员不能为空', trigger: 'blur' }">
-                      <el-select v-model="assetsForm.members" placeholder="请选择" multiple style=" width: 686px"
-                        :filterable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
-                        :clearable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
-                        :readonly="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'"
-                        :disabled="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'">
-                        <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id" :key="u.id"></el-option>
-                      </el-select>
-                    </el-form-item>
-                  </el-col>
-                </el-row>
+        <!-- <y-detail-page-layout @save="updatePrincipalAndMembers" ref="addAssetsOrder" name="assets"
+          :editStatus="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' || !disabledStatus"> -->
+        <el-form ref="assetsForm" :model="assetsForm" :rules="assetsFormRules"
+          :disabled="currentNode.nodeCode !== 'DEPARTMENT_ALLOCATION' || disabledStatus">
+          <div class="createMajor-main-container">
+            <div class="postInfo-container">
+              <div style="margin-top: 35px;">
+                <el-divider content-position="left">
+                  <h3 class="title">
+                    <div class="avatar-wrapper icon-title">成员</div>
+                    <div class="icon-info">项目成员</div>
+                  </h3>
+                </el-divider>
               </div>
+              <el-row class="row-style">
+                <el-col :xs="24" :sm="12" :lg="4" :span="6">
+                  <el-form-item label="接单部门:" prop="departmentId" label-width="120px"
+                    :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']">
+                    <el-select @change="getPrincipalByAllotDepartment()" v-model="assetsForm.departmentId">
+                      <el-option v-for="(d, id) in allotDepartment" :label="d.name" :value="d.id" :key="d.id"></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row class="row-style">
+                <el-col :xs="24" :sm="12" :lg="6" :span="6">
+                  <el-form-item label="项目负责人:" prop="principalId" label-width="120px"
+                    :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']"
+                    :rules="{ required: true, message: '项目负责人不能为空', trigger: 'blur' }">
+                    <el-select v-model="assetsForm.principalId" placeholder="请选择(可搜索)"
+                      :filterable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
+                      :clearable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
+                      :readonly="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'"
+                      :disabled="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'">
+                      <el-option v-for="(p, id) in principals" :label="p.name" :value="p.id" :key="p.id"></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row class="row-style">
+                <el-col :xs="24" :sm="12" :lg="3" :span="6">
+                  <el-form-item label="项目成员:" prop="members" label-width="120px"
+                    :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']"
+                    :rules="{ required: true, message: '项目成员不能为空', trigger: 'blur' }">
+                    <el-select v-model="assetsForm.members" placeholder="请选择(可搜索)" multiple style=" width: 686px"
+                      :filterable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
+                      :clearable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
+                      :readonly="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'"
+                      :disabled="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'">
+                      <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id" :key="u.id"></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row class="row-style">
+                <el-col :xs="24" :sm="12" :lg="3" :span="6">
+                  <el-button type="danger" @click="updatePrincipalAndMembers()" round>保存项目人员信息</el-button>
+                </el-col>
+              </el-row>
             </div>
-          </el-form>
-        </y-detail-page-layout>
+          </div>
+        </el-form>
+        <!-- </y-detail-page-layout> -->
       </el-tab-pane>
       <el-tab-pane name="target" class="pane-class" :lazy=true>
         <span @click="getAETargetListByAssetsId()" slot="label"><i class="el-icon-document"></i>资产评估对象</span>
@@ -1930,7 +1951,6 @@ export default {
           this.getAllUser();
         }
       })
-      console.log(this.assetsForm);
     },
     handleChange() {
 
@@ -2225,19 +2245,30 @@ export default {
       let assetsPrincipalMembers = new Object();
       assetsPrincipalMembers.id = this.assetsForm.id;
       assetsPrincipalMembers.principalId = this.assetsForm.principalId;
+      assetsPrincipalMembers.departmentId = this.assetsForm.departmentId;
       assetsPrincipalMembers.members = JSON.stringify(this.assetsForm.members);
       this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
       this.taskRecordDTO.taskData = assetsPrincipalMembers;
-      this.$api.assets.updatePrincipalAndMembers(this.taskRecordDTO).then(res => {
-        if (res.code === 200 && res.data) {
-          this.$notify({
-            title: '成功',
-            message: '保存成功,请提交节点继续流程。',
-            type: 'success',
-            duration: 2000
-          });
-        }
-      })
+      if (assetsPrincipalMembers.id && assetsPrincipalMembers.principalId && assetsPrincipalMembers.departmentId && this.assetsForm.members.length > 0) {
+        this.$api.assets.updatePrincipalAndMembers(this.taskRecordDTO).then(res => {
+          if (res.code === 200 && res.data) {
+            this.$notify({
+              title: '成功',
+              message: '保存成功,请提交节点继续流程。',
+              type: 'success',
+              duration: 2000
+            });
+          }
+        })
+      } else {
+        this.$notify({
+          title: '警告',
+          message: '请先完善项目负责人与项目成员信息!',
+          type: 'error',
+          duration: 2000
+        });
+      }
+
     },
     // 根据节点返回不同的操作按钮信息
     hanlderType() {
@@ -2660,7 +2691,6 @@ export default {
       this.takeAssetsProductionNoDTO.hasNotTakeNumTargetSelect = notTakeNumTargetSelect.some(target => target.statementNo === null || target.statementNo === '');
 
       this.takeAssetsProductionNoDTO.businessId = this.assetsForm.id;
-      console.log(this.nodeBusinessInfo.production);
       // this.getProductionByBusinessId(this.assetsForm.id);
       // this.takeAssetsProductionNoDTO.productionType = this.assetsProductionForm.productionType;
       // this.takeAssetsProductionNoDTO.productionType = this.nodeBusinessInfo.production[this.nodeBusinessInfo.production.length - 1];
@@ -2780,11 +2810,8 @@ export default {
     },
     // 资产撰写产品(意见书和报告都是这个接口)
     writeAssetsProduction() {
-      console.log("in function")
       this.$refs.assetsProductionForm.validate(valid => {
-        console.log(valid)
         if (valid) {
-          console.log("in valid")
           this.assetsProductionForm.filePath = JSON.stringify(this.assetsProductionForm.filePath);
           if (this.assetsProductionForm.signatory !== null) {
             this.assetsProductionForm.signatory = JSON.stringify(this.assetsProductionForm.signatory);
@@ -3211,7 +3238,6 @@ export default {
       this.assetsAchievementRatioDialogVisible = true;
       // this.getPerformanceDistributionList();
 
-      // console.log(this.businessPerformanceDistributionForm.distributionList);
       // if (this.businessPerformanceDistributionForm.distributionList !== null && this.businessPerformanceDistributionForm.distributionList[0].id !== null) {
       //   this.showDistributionButton = false;
       // } else {
@@ -3337,9 +3363,8 @@ export default {
       if (this.assetsForm.terminalClienteleContactId) {
         this.$api.customerLinkman.detail(this.assetsForm.terminalClienteleContactId).then(res => {
           if (res.code === 200) {
-            this.tLinkmanInfo = res.data;mobile
+            this.tLinkmanInfo = res.data; mobile
             this.assetsForm.tmobile = this.tLinkmanInfo.mobile;
-            console.log(this.tLinkmanInfo);
           }
         })
       }
@@ -3351,6 +3376,41 @@ export default {
           }
         })
       }
+    },
+    // 更新资产订单基本信息
+    updateOrderBaseInfo() {
+      this.$confirm('是否确定要修改订单基本信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if(this.assetsForm.members){
+          this.assetsForm.members = JSON.stringify(this.assetsForm.members);
+        }
+        this.$api.assets.updateOrderBaseInfo(this.assetsForm).then(res => {
+          if (res.code === 200 && res.data) {
+            this.$notify({
+              title: '成功',
+              message: '订单基本信息更新成功!',
+              type: 'success',
+              duration: 3000
+            });
+            this.getAssetsDetailById(this.pageParams.row.assetsId);
+          } else {
+            this.$notify({
+              title: '失败',
+              message: '订单基本信息更新失败!请稍后重试!',
+              type: 'warning',
+              duration: 3000
+            });
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      });
     }
   }
 

+ 1 - 1
src/views/assets/todoList.vue

@@ -233,7 +233,7 @@ export default {
                         back: '/assets/todoList',
                         couldEdit: true,
                         couldBack: true,
-                        disabledStatus: true
+                        disabledStatus: false
                     }
                 })
             }