yusheng 2 anni fa
parent
commit
8259e9015d

+ 10 - 0
src/api/bpm/components/saleManage/saleorder.js

@@ -85,3 +85,13 @@ export async function salesManagerApprove(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 销售员补充
+ */
+export async function salesmanApprove(data) {
+  const res = await request.put(`/bpm/quoteApprove/salesmanApprove`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 1
src/views/bpm/handleTask/components/contact/submit.vue

@@ -71,7 +71,7 @@
           status,
           taskId: this.taskId
         }).then((res) => {
-          this.$emit('handleAudit', status);
+          this.$emit('handleAudit', {status});
         });
 
         // this.dialogVisible = false;

+ 25 - 22
src/views/bpm/handleTask/components/saleOrder/addDialog.vue

@@ -14,24 +14,12 @@
       <headerTitle title="基本信息"></headerTitle>
       <el-row>
         <el-col :span="12">
-          <el-form-item
-            label="询价方名称"
-            prop="contactName"
-            style="margin-bottom: 22px"
-          >
-            <el-input
-              clearable
-              v-model="form.contactName"
-              @click.native="handParent"
-              placeholder="请输入"
-            />
-          </el-form-item>
           <el-form-item
             label="关联商机"
             prop="opportunityId"
             style="margin-bottom: 22px"
           >
-            <el-select v-model="form.opportunityId" placeholder="请选择">
+            <el-select v-model="form.opportunityId" placeholder="请选择" style="width: 100%;">
               <el-option
                 v-for="item in businessList"
                 :key="item.id"
@@ -41,12 +29,25 @@
               </el-option>
             </el-select>
           </el-form-item>
+          <el-form-item
+            label="询价方名称"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.contactName"
+              @click.native="handParent"
+              placeholder="请输入"
+            />
+          </el-form-item>
+
           <el-form-item
             label="询价方联系人"
             prop="contactLinkName"
-            style="margin-bottom: 22px"
+            style="margin-bottom: 22px" 
           >
-            <el-select
+            <el-select style="width: 100%;"
               v-model="form.contactLinkName"
               placeholder="请选择"
               @change="onchangeLink"
@@ -229,14 +230,13 @@
       </el-row>
     </el-form>
 
-
     <parentList
       ref="parentRef"
       classType="1"
       @changeParent="changeParent"
     ></parentList>
     <head-list ref="headRef" @changeParent="changePersonel"></head-list>
-</div>
+  </div>
 </template>
 
 <script>
@@ -259,11 +259,12 @@
     components: {
       fileUpload,
       inventoryTable,
-      parentList,headList
+      parentList,
+      headList
     },
-    props:{
-      businessId:{
-        default:''
+    props: {
+      businessId: {
+        default: ''
       }
     },
     data() {
@@ -311,6 +312,9 @@
         tableLinkData: [],
         businessList: [], //商机列表
         rules: {
+          opportunityId: [
+            { required: true, message: '请选择关联商机', trigger: 'change' }
+          ],
           contactName: [
             { required: true, message: '请选择客户', trigger: 'change' }
           ],
@@ -495,7 +499,6 @@
           // 表单验证通过,执行保存操作
           this.loading = true;
 
-        
           let settlementModeName = this.getDictValue(
             '结算方式',
             this.form.settlementMode

+ 7 - 6
src/views/bpm/handleTask/components/saleOrder/detailDialog.vue

@@ -25,19 +25,20 @@
       <el-row>
         <el-col :span="12">
           <el-form-item
-            label="询价方名称"
-            prop="contactName"
+            label="关联商机名称"
+            prop="opportunityName"
             style="margin-bottom: 22px"
           >
-            {{ form.contactName }}
+            {{ detailData.opportunityName }}
           </el-form-item>
           <el-form-item
-            label="关联商机名称"
-            prop="opportunityName"
+            label="询价方名称"
+            prop="contactName"
             style="margin-bottom: 22px"
           >
-            {{ detailData.opportunityName }}
+            {{ form.contactName }}
           </el-form-item>
+      
           <el-form-item
             label="询价方联系人"
             prop="contactLinkName"

+ 4 - 0
src/views/bpm/handleTask/components/saleOrder/inventoryTable.vue

@@ -488,6 +488,10 @@
       //修改回显
       putTableValue(data) {
         if (data && data?.length) {
+          data.forEach(item=>{
+            item['technicalAnswerId']=item['technicalAnswerId']||this.$store.state.user.info.userId
+            item['technicalAnswerName']=item['technicalAnswerName']||this.$store.state.user.info.name
+          })
           this.form.datasource = data;
         }
       },

+ 22 - 9
src/views/bpm/handleTask/components/saleOrder/submit.vue

@@ -90,7 +90,8 @@
     updateTech,
     productionSupervisorReApprove,
     UpdateInformation,
-    salesManagerApprove
+    salesManagerApprove,
+    salesmanApprove
   } from '@/api/bpm/components/saleManage/saleorder';
   import { approveTask, delegateTask } from '@/api/bpm/task';
   import { listAllUserBind } from '@/api/system/organization';
@@ -157,6 +158,7 @@
             reason: this.form.reason,
             technicianId: this.form.technicianId
           });
+          this.$emit('handleAudit', {status});
         }
         //技术员修改
         if (this.taskDefinitionKey === 'technicianApprove') {
@@ -173,7 +175,7 @@
             try {
               await updateTech(arr);
               await this._approveTask();
-              this.$emit('handleAudit', status);
+              this.$emit('handleAudit', {status});
             } catch (error) {}
           });
         }
@@ -185,19 +187,23 @@
               reason: this.form.reason,
               status
             });
-            this.$emit('handleAudit', status,status===0?'驳回':"");
+            this.$emit('handleAudit', {status,title: status === 0 ? '驳回' : ''});
           } catch (error) {}
         }
         //销售员补充
         if (this.taskDefinitionKey === 'salesmanApprove') {
+          if (status === 0) {
+            await this.salesmanApproveHttp(status);
+            this.$emit('handleAudit',{status,title: '驳回'});
+            return;
+          }
           this.$emit('getTableValue', async (data) => {
             let arr = await data;
-
             if (arr) {
               try {
                 await UpdateInformation(arr);
-                await this._approveTask();
-                this.$emit('handleAudit', status,status===0?'驳回':"");
+                await this.salesmanApproveHttp(status);
+                this.$emit('handleAudit', {status});
               } catch (error) {}
             }
           });
@@ -211,12 +217,19 @@
               reason: this.form.reason,
               status
             });
-            this.$emit('handleAudit', status, status===0?'驳回':"");
+            this.$emit('handleAudit', {status,title: status === 0 ? '驳回' : ''});
           } catch (error) {}
         }
       },
-      async _approveTask() {
-        await approveTask({ id: this.taskId, reason: this.form.reason });
+      salesmanApproveHttp(status) {
+        return salesmanApprove({
+          id: this.taskId,
+          reason: this.form.reason,
+          status
+        });
+      },
+      _approveTask() {
+        return approveTask({ id: this.taskId, reason: this.form.reason });
       }
     }
   };

+ 3 - 3
src/views/bpm/handleTask/index.vue

@@ -459,9 +459,9 @@
       },
 
       /** 处理审批通过和不通过的操作 */
-      handleAudit(status,title) {
-        let text=title||status === 1 ? '通过' : '不通过'
-        this.$message.success(`审批${text}成功!`);
+      handleAudit(data) {
+        let text=data.status === 1 ? '通过' : '不通过'
+        this.$message.success(`审批${data.title||text}成功!`);
         this.handleClose(); // 获得最新详情
         // const index = this.runningTasks.indexOf(task);
         // this.$refs['form' + index][0].validate((valid) => {