yusheng 2 лет назад
Родитель
Сommit
72c88ed407
19 измененных файлов с 2738 добавлено и 2003 удалено
  1. 22 0
      src/api/saleManage/businessOpportunity.js
  2. 1 0
      src/views/contractManage/contractBook/components/addDialog.vue
  3. 35 25
      src/views/contractManage/contractBook/components/inventoryTable.vue
  4. 1 1
      src/views/purchasingManage/inquiryManage/components/inquiryTable.vue
  5. 2 0
      src/views/purchasingManage/inquiryManage/index.vue
  6. 1 1
      src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue
  7. 218 164
      src/views/saleManage/businessOpportunity/components/addFollowDialog.vue
  8. 77 19
      src/views/saleManage/businessOpportunity/components/addOpportunityDialog.vue
  9. 88 54
      src/views/saleManage/businessOpportunity/components/businessAddTable.vue
  10. 262 213
      src/views/saleManage/businessOpportunity/components/followList.vue
  11. 341 169
      src/views/saleManage/businessOpportunity/components/opportunityDetailDialog.vue
  12. 210 131
      src/views/saleManage/businessOpportunity/components/personnelAddTable.vue
  13. 179 147
      src/views/saleManage/businessOpportunity/index.vue
  14. 17 2
      src/views/saleManage/quotation/components/addDialog.vue
  15. 364 364
      src/views/saleManage/quotation/components/detailDialog.vue
  16. 14 4
      src/views/saleManage/quotation/components/inventoryTable.vue
  17. 222 120
      src/views/saleManage/quotation/index.vue
  18. 683 588
      src/views/saleManage/saleOrder/components/addDialog.vue
  19. 1 1
      src/views/saleManage/saleOrder/components/inventoryTable.vue

+ 22 - 0
src/api/saleManage/businessOpportunity.js

@@ -22,6 +22,17 @@ export async function getDetail(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
+/**
+ * 获取信息详情
+ */
+export async function getOpportunityDetail(id) {
+  const res = await request.get(`/eom/businessopportunity/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 /**
  * 更新信息
  */
@@ -68,3 +79,14 @@ export async function updateStatus(id, status) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 提交
+ */
+export async function submit(data) {
+  const res = await request.post(`/bpm/businessOpportunityApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 1 - 0
src/views/contractManage/contractBook/components/addDialog.vue

@@ -816,6 +816,7 @@
             //核价单生成的合同
             this.$nextTick(() => {
               let { contractVO } = row;
+              console.log(row,'row')
               this.form = contractVO;
               this.$refs.inventoryTable &&
                 this.$refs.inventoryTable.putTableValue(row);

+ 35 - 25
src/views/contractManage/contractBook/components/inventoryTable.vue

@@ -52,10 +52,10 @@
           ></el-input>
         </el-form-item>
       </template>
-      <template v-slot:headerProductName="{column  }">
+      <template v-slot:headerProductName="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
-      
+
       <template v-slot:productCode="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -100,7 +100,7 @@
           ></el-input>
         </el-form-item>
       </template>
-      <template v-slot:headerTotalCount="{column  }">
+      <template v-slot:headerTotalCount="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
       <template v-slot:totalPrice="scope">
@@ -196,6 +196,7 @@
         >
           <el-input
             v-model="scope.row.measuringUnit"
+            :disabled="true"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -232,10 +233,10 @@
           </el-input>
         </el-form-item>
       </template>
-      <template v-slot:headerSinglePrice="{column  }">
+      <template v-slot:headerSinglePrice="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
-      
+
       <template v-slot:technicalAnswerName="{ row, $index }">
         <el-form-item
           style="margin-bottom: 20px"
@@ -374,8 +375,7 @@
             prop: 'productName',
             label: '名称',
             slot: 'productName',
-            headerSlot: 'headerProductName',
-
+            headerSlot: 'headerProductName'
           },
           {
             width: 120,
@@ -413,17 +413,14 @@
             prop: 'singlePrice',
             label: '单价',
             slot: 'singlePrice',
-            headerSlot: 'headerSinglePrice',
-
+            headerSlot: 'headerSinglePrice'
           },
           {
             width: 80,
             prop: 'totalCount',
             label: '数量',
             slot: 'totalCount',
-            headerSlot: 'headerTotalCount',
-
-            
+            headerSlot: 'headerTotalCount'
           },
           {
             width: 80,
@@ -458,7 +455,7 @@
           {
             width: 200,
             prop: 'guaranteePeriodDeadline',
-            label: '质保期',
+            label: '质保期截止日期',
             slot: 'guaranteePeriodDeadline'
           },
           // {
@@ -534,16 +531,17 @@
               );
             }
             // if (item.guaranteePeriodUnitCode) {
-              let guaranteePeriodUnitName = this.guaranteePeriodUnit(
-                item.guaranteePeriodUnitCode
-              );
-              this.$set(
-                this.form.datasource[i],
-                'guaranteePeriodDeadline',
-                guaranteePeriodUnitName != 'second'
-                  ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
-                  : ''
-              );
+            let guaranteePeriodUnitName = this.guaranteePeriodUnit(
+              item.guaranteePeriodUnitCode
+            );
+
+            this.$set(
+              this.form.datasource[i],
+              'guaranteePeriodDeadline',
+              guaranteePeriodUnitName != 'second'
+                ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
+                : ''
+            );
             // }
           });
           return;
@@ -555,7 +553,7 @@
             this.setDay(row.deliveryDays)
           );
         }
-        if (type == 'guaranteePeriod' ) {
+        if (type == 'guaranteePeriod') {
           let guaranteePeriodUnitName = this.guaranteePeriodUnit(
             row.guaranteePeriodUnitCode
           );
@@ -578,6 +576,8 @@
           : 'second';
       },
       setDay(addDay, dateType = 'day') {
+        console.log(addDay, 'addDay');
+        console.log(dateType, 'dateType');
         return dayjs(this.contractStartDate || new Date())
           .add(addDay, dateType)
           .format('YYYY-MM-DD');
@@ -630,11 +630,21 @@
       putTableValue(data) {
         if (data && data?.productList) {
           data.productList.forEach((item) => {
-            item.guaranteePeriodUnitCode=item.guaranteePeriodUnitCode+''
+            item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode + '';
             if (item.deliveryDays) {
               item['deliveryDeadline'] =
                 item['deliveryDeadline'] || this.setDay(item.deliveryDays);
             }
+            let guaranteePeriodUnitName = this.guaranteePeriodUnit(
+              item.guaranteePeriodUnitCode
+            );
+            if (item.guaranteePeriod && item.guaranteePeriodUnitCode) {
+              item['guaranteePeriodDeadline'] =
+                item['guaranteePeriodDeadline'] ||
+                guaranteePeriodUnitName != 'second'
+                  ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
+                  : '';
+            }
           });
           this.form.datasource = data.productList;
           this.allPrice = data.contractVO.totalPrice;

+ 1 - 1
src/views/purchasingManage/inquiryManage/components/inquiryTable.vue

@@ -346,7 +346,7 @@
           <el-input
             v-model="scope.row.measuringUnit"
             placeholder="请输入"
-            :disabled="status == 'Detail'"
+            :disabled="true"
           ></el-input>
         </el-form-item>
       </template>

+ 2 - 0
src/views/purchasingManage/inquiryManage/index.vue

@@ -32,6 +32,7 @@
               icon="el-icon-plus"
               class="ele-btn-icon"
               @click="addGenerateContract('all')"
+              :disabled="selection?.length===0"
             >
               生成合同
             </el-button>
@@ -82,6 +83,7 @@
               :underline="false"
               icon="el-icon-plus"
               @click="addGenerateContract('add', row)"
+             
             >
             生成合同
             </el-link>

+ 1 - 1
src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue

@@ -142,7 +142,7 @@
           <el-input
             v-model="scope.row.measuringUnit"
             placeholder="请输入"
-            :disabled="!!scope.row.productCode"
+            disabled
           ></el-input>
         </el-form-item>
       </template>

+ 218 - 164
src/views/saleManage/businessOpportunity/components/addFollowDialog.vue

@@ -1,4 +1,3 @@
-
 <template>
   <div class="container">
     <!-- 单据弹窗 -->
@@ -11,53 +10,78 @@
       :append-to-body="true"
       width="60%"
     >
-    <el-form
-          label-width="100px"
-          ref="form"
-          :model="form"
-          :rules="rules"
-          style="margin-top: 30px;padding-right: 20px;"
-        >
+      <el-form
+        label-width="100px"
+        ref="form"
+        :model="form"
+        :rules="rules"
+        style="margin-top: 30px; padding-right: 20px"
+      >
         <el-form-item label="客户联系人" prop="linkId">
-                <el-select v-model="form.linkId" multiple placeholder="请选择" style="width:300px" @change="onchangeLink" >
-                 <el-option
-                   v-for="item in linkNameOptions"
-                   :key="item.id"
-                   :label="item.linkName"
-                   :value="item.id">
-                 </el-option>
-               </el-select>
-              </el-form-item>
-              <el-form-item label="跟进时间" prop="followupTime">
-                <el-date-picker
-                v-model="form.followupTime"
-                  value-format="yyyy-MM-dd HH:mm:ss"
-                  placeholder="结束时间"
-                  type="datetime"
-                  style="width: 200px"
-                  class="filter-item"
-                ></el-date-picker>
-              </el-form-item>
-            <el-form-item label="跟进内容" prop="content">
-                <el-input placeholder="请输入" type="textarea" v-model="form.content" maxlength="500"></el-input>
-              </el-form-item>
-              <el-form-item label="达成共识" prop="agreement">
-                <el-input placeholder="请输入" type="textarea" v-model="form.agreement" maxlength="500"></el-input>
-              </el-form-item>
-             
-           
-              <el-form-item
-                label="下一步计划"
-                prop="nextPlan"
-              >
-              <el-input
-                  placeholder="请输入"
-                  v-model="form.nextPlan"
-                  type="textarea"
-                  maxlength="300"
-                ></el-input>
-              </el-form-item>
-        </el-form>
+          <el-select
+            v-model="form.linkId"
+            multiple
+            placeholder="请选择"
+            style="width: 300px"
+            @change="onchangeLink"
+          >
+            <el-option
+              v-for="item in linkNameOptions"
+              :key="item.id"
+              :label="item.linkName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="跟进时间" prop="followupTime">
+          <el-date-picker
+            v-model="form.followupTime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            placeholder="结束时间"
+            type="datetime"
+            style="width: 200px"
+            class="filter-item"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item label="跟进阶段" prop="stageCode">
+          <DictSelection dictName="商机阶段" clearable v-model="form.stageCode">
+          </DictSelection>
+        </el-form-item>
+        <el-form-item label="跟进内容" prop="content">
+          <el-input
+            placeholder="请输入"
+            type="textarea"
+            v-model="form.content"
+            maxlength="500"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="达成共识" prop="agreement">
+          <el-input
+            placeholder="请输入"
+            type="textarea"
+            v-model="form.agreement"
+            maxlength="500"
+          ></el-input>
+        </el-form-item>
+
+        <el-form-item label="下一步计划" prop="nextPlan">
+          <el-input
+            placeholder="请输入"
+            v-model="form.nextPlan"
+            type="textarea"
+            maxlength="300"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="files" label="附件">
+          <fileUpload
+            v-model="form.files"
+            module="main"
+            :showLib="false"
+            :limit="5"
+          /> </el-form-item
+        >>
+      </el-form>
 
       <div slot="footer" class="dialog-footer">
         <el-button size="small" @click="handleClose">关 闭</el-button>
@@ -66,29 +90,43 @@
     </el-dialog>
   </div>
 </template>
-  <script>
-import dictMixins from '@/mixins/dictMixins';
-import {copyObj} from '@/utils/util';
-import { deepClone } from '@/utils/index';
-import { getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus,getcontactlink} from '@/api/saleManage/businessFollow';
-export default {
-  mixins: [dictMixins],
-  data() {
-    let formDef = {
-          agreement:'',
-          contactId:'',
-          content: '',
-          followupTime: '',
-          linkId: '',
-          linkName: '',
-          nextPlan: '',
-          opportunityId: ''
-        };
-   
-    return {
-      dialogVisible: false,
-      currentDetail:{},   //选择的客户信息
-      linkNameOptions:[],
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import { copyObj } from '@/utils/util';
+  import { deepClone } from '@/utils/index';
+  import fileUpload from '@/components/upload/fileUpload';
+
+  import {
+    getDetail,
+    UpdateInformation,
+    addInformation,
+    deleteInformation,
+    updateStatus,
+    getcontactlink
+  } from '@/api/saleManage/businessFollow';
+  export default {
+    mixins: [dictMixins],
+    components:{
+      fileUpload
+    },
+    data() {
+      let formDef = {
+        agreement: '',
+        contactId: '',
+        content: '',
+        followupTime: '',
+        linkId: '',
+        linkName: '',
+        nextPlan: '',
+        opportunityId: '',
+        stageCode: '',
+        files: []
+      };
+
+      return {
+        dialogVisible: false,
+        currentDetail: {}, //选择的客户信息
+        linkNameOptions: [],
         title: '',
         row: {},
         activeName: 'base',
@@ -102,125 +140,141 @@ export default {
             { required: true, message: '请选择跟进时间', trigger: 'change' }
           ],
           linkName: [
-            { required: true, message: '请选择客户联系人名称', trigger: 'change' }
+            {
+              required: true,
+              message: '请选择客户联系人名称',
+              trigger: 'change'
+            }
           ]
         },
-      
+
         // 提交状态
         loading: false,
         // 是否是修改
-        isUpdate: false,
-    };
-  },
-  created() {},
-  methods: {
-   
-    //更改弹框状态
-    async open(type, row, currentDetail) {
-        this.title = type==='add'?'新增':'修改';
-        this.currentDetail=currentDetail
-        this.row = row;
+        isUpdate: false
+      };
+    },
+    created() {},
+    methods: {
+      //更改弹框状态
+      async open(type, row, currentDetail) {
+        this.title = type === 'add' ? '新增' : '修改';
+        this.currentDetail = currentDetail;
+        this.row = copyObj(row);
         this.dialogVisible = true;
-        this.getInfo()
+        this.getInfo();
         if (type == 'add') {
           this.isUpdate = false;
         } else {
           this.isUpdate = true;
-          row.linkId= row?.linkId?.split(',')||[]
-          this.form=row
+          this.row.linkId = this.row.linkId&&this.row.linkId.split(',') || [];
+          this.form = this.row
+
+
+
         }
       },
 
       //表单验证
       getValidate() {
-          return  new Promise((resolve, reject) => {
-              this.$refs.form.validate((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
-                }
-              });
-            })
-     },
+        return new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        });
+      },
 
-    //初始数据
-    async getInfo() {
-      const data = await getcontactlink({contactId:this.currentDetail?.contactId});
-         if(data&&data?.length){
-           this.linkNameOptions=data
-         }
-    },
-  
-    //选择下拉框
-    onchangeLink(selectedOptions){
-      const selectedLabels = selectedOptions.map(optionId => {
-      const option = this.linkNameOptions.find(opt => opt.id === optionId);
-      return option ? option.linkName : '';
-    }).join(',');
-    this.form.linkName=selectedLabels
-    },
+      //初始数据
+      async getInfo() {
+        const data = await getcontactlink({
+          contactId: this.currentDetail?.contactId
+        });
+        if (data && data?.length) {
+          this.linkNameOptions = data;
+        }
+      },
 
-    //保存
-    async sumbit() {
-      try {
-           await this.getValidate();
-           // 表单验证通过,执行保存操作
-           this.loading = true;
-      
-        if (!this.isUpdate) {
-          delete this.form.id;
-        } 
-        let params = deepClone(this.form)
-        let {contactId,id}=this.currentDetail
-        params=Object.assign({},params,{contactId:contactId,opportunityId:id,linkId: params?.linkId?.join(',')||''})
-        if (this.isUpdate) {
-          UpdateInformation(params)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("修改成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
-        } else {
-          addInformation(params)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("新增成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
+      //选择下拉框
+      onchangeLink(selectedOptions) {
+        const selectedLabels = selectedOptions
+          .map((optionId) => {
+            const option = this.linkNameOptions.find(
+              (opt) => opt.id === optionId
+            );
+            return option ? option.linkName : '';
+          })
+          .join(',');
+        this.form.linkName = selectedLabels;
+      },
+
+      //保存
+      async sumbit() {
+        try {
+          await this.getValidate();
+          // 表单验证通过,执行保存操作
+          this.loading = true;
+
+          if (!this.isUpdate) {
+            delete this.form.id;
+          }
+          let _stageName = this.getDictValue('商机阶段', this.form.stageCode);
+          let params = deepClone(this.form);
+          let { contactId, id } = this.currentDetail;
+          params = Object.assign({}, params, {
+            contactId: contactId,
+            opportunityId: id,
+            linkId: params?.linkId?.join(',') || '',
+            stageName: _stageName,
+            files: this.form.files || []
+          });
+          if (this.isUpdate) {
+            UpdateInformation(params)
+              .then((res) => {
+                this.loading = false;
+                this.$message.success('修改成功');
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
+          } else {
+            addInformation(params)
+              .then((res) => {
+                this.loading = false;
+                this.$message.success('新增成功');
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
           }
         } catch (error) {
-          console.log(error)
+          console.log(error);
           // 表单验证未通过,不执行保存操作
         }
-       
-    },
-    cancel() {
+      },
+      cancel() {
         this.$nextTick(() => {
           // 关闭后,销毁所有的表单数据
-          this.$refs['form'] &&  this.$refs['form'].resetFields();
-          this.form = copyObj(this.formDef),
-          this.dialogVisible = false;
-        })
+          this.$refs['form'] && this.$refs['form'].resetFields();
+          (this.form = copyObj(this.formDef)), (this.dialogVisible = false);
+        });
       },
-    handleClose() {
-    this.cancel()
-      
+      handleClose() {
+        this.cancel();
+      }
     }
-  }
-};
+  };
 </script>
 
-  <style lang='scss' scoped>
-.container {
-  padding: 10px 0;
-}
+<style lang="scss" scoped>
+  .container {
+    padding: 10px 0;
+  }
 </style>

+ 77 - 19
src/views/saleManage/businessOpportunity/components/addOpportunityDialog.vue

@@ -93,6 +93,16 @@
             </DictSelection>
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item prop="files" label="附件">
+            <fileUpload
+              v-model="form.files"
+              module="main"
+              :showLib="false"
+              :limit="5"
+            />
+          </el-form-item>
+        </el-col>
         <el-col :span="16">
           <el-form-item label="备注" prop="remark">
             <el-input
@@ -105,7 +115,8 @@
         </el-col>
       </el-row>
     </el-form>
-
+    <headerTitle title="产品清单"></headerTitle>
+    <inventoryTable ref="inventoryTable"></inventoryTable>
     <headerTitle title="竞品"></headerTitle>
     <businessAddTable
       ref="businessAddTable"
@@ -122,6 +133,8 @@
     ></personnelAddTable>
     <div slot="footer" class="footer">
       <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="handHead('生产主管')">提交</el-button>
+
       <el-button @click="cancel">返回</el-button>
     </div>
     <head-list ref="headRef" @changeParent="changeHead"></head-list>
@@ -136,7 +149,6 @@
 <script>
   import store from '@/store';
   import { categoryData } from 'element-china-category-data';
-  import fileUpload from '@/components/upload/fileUpload';
   import { cityData } from 'ele-admin/packages/utils/regions';
   import dictMixins from '@/mixins/dictMixins';
   import businessAddTable from './businessAddTable.vue';
@@ -149,11 +161,12 @@
     getDetail,
     UpdateInformation,
     addInformation,
-    deleteInformation,
-    updateStatus
+    submit
   } from '@/api/saleManage/businessOpportunity';
   import headList from './headList.vue';
   import { copyObj } from '@/utils/util';
+  import inventoryTable from '@/views/saleManage/quotation/components/inventoryTable.vue';
+  import fileUpload from '@/components/upload/fileUpload';
 
   export default {
     props: {
@@ -167,7 +180,8 @@
       deptSelect,
       headList,
       parentList,
-      personSelect
+      personSelect,
+      inventoryTable
     },
     data() {
       let formDef = {
@@ -186,7 +200,8 @@
         responsibleName: '',
         responsibleId: '',
         source: '',
-        status: 1
+        status: 1,
+        files: []
       };
 
       return {
@@ -225,11 +240,11 @@
               required: false,
               trigger: 'blur',
               validator: (_rule, value, callback) => {
-                console.log(_rule)
+                console.log(_rule);
                 const reg = /^\d+(\.\d{1,2})?$/; // 限制为最多两位小数的正数
                 if (!value) {
-                  callback( ); // 验证通过
-                  return
+                  callback(); // 验证通过
+                  return;
                 }
                 if (reg.test(value) && parseFloat(value) <= 100) {
                   callback(); // 验证通过
@@ -253,7 +268,7 @@
                 const reg = /^\d{1,13}(\.\d{1,2})?$/; // 限制为最多两位小数的13位以内的正数
                 if (!value) {
                   callback(); // 验证通过
-                  return
+                  return;
                 }
                 if (reg.test(value)) {
                   callback(); // 验证通过
@@ -285,7 +300,8 @@
         // 组织机构树形结构数据
         groupTreeData: [],
         // 组织机构平铺数据
-        groupData: []
+        groupData: [],
+        businessId:''
       };
     },
     mounted() {
@@ -308,7 +324,11 @@
         this.$set(this.form, 'contactName', obj.name);
       },
       //选择负责人回调
-      changeHead(obj) {
+      changeHead(obj,id,title) {
+        if (title === '生产主管') {
+          this.save('sub', obj.id);
+          return;
+        }
         this.$set(this.form, 'responsibleId', obj.id);
         this.$set(this.form, 'responsibleName', obj.name);
       },
@@ -318,11 +338,11 @@
         };
         this.$refs.parentRef.open(item);
       },
-      handHead() {
+      handHead(title) {
         let item = {
           id: this.form.responsibleId
         };
-        this.$refs.headRef.open(item);
+        this.$refs.headRef.open(item,0,title);
       },
       async open(type, row, contactCategoryId) {
         this.title = type === 'add' ? '新增' : '修改';
@@ -338,6 +358,8 @@
 
       //获取详情
       async getDetailData(id) {
+        this.businessId = id;
+
         this.loading = true;
         const data = await getDetail(id);
         this.loading = false;
@@ -350,6 +372,8 @@
               );
             this.$refs.personnelAddTable &&
               this.$refs.personnelAddTable.putTableValue(data.partyList);
+            this.$refs.inventoryTable &&
+              this.$refs.inventoryTable.putTableValue(data.productList);
           });
         }
       },
@@ -378,6 +402,15 @@
               }
             });
           }),
+          new Promise((resolve, reject) => {
+            this.$refs.inventoryTable.validateForm((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          }),
           new Promise((resolve, reject) => {
             this.$refs.businessAddTable.validateForm((valid) => {
               if (!valid) {
@@ -395,11 +428,10 @@
                 resolve(true);
               }
             });
-          }),
+          })
         ]);
       },
-      async save() {
-
+      async save(type, productionSupervisorId) {
         try {
           await this.getValidate();
           // 表单验证通过,执行保存操作
@@ -414,18 +446,31 @@
             responsibleId: this.userInfo.userId,
             responsibleName: this.userInfo.name,
             sourceName: _sourceName,
-            stageName: _stageName
+            stageName: _stageName,
+            files: this.form.files || []
           });
+
+          if (this.$refs.inventoryTable.getTableValue().length == 0) {
+            this.$message.warning('产品清单不能为空');
+
+            return;
+          }
           const commitData = {
             opportunity: this.form,
             competAnalysisList: this.$refs.businessAddTable.getTableValue(),
-            partyList: this.$refs.personnelAddTable.getTableValue()
+            partyList: this.$refs.personnelAddTable.getTableValue(),
+            productList: this.$refs.inventoryTable.getTableValue()
           };
           if (this.isUpdate) {
             UpdateInformation(commitData)
               .then((res) => {
                 this.loading = false;
                 this.$message.success('修改成功');
+
+                if (type === 'sub') {
+                  this.businessOpportunitySubmit(res, productionSupervisorId);
+                  return;
+                }
                 this.cancel();
                 this.$emit('done');
               })
@@ -437,6 +482,10 @@
               .then((res) => {
                 this.loading = false;
                 this.$message.success('新增成功');
+                if (type === 'sub') {
+                  this.businessOpportunitySubmit(res, productionSupervisorId);
+                  return;
+                }
                 this.cancel();
                 this.$emit('done');
               })
@@ -449,6 +498,15 @@
           // 表单验证未通过,不执行保存操作
         }
       },
+      businessOpportunitySubmit(res, productionSupervisorId) {
+        submit({
+          businessId: this.businessId || res,
+          productionSupervisorId
+        }).then((res) => {
+          this.cancel();
+          this.$emit('done');
+        });
+      },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';

+ 88 - 54
src/views/saleManage/businessOpportunity/components/businessAddTable.vue

@@ -1,45 +1,80 @@
 <template>
-    <el-form ref="form" :model="form" :rules="rules">
-      <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="form.datasource"
-        cache-key="systemRoleTable17" class="time-form">
-        <!-- 表头工具栏 -->
-        <template v-slot:toolbar>
-          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd">
-            新增
-          </el-button>
-        </template>
-        <template v-slot:name="scope">
-          <el-form-item style="margin-bottom: 20px;" :prop="'datasource.' + scope.$index + '.name'" :rules="{
+  <el-form ref="form" :model="form" :rules="rules">
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="form.datasource"
+      cache-key="systemRoleTable17"
+      class="time-form"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="handlAdd"
+        >
+          新增
+        </el-button>
+      </template>
+      <template v-slot:name="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.name'"
+          :rules="{
             required: true,
             message: '请输入',
             trigger: 'change'
-          }">
-            <el-input v-model="scope.row.name" placeholder="请输入"></el-input>
-          </el-form-item>
-        </template>
-        <template v-slot:analysis="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.analysis'" :rules="{
+          }"
+        >
+          <el-input v-model="scope.row.name" placeholder="请输入"></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:analysis="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.analysis'"
+          :rules="{
             required: true,
             message: '请输入',
             trigger: 'change'
-          }">
-            <el-input v-model="scope.row.analysis" type="textarea" placeholder="请输入"></el-input>
-          </el-form-item>
-        </template>
-        <!-- 操作列 -->
-        <template v-slot:action="{ row }">
-          <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>
-        </template>
-      </ele-pro-table>
-    </el-form>
-  </template>
-  <script>
+          }"
+        >
+          <el-input
+            v-model="scope.row.analysis"
+            type="textarea"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:headerName="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerAnalysis="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+  </el-form>
+</template>
+<script>
   export default {
     props: {
       delDetailIds: Array
@@ -64,17 +99,20 @@
             align: 'center',
             fixed: 'left'
           },
-          
+
           {
             width: 300,
             prop: 'name',
             label: '竞争对手名称',
-            slot: 'name'
+            slot: 'name',
+            headerSlot:'headerName'
+
           },
           {
             prop: 'analysis',
             label: '竞品分析',
-            slot: 'analysis'
+            slot: 'analysis',
+            headerSlot:'headerAnalysis'
           },
           {
             width: 100,
@@ -85,7 +123,7 @@
             slot: 'action',
             showOverflowTooltip: true
           }
-        ],
+        ]
       };
     },
     computed: {
@@ -94,14 +132,14 @@
       }
     },
     methods: {
-        // 返回列表数据
-     getTableValue(){
-         return this.form.datasource
+      // 返回列表数据
+      getTableValue() {
+        return this.form.datasource;
       },
       //修改回显
-      putTableValue(data){
-        if(data&&data?.length){
-            this.form.datasource=data
+      putTableValue(data) {
+        if (data && data?.length) {
+          this.form.datasource = data;
         }
       },
       remove(row) {
@@ -130,22 +168,18 @@
         item.key = this.form.datasource.length + 1;
         this.form.datasource.push(item);
       },
- 
 
-      validateForm (callback) {
+      validateForm(callback) {
         //开始表单校验
         this.$refs.form.validate((valid) => {
           callback(valid);
         });
-      },
-  
-  
+      }
     }
   };
-  </script>
-  <style lang="scss" scoped>
+</script>
+<style lang="scss" scoped>
   .time-form .el-form-item {
     margin-bottom: 0 !important;
   }
-  </style>
-  
+</style>

+ 262 - 213
src/views/saleManage/businessOpportunity/components/followList.vue

@@ -1,152 +1,203 @@
 <template>
-    <el-dialog title="跟进列表" :visible.sync="visible" :before-close="handleClose" :multiple="true" :centered="false" :close-on-click-modal="false"  top="2vh"
-        :close-on-press-escape="false" append-to-body width="80%">
-        <el-card shadow="never">
-            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id"
-            :selection.sync="selection"
-                        height="calc(100vh - 350px)" class="dict-table" @cell-click="cellClick">
-                         <!-- 表头工具栏 -->
-              <template v-slot:toolbar>
-                <el-button
-                  size="small"
-                  type="primary"
-                  icon="el-icon-plus"
-                  class="ele-btn-icon"
-                  @click="openEdit('add',{})"
-                >
-                  新建
-                </el-button>
-                <el-button
-                  size="small"
-                  type="danger"
-                  el-icon-delete
-                  class="ele-btn-icon"
-                  @click="allDelBtn"
-                  :disabled="selection?.length===0"
-                >
-                  批量删除
-                </el-button>
-              </template>
-              <template v-slot:content="{ row }">
-                <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.content }}</el-link>
-              </template>
-                          <!-- 操作列 -->
-              <template v-slot:action="{ row }">
-              
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  icon="el-icon-edit"
-                  @click="openEdit('edit',row)"
-                >
-                  修改
-                </el-link>
-               
+  <el-dialog
+    title="跟进列表"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :multiple="true"
+    :centered="false"
+    :close-on-click-modal="false"
+    top="2vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        :selection.sync="selection"
+        height="calc(100vh - 350px)"
+        class="dict-table"
+        @cell-click="cellClick"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit('add', {})"
+          >
+            新建
+          </el-button>
+          <el-button
+            size="small"
+            type="danger"
+            el-icon-delete
+            class="ele-btn-icon"
+            @click="allDelBtn"
+            :disabled="selection?.length === 0"
+          >
+            批量删除
+          </el-button>
+        </template>
+        <template v-slot:content="{ row }">
+          <el-link type="primary" :underline="false" @click="openDetail(row)">
+            {{ row.content }}</el-link
+          >
+        </template>
+        <template v-slot:files="{ row }">
+          <div v-if="row.files && row.files?.length">
+            <el-link
+              v-for="link in row.files"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}</el-link
+            >
+          </div>
+        </template>
 
-                <el-popconfirm
-                  class="ele-action"
-                  title="确定要删除此信息吗?"
-                  @confirm="remove(row)"
-                >
-                  <template v-slot:reference>
-                    <el-link
-                      type="danger"
-                      :underline="false"
-                      icon="el-icon-delete"
-                    >
-                      删除
-                    </el-link>
-                  </template>
-                </el-popconfirm>
-              </template>
-                    </ele-pro-table>
-        </el-card>
-        <AddFollowDialog ref="addFollowDialogRef" @done="reload" ></AddFollowDialog>
-        <followDetailDialog ref="contactDetailDialogRef"></followDetailDialog>
-     <!-- 多选删除弹窗 -->
-    <pop-el-modal :popVisible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('edit', row)"
+          >
+            修改
+          </el-link>
+
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除此信息吗?"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <AddFollowDialog ref="addFollowDialogRef" @done="reload"></AddFollowDialog>
+    <followDetailDialog ref="contactDetailDialogRef"></followDetailDialog>
+    <!-- 多选删除弹窗 -->
+    <pop-el-modal
+      :popVisible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
   </el-dialog>
 </template>
-  
+
 <script>
-import AddFollowDialog from './addFollowDialog.vue';
-import popElModal from '@/components/pop-el-modal';
-import followDetailDialog from './followDetailDialog.vue';
-import { getTableList,deleteInformation } from '@/api/saleManage/businessFollow';
-export default {
+  import AddFollowDialog from './addFollowDialog.vue';
+  import popElModal from '@/components/pop-el-modal';
+  import followDetailDialog from './followDetailDialog.vue';
+  import { getFile } from '@/api/system/file';
+
+  import {
+    getTableList,
+    deleteInformation
+  } from '@/api/saleManage/businessFollow';
+  export default {
     components: {
-        AddFollowDialog,
-        followDetailDialog,
-        popElModal
+      AddFollowDialog,
+      followDetailDialog,
+      popElModal
     },
     data() {
-        return {
-            selection:[],
-            current:{},    //当前选择的信息
-            visible: false,
-            delVisible:false,
-             columns: [
-              {
-                width: 45,
-                type: 'selection',
-                columnKey: 'selection',
-               align: 'center'
-              },
-              {
-                  columnKey: 'index',
-                  label: '序号',
-                  type: 'index',
-                  width: 55,
-                  align: 'center',
-                  showOverflowTooltip: true,
-                  fixed: 'left'
-              },
-              {
-                prop: 'content',
-                label: '跟进内容',
-                slot: 'content',
-                showOverflowTooltip: true,
-                minWidth: 200
-              },
-              {
-                prop: 'agreement',
-                label: '达成共识',
-                showOverflowTooltip: true,
-                minWidth: 110
-              },
-              {
-                prop: 'linkName',
-                label: '客户联系人名称',
-                showOverflowTooltip: true,
-                minWidth: 110
-              },
-              {
-                prop: 'nextPlan',
-                label: '下一步计划',
-                showOverflowTooltip: true,
-                minWidth: 110
-              },
-              {
-                prop: 'followupTime',
-                label: '跟进时间',
-                align: 'center',
-                showOverflowTooltip: true,
-                minWidth: 110,
-                formatter: (_row, _column, cellValue) => {
-                  return this.$util.toDateString(cellValue);
-                }
-              },
-              {
-                prop: 'createTime',
-                label: '创建时间',
-                align: 'center',
-                showOverflowTooltip: true,
-                minWidth: 110,
-                formatter: (_row, _column, cellValue) => {
-                  return this.$util.toDateString(cellValue);
-                }
-              },
-              {
+      return {
+        selection: [],
+        current: {}, //当前选择的信息
+        visible: false,
+        delVisible: false,
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'content',
+            label: '跟进内容',
+            slot: 'content',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'stageName',
+            label: '跟进阶段',
+            slot: 'stageName',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'agreement',
+            label: '达成共识',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'linkName',
+            label: '客户联系人名称',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'nextPlan',
+            label: '下一步计划',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'followupTime',
+            label: '跟进时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            prop: 'files',
+            label: '附件',
+            align: 'center',
+            slot: 'files',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
             columnKey: 'action',
             label: '操作',
             width: 230,
@@ -154,49 +205,50 @@ export default {
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true,
-            fixed: 'right',
+            fixed: 'right'
           }
-            ],
+        ],
 
-            radio: null,
-        }
+        radio: null
+      };
     },
 
     watch: {
-        visible(visible) {
-            if(visible){
-                this.$nextTick(()=>{
-                   this.reload();
-                })
-                
-            }
+      visible(visible) {
+        if (visible) {
+          this.$nextTick(() => {
+            this.reload();
+          });
         }
+      }
     },
     methods: {
-        open(item) {
-            if (item) {
-              this.current = item
-            }
-            this.visible = true
-        },
-        openEdit(type,row) {
-        this.$refs.addFollowDialogRef.open( type,row,this.current);
+      open(item) {
+        if (item) {
+          this.current = item;
+        }
+        this.visible = true;
+      },
+      openEdit(type, row) {
+        this.$refs.addFollowDialogRef.open(type, row, this.current);
         this.$refs.addFollowDialogRef.$refs.form &&
-        this.$refs.addFollowDialogRef.$refs.form.clearValidate();
+          this.$refs.addFollowDialogRef.$refs.form.clearValidate();
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
       },
-
       //查看详情
-      openDetail(row){
+      openDetail(row) {
         this.$refs.contactDetailDialogRef.open(row);
       },
-       //批量删除
-       allDelBtn(){
-        if(this.selection?.length===0) return
-        this.delVisible=true
+      //批量删除
+      allDelBtn() {
+        if (this.selection?.length === 0) return;
+        this.delVisible = true;
       },
-      commitBtn(){
-        console.log(this.selection)
-        const dataId=this.selection.map(v=>v.id)
+      commitBtn() {
+        console.log(this.selection);
+        const dataId = this.selection.map((v) => v.id);
         deleteInformation(dataId).then((res) => {
           this.$message.success('删除成功!');
           this.reload();
@@ -208,71 +260,68 @@ export default {
           this.reload();
         });
       },
-        /* 表格数据源 */
-        datasource({ page, limit, where, order }) {
-            return getTableList({
-                pageNum: page,
-                size: limit,
-                opportunityId:this.current.id,
-                ...where
-            });
-        },
-
-
-        /* 刷新表格 */
-        reload(where) {
-            this.$refs.table.reload({ pageNum: 1, where: where  });
-        },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getTableList({
+          pageNum: page,
+          size: limit,
+          opportunityId: this.current.id,
+          ...where
+        });
+      },
 
-        handleNodeClick(data, node) {
-            this.curNodeData = data;
-            this.reload({ groupId: data.id });
-        },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
 
+      handleNodeClick(data, node) {
+        this.curNodeData = data;
+        this.reload({ groupId: data.id });
+      },
 
-        // 单击获取id
-        cellClick(row) {
-            // this.current = row
-            // this.radio = row.id
-        },
-        handleClose() {
-            this.visible = false
-            this.current = null
-            this.radio = ''
-        },
+      // 单击获取id
+      cellClick(row) {
+        // this.current = row
+        // this.radio = row.id
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      }
     }
-}
+  };
 </script>
-  
+
 <style lang="scss" scoped>
-.tree_col {
+  .tree_col {
     border: 1px solid #eee;
     padding: 10px 0;
     box-sizing: border-box;
     height: 500px;
     overflow: auto;
-}
+  }
 
-.table_col {
+  .table_col {
     padding-left: 10px;
 
     ::v-deep .el-table th.el-table__cell {
-        background: #f2f2f2;
+      background: #f2f2f2;
     }
-}
+  }
 
-.pagination {
+  .pagination {
     text-align: right;
     padding: 10px 0;
-}
+  }
 
-.btns {
+  .btns {
     text-align: center;
     padding: 10px 0;
-}
+  }
 
-.topsearch {
+  .topsearch {
     margin-bottom: 15px;
-}
+  }
 </style>
-  

+ 341 - 169
src/views/saleManage/businessOpportunity/components/opportunityDetailDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <ele-modal
-  custom-class="ele-dialog-form long-dialog-form"
+    custom-class="ele-dialog-form long-dialog-form"
     :centered="true"
     v-if="visible"
     :visible.sync="visible"
@@ -9,89 +9,143 @@
     width="80%"
     @close="cancel"
   >
-  <el-card
-        shadow="never"
-        header="基本信息"
-        body-style="padding: 22px 20px 0 0;"
+    <el-card
+      shadow="never"
+      header="基本信息"
+      body-style="padding: 22px 20px 0 0;"
+    >
+      <el-form
+        label-width="120px"
+        ref="form"
+        :model="form"
+        :rules="rules"
+        style="margin-top: 30px"
       >
-  <el-form
-          label-width="120px"
-          ref="form"
-          :model="form"
-          :rules="rules"
-          style="margin-top: 30px"
-        >
-          <el-row>
-            <el-col :span="8">
-              <el-form-item
-                label="客户名称:"
-                prop="contactName"
-              >
-              {{detailData.contactName}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="	商机名称:" prop="name">
-                {{detailData.name}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="负责人名称:" prop="responsibleName">
-                {{detailData.responsibleName}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="商机来源:" prop="sourceCode">
-                {{detailData.sourceName}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="赢单率:" prop="winRate">
-                {{detailData.winRate+'%'}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="预算:" prop="budget">
-                {{detailData.budget+'万元'}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="预计结单日期:" prop="expectedClosingDate">
-                {{detailData.expectedClosingDate}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="商机阶段:" prop="stageCode">
-                {{detailData.stageName}}
-              </el-form-item>
-            </el-col>
-            <el-col :span="16">
-              <el-form-item
-                label="备注:"
-                prop="remark"
-              >
-              {{detailData.remark}}
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-      </el-card>
-      <el-card
-        shadow="never"
-        header="竞品对手"
-        body-style="padding: 22px 20px 0 20px;"
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="客户名称:" prop="contactName">
+              {{ detailData.contactName }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="	商机名称:" prop="name">
+              {{ detailData.name }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="负责人名称:" prop="responsibleName">
+              {{ detailData.responsibleName }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="商机来源:" prop="sourceCode">
+              {{ detailData.sourceName }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="赢单率:" prop="winRate">
+              {{ detailData.winRate + '%' }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="预算:" prop="budget">
+              {{ detailData.budget + '万元' }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="预计结单日期:" prop="expectedClosingDate">
+              {{ detailData.expectedClosingDate }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="商机阶段:" prop="stageCode">
+              {{ detailData.stageName }}
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="附件:" prop="files">
+              <div v-if="detailData.files && detailData.files?.length">
+                <el-link
+                  v-for="link in detailData.files"
+                  :key="link.id"
+                  type="primary"
+                  :underline="false"
+                  @click="downloadFile(link)"
+                >
+                  {{ link.name }}</el-link
+                >
+              </div>
+            </el-form-item>
+          </el-col>
+          <el-col :span="16">
+            <el-form-item label="备注:" prop="remark">
+              {{ detailData.remark }}
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </el-card>
+    <el-card
+      shadow="never"
+      header="产品清单"
+      body-style="padding: 22px 20px 0 20px;"
+    >
+      <ele-pro-table
+        ref="table"
+        :needPage="false"
+        :columns="competAnalysisListcolumns"
+        :toolkit="[]"
+        :datasource="detailData.productList"
+        row-key="id"
       >
-      <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns" :datasource="detailData.competAnalysisList" row-key="id">
-        </ele-pro-table>
-      </el-card>
-      <el-card
-        shadow="never"
-        header="关键人信息"
-        body-style="padding: 22px 20px 0 20px;"
+        <template v-slot:toolbar>
+          <div class="headbox">
+            <span class="amount">总计:{{ form.totalPrice }}元</span>
+          </div>
+        </template>
+        <template v-slot:technicalDrawings="{ row }">
+          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+            <el-link
+              v-for="link in row.technicalDrawings"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}</el-link
+            >
+          </div>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <el-card
+      shadow="never"
+      header="竞品对手"
+      body-style="padding: 22px 20px 0 20px;"
+    >
+      <ele-pro-table
+        ref="table"
+        :needPage="false"
+        :columns="competAnalysisListcolumns1"
+        :datasource="detailData.competAnalysisList"
+        row-key="id"
       >
-      <ele-pro-table ref="table" :needPage="false" :columns="partyListcolumns" :datasource="detailData.partyList" row-key="id">
-        </ele-pro-table>
-      </el-card>
+      </ele-pro-table>
+    </el-card>
+    <el-card
+      shadow="never"
+      header="关键人信息"
+      body-style="padding: 22px 20px 0 20px;"
+    >
+      <ele-pro-table
+        ref="table"
+        :needPage="false"
+        :columns="partyListcolumns"
+        :datasource="detailData.partyList"
+        row-key="id"
+      >
+      </ele-pro-table>
+    </el-card>
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
     </div>
@@ -99,87 +153,205 @@
 </template>
 
 <script>
-import { getDetail} from '@/api/saleManage/businessOpportunity';
-import {getFile} from '@/api/system/file';
-import {getInfoById as getCategoryInfo} from '@/api/classifyManage/index';
-import dictMixins from '@/mixins/dictMixins';;
-import {copyObj} from '@/utils/util';
-
+  import { getDetail } from '@/api/saleManage/businessOpportunity';
+  import { getFile } from '@/api/system/file';
+  import { getInfoById as getCategoryInfo } from '@/api/classifyManage/index';
+  import dictMixins from '@/mixins/dictMixins';
+  import { copyObj } from '@/utils/util';
 
-export default {
+  export default {
     mixins: [dictMixins],
     data() {
-    
       return {
         visible: false,
         title: '详情',
         row: {},
         activeName: 'base',
-        form:{},
-        rules:{},
-        detailData:{},
+        form: {},
+        rules: {},
+        detailData: {},
+        competAnalysisListcolumns1: [
+          {
+            prop: 'name',
+            label: '竞争对手名称',
+            // sortable: 'custom',
+            showOverflowTooltip: true,
+            align: 'center',
+            width: 300
+          },
+          {
+            prop: 'analysis',
+            label: '竞品分析',
+            showOverflowTooltip: true,
+            align: 'center'
+          }
+        ],
+        partyListcolumns: [
+          {
+            prop: 'linkName',
+            label: '关键人名称',
+            // sortable: 'custom',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'linkMobilePhone',
+            label: '联系方式',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'linkPost',
+            label: '职位',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'attitudeName',
+            label: '态度',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'influenceName',
+            label: '影响力',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'goal',
+            label: '项目目标/期望',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          }
+        ],
         competAnalysisListcolumns: [
-      
-         {
-             prop: 'name',
-             label: '竞争对手名称',
-             // sortable: 'custom',
-             showOverflowTooltip: true,
-             align: 'center',
-             width: 300
-         },
-         {
-             prop: 'analysis',
-             label: '竞品分析',
-             showOverflowTooltip: true,
-             align: 'center',
-         },
-         ],
-         partyListcolumns: [
-         {
-             prop: 'linkName',
-             label: '关键人名称',
-             // sortable: 'custom',
-             showOverflowTooltip: true,
-             align: 'center',
-             minWidth: 110
-         },
-         {
-             prop: 'linkMobilePhone',
-             label: '联系方式',
-             showOverflowTooltip: true,
-             align: 'center',
-             minWidth: 110
-         },
-         {
-             prop: 'linkPost',
-             label: '职位',
-             showOverflowTooltip: true,
-             align: 'center',
-             minWidth: 110
-         },
-         {
-             prop: 'attitudeName',
-             label: '态度',
-             showOverflowTooltip: true,
-             align: 'center',
-             minWidth: 110
-         },
-         {
-             prop: 'influenceName',
-             label: '影响力',
-             showOverflowTooltip: true,
-             align: 'center',
-             minWidth: 110
-         },
-         {
-             prop: 'goal',
-             label: '项目目标/期望',
-             showOverflowTooltip: true,
-             align: 'center',
-             minWidth: 110
-         },
-         ],
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 200,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName'
+          },
+          {
+            width: 120,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode'
+          },
+          {
+            width: 200,
+            prop: 'productCategoryName',
+            label: '类型',
+            slot: 'productCategoryName'
+          },
+          {
+            width: 160,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand'
+          },
+          {
+            width: 120,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType'
+          },
+          {
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification'
+          },
+
+          {
+            width: 160,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice'
+          },
+          {
+            width: 120,
+            prop: 'totalCount',
+            label: '数量',
+            slot: 'totalCount'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '销售总金额',
+            slot: 'totalPrice',
+            formatter: (_row, _column, cellValue) => {
+              return _row.totalPrice + '元';
+            }
+          },
+          {
+            width: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit'
+          },
+          {
+            width: 120,
+            prop: 'deliveryDays',
+            label: '交期(天)',
+            slot: 'deliveryDays'
+          },
+          {
+            width: 200,
+            prop: 'guaranteePeriod',
+            label: '质保期',
+            slot: 'guaranteePeriod',
+            formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
+            }
+          },
+          // {
+          //   width: 120,
+          //   prop: 'guaranteePeriodUnitCode',
+          //   label: '',
+          //   slot: 'guaranteePeriodUnitCode'
+          // },
+          {
+            width: 120,
+            prop: 'technicalAnswerName',
+            label: '技术答疑人',
+            slot: 'technicalAnswerName'
+          },
+          {
+            width: 220,
+            prop: 'technicalParams',
+            label: '技术参数',
+            slot: 'technicalParams'
+          },
+          {
+            width: 240,
+            prop: 'technicalDrawings',
+            label: '技术图纸',
+            slot: 'technicalDrawings',
+            formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
+            }
+          },
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark'
+          }
+        ],
         ifChiefList: [
           {
             value: 0,
@@ -189,45 +361,45 @@ export default {
             value: 1,
             label: '是'
           }
-        ],
+        ]
       };
     },
     methods: {
       async open(row) {
         this.form = row;
         this.visible = true;
-        this.getDetailData(row.id)
+        this.getDetailData(row.id);
       },
 
       cancel() {
         this.$nextTick(() => {
           // 关闭后,销毁所有的表单数据
-          this.form = copyObj(this.formDef),
-          this.otherForm = copyObj(this.otherFormDef),
-          this.tableBankData = []
-          this.tableLinkData = []
+          (this.form = copyObj(this.formDef)),
+            (this.otherForm = copyObj(this.otherFormDef)),
+            (this.tableBankData = []);
+          this.tableLinkData = [];
           this.visible = false;
-        })
+        });
       },
-
-      async getDetailData (id) {
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      async getDetailData(id) {
         this.loading = true;
         const data = await getDetail(id);
         this.loading = false;
         if (data) {
           this.detailData = data;
-          
         }
-      },
-
+      }
     }
   };
 </script>
 
 <style scoped lang="scss">
-.ele-dialog-form{
-  .el-form-item{
-    margin-bottom: 10px;
+  .ele-dialog-form {
+    .el-form-item {
+      margin-bottom: 10px;
+    }
   }
-}
 </style>

+ 210 - 131
src/views/saleManage/businessOpportunity/components/personnelAddTable.vue

@@ -1,91 +1,162 @@
 <template>
-    <el-form ref="form" :model="form" :rules="rules">
-      <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="form.datasource"
-        cache-key="systemRoleTable17" class="time-form">
-        <!-- 表头工具栏 -->
-        <template v-slot:toolbar>
-          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd">
-            新增
-          </el-button>
-        </template>
-        <template v-slot:linkId="scope">
-          <el-form-item style="margin-bottom: 20px;" :prop="'datasource.' + scope.$index + '.linkId'" :rules="{
+  <el-form ref="form" :model="form" :rules="rules">
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="form.datasource"
+      cache-key="systemRoleTable17"
+      class="time-form"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="handlAdd"
+        >
+          新增
+        </el-button>
+      </template>
+      <template v-slot:linkId="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.linkId'"
+          :rules="{
             required: true,
             message: '请选择',
             trigger: 'change'
-          }">
-           <el-select v-model="scope.row.linkId" placeholder="请选择"  @change="changePersonel(scope.row, $event)" >
-                 <el-option
-                   v-for="item in linkNameOptions"
-                   :key="item.id"
-                   :label="item.linkName"
-                   :value="item.id">
-                 </el-option>
-               </el-select>
-          </el-form-item>
-        </template>
-        <template v-slot:linkPost="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.linkPost'">
-            <el-input v-model="scope.row.linkPost" disabled placeholder="请输入"></el-input>
-          </el-form-item>
-        </template>
-        <template v-slot:linkMobilePhone="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.linkMobilePhone'" >
-            <el-input v-model="scope.row.linkMobilePhone" disabled placeholder="请输入"></el-input>
-          </el-form-item>
-        </template>
-        <template v-slot:goal="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.goal'" :rules="{
+          }"
+        >
+          <el-select
+            v-model="scope.row.linkId"
+            placeholder="请选择"
+            @change="changePersonel(scope.row, $event)"
+          >
+            <el-option
+              v-for="item in linkNameOptions"
+              :key="item.id"
+              :label="item.linkName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </template>
+      <template v-slot:linkPost="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.linkPost'"
+        >
+          <el-input
+            v-model="scope.row.linkPost"
+            disabled
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:linkMobilePhone="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.linkMobilePhone'"
+        >
+          <el-input
+            v-model="scope.row.linkMobilePhone"
+            disabled
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:goal="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.goal'"
+          :rules="{
             required: true,
             message: '请输入',
             trigger: 'change'
-          }">
-            <el-input v-model="scope.row.goal" placeholder="请输入"></el-input>
-          </el-form-item>
-        </template>
-        <template v-slot:influenceCode="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.influenceCode'" :rules="{
+          }"
+        >
+          <el-input v-model="scope.row.goal" placeholder="请输入"></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:influenceCode="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.influenceCode'"
+          :rules="{
             required: true,
             message: '请选择',
             trigger: 'change'
-          }">
-             <DictSelection dictName="影响力" clearable v-model="scope.row.influenceCode">
-                </DictSelection>
-          </el-form-item>
-        </template>
-        <template v-slot:attitudeCode="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.attitudeCode'" :rules="{
+          }"
+        >
+          <DictSelection
+            dictName="影响力"
+            clearable
+            v-model="scope.row.influenceCode"
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
+      <template v-slot:attitudeCode="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.attitudeCode'"
+          :rules="{
             required: true,
             message: '请选择',
             trigger: 'change'
-          }">
-            <DictSelection dictName="态度" clearable v-model="scope.row.attitudeCode">
-                </DictSelection>
-          </el-form-item>
-        </template>
-       
-        <!-- 操作列 -->
-        <template v-slot:action="{ row }">
-          <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>
-        </template>
-      </ele-pro-table>
-    </el-form>
-  </template>
-  <script>
-  import { getcontactlink} from '@/api/saleManage/businessFollow';
+          }"
+        >
+          <DictSelection
+            dictName="态度"
+            clearable
+            v-model="scope.row.attitudeCode"
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
+      <template v-slot:headerLinkId="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerGoal="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerInfluenceCode="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerAttitudeCode="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+  </el-form>
+</template>
+<script>
+  import { getcontactlink } from '@/api/saleManage/businessFollow';
   import dictMixins from '@/mixins/dictMixins';
   export default {
     props: {
       delDetailIds: Array,
-      contactId:{
-        type:String,
-        default:''
+      contactId: {
+        type: String,
+        default: ''
       }
     },
     mixins: [dictMixins],
@@ -97,13 +168,13 @@
         linkMobilePhone: '',
         goal: '',
         influenceCode: '',
-        influenceName:'',
-        attitudeCode:'',
-        attitudeName:''
+        influenceName: '',
+        attitudeCode: '',
+        attitudeName: ''
       };
       return {
-        newContactId:'',
-        linkNameOptions:[],
+        newContactId: '',
+        linkNameOptions: [],
         defaultForm,
         form: {
           datasource: []
@@ -117,11 +188,12 @@
             align: 'center',
             fixed: 'left'
           },
-          
+
           {
             prop: 'linkId',
             label: '姓名',
-            slot: 'linkId'
+            slot: 'linkId',
+            headerSlot:"headerLinkId"
           },
           {
             prop: 'linkPost',
@@ -136,17 +208,23 @@
           {
             prop: 'goal',
             label: '项目目标/期望',
-            slot: 'goal'
+            slot: 'goal',
+            headerSlot:"headerGoal"
+
           },
           {
             prop: 'influenceCode',
             label: '影响力',
-            slot: 'influenceCode'
+            slot: 'influenceCode',
+            headerSlot:"headerInfluenceCode"
+
           },
           {
             prop: 'attitudeCode',
             label: '态度',
-            slot: 'attitudeCode'
+            slot: 'attitudeCode',
+            headerSlot:"headerAttitudeCode"
+
           },
           {
             width: 100,
@@ -157,7 +235,7 @@
             slot: 'action',
             showOverflowTooltip: true
           }
-        ],
+        ]
       };
     },
     computed: {
@@ -165,50 +243,55 @@
         return this.form.datasource.length;
       }
     },
-    watch:{
-        contactId(val){
-           if(val){
-            this.newContactId=val
-            this.getContactIdInfo()
-           }
+    watch: {
+      contactId(val) {
+        if (val) {
+          this.newContactId = val;
+          this.getContactIdInfo();
         }
-
+      }
     },
     methods: {
-          //初始数据
-    async getContactIdInfo() {
-      const data = await getcontactlink({contactId:this.newContactId});
-         if(data&&data?.length){
-           this.linkNameOptions=data
-         }
-    },
-     //修改回显
-     putTableValue(data){
-        if(data&&data?.length){
-            this.form.datasource=data
+      //初始数据
+      async getContactIdInfo() {
+        const data = await getcontactlink({ contactId: this.newContactId });
+        if (data && data?.length) {
+          this.linkNameOptions = data;
         }
       },
-     // 返回列表数据
-     getTableValue(){
-      let _datasource=this.form.datasource||[]
-      if(_datasource.length===0) return
-         _datasource.forEach((v,index)=>{
-            if(_datasource[index].influenceCode){
-              _datasource[index].influenceName=this.getDictValue('影响力', _datasource[index].influenceCode)
-            }
-            if(_datasource[index].attitudeCode){
-              _datasource[index].attitudeName=this.getDictValue('态度', _datasource[index].attitudeCode)
-            }
-        })
-         return _datasource
+      //修改回显
+      putTableValue(data) {
+        if (data && data?.length) {
+          this.form.datasource = data;
+        }
+      },
+      // 返回列表数据
+      getTableValue() {
+        let _datasource = this.form.datasource || [];
+        if (_datasource.length === 0) return;
+        _datasource.forEach((v, index) => {
+          if (_datasource[index].influenceCode) {
+            _datasource[index].influenceName = this.getDictValue(
+              '影响力',
+              _datasource[index].influenceCode
+            );
+          }
+          if (_datasource[index].attitudeCode) {
+            _datasource[index].attitudeName = this.getDictValue(
+              '态度',
+              _datasource[index].attitudeCode
+            );
+          }
+        });
+        return _datasource;
+      },
+      //选择关键人
+      changePersonel(row, val) {
+        console.log(row, val);
+        let selectVal = this.linkNameOptions.find((v) => v.id === val);
+        row.linkPost = selectVal.post;
+        row.linkMobilePhone = selectVal.phone;
       },
-        //选择关键人
-        changePersonel(row, val){
-         console.log(row,val)
-         let selectVal=this.linkNameOptions.find(v=>v.id===val)
-         row.linkPost=selectVal.post
-         row.linkMobilePhone=selectVal.phone
-        },
       remove(row) {
         let index = this.form.datasource.findIndex((n) => n.key == row.key);
         if (index !== -1) {
@@ -231,29 +314,25 @@
       },
       // 添加
       handlAdd() {
-        if(!this.newContactId){
-            return this.$message.error('请先选择客户')
+        if (!this.newContactId) {
+          return this.$message.error('请先选择客户');
         }
         let item = JSON.parse(JSON.stringify(this.defaultForm));
         item.key = this.form.datasource.length + 1;
         this.form.datasource.push(item);
       },
- 
 
-      validateForm (callback) {
+      validateForm(callback) {
         //开始表单校验
         this.$refs.form.validate((valid) => {
           callback(valid);
         });
-      },
-  
-  
+      }
     }
   };
-  </script>
-  <style lang="scss" scoped>
+</script>
+<style lang="scss" scoped>
   .time-form .el-form-item {
     margin-bottom: 0 !important;
   }
-  </style>
-  
+</style>

+ 179 - 147
src/views/saleManage/businessOpportunity/index.vue

@@ -2,142 +2,164 @@
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
       <div class="ele-border-lighter form-content" v-loading="loading">
-            <opportunity-search @search="reload"> </opportunity-search>
+        <opportunity-search @search="reload"> </opportunity-search>
 
-            <!-- 数据表格 -->
-            <ele-pro-table
-              ref="table"
-              :columns="columns"
-              :datasource="datasource"
-              height="calc(100vh - 300px)"
-              full-height="calc(100vh - 116px)"
-              tool-class="ele-toolbar-form"
-              :selection.sync="selection"
-              cache-key="eomContactPageTable"
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 300px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          cache-key="eomContactPageTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="openEdit('add', {})"
             >
-              <!-- 表头工具栏 -->
-              <template v-slot:toolbar>
-                <el-button
-                  size="small"
-                  type="primary"
-                  icon="el-icon-plus"
-                  class="ele-btn-icon"
-                  @click="openEdit('add',{})"
-                >
-                  新建
-                </el-button>
-                <el-button
-                  size="small"
-                  type="danger"
-                  el-icon-delete
-                  class="ele-btn-icon"
-                  @click="allDelBtn"
-                  :disabled="selection?.length===0"
-                >
-                  批量删除
-                </el-button>
-              </template>
+              新建
+            </el-button>
+            <el-button
+              size="small"
+              type="danger"
+              el-icon-delete
+              class="ele-btn-icon"
+              @click="allDelBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量删除
+            </el-button>
+          </template>
 
-              <template v-slot:name="{ row }">
-                <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.name }}</el-link>
-              </template>
+          <template v-slot:name="{ row }">
+            <el-link type="primary" :underline="false" @click="openDetail(row)">
+              {{ row.name }}</el-link
+            >
+          </template>
 
-              <!-- 操作列 -->
-              <template v-slot:action="{ row }">
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  icon="el-icon-edit"
-                  @click="handleFollow(row)"
-                >
-                  跟进
-                </el-link>
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  icon="el-icon-edit"
-                  @click="openEdit('edit',row)"
-                >
-                  修改
-                </el-link>
-                <el-link
-                  v-if="row.status===2"
-                  type="primary"
-                  :underline="false"
-                  icon="el-icon-check"
-                  @click="enableOption(row)"
-                >
-                  启用
-                </el-link>
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="handleFollow(row)"
+              v-if="[0, 3].includes(row.approvalStatus)"
+            >
+              跟进
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              v-if="[0, 3].includes(row.approvalStatus)"
+              @click="openEdit('edit', row)"
+            >
+              修改
+            </el-link>
+            <el-link
+              v-if="row.status === 2"
+              type="primary"
+              :underline="false"
+              icon="el-icon-check"
+              @click="enableOption(row)"
+            >
+              启用
+            </el-link>
+            <el-link
+              v-if="row.status === 1"
+              type="primary"
+              :underline="false"
+              icon="el-icon-close"
+              @click="disableOption(row)"
+            >
+              禁用
+            </el-link>
+
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此信息吗?"
+              @confirm="remove(row)"
+            >
+              <template v-slot:reference>
                 <el-link
-                  v-if="row.status===1"
-                  type="primary"
+                  type="danger"
                   :underline="false"
-                  icon="el-icon-close"
-                  @click="disableOption(row)"
+                  icon="el-icon-delete"
+                  v-if="[0, 3].includes(row.approvalStatus)"
                 >
-                  禁用
+                  删除
                 </el-link>
-
-                <el-popconfirm
-                  class="ele-action"
-                  title="确定要删除此信息吗?"
-                  @confirm="remove(row)"
-                >
-                  <template v-slot:reference>
-                    <el-link
-                      type="danger"
-                      :underline="false"
-                      icon="el-icon-delete"
-                    >
-                      删除
-                    </el-link>
-                  </template>
-                </el-popconfirm>
               </template>
-            </ele-pro-table>
-          </div>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </div>
     </el-card>
 
-
-    <add-opportunity-dialog ref="addContactDialogRef" :categoryTreeList="treeList" @done="reload"></add-opportunity-dialog>
-    <opportunity-detail-dialog ref="contactDetailDialogRef"></opportunity-detail-dialog>
+    <add-opportunity-dialog
+      ref="addContactDialogRef"
+      :categoryTreeList="treeList"
+      @done="reload"
+    ></add-opportunity-dialog>
+    <opportunity-detail-dialog
+      ref="contactDetailDialogRef"
+    ></opportunity-detail-dialog>
     <follow-list ref="followDialogRef"></follow-list>
-<!-- 多选删除弹窗 -->
-    <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+    <!-- 多选删除弹窗 -->
+    <pop-modal
+      :visible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
   </div>
 </template>
 
 <script>
-import opportunitySearch from './components/opportunitySearch.vue';
-import addOpportunityDialog from './components/addOpportunityDialog.vue';
-import opportunityDetailDialog from './components/opportunityDetailDialog.vue';
-import followList from './components/followList.vue';
-import popModal from '@/components/pop-modal';
-import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/businessOpportunity';
-import dictMixins from '@/mixins/dictMixins';
+  import opportunitySearch from './components/opportunitySearch.vue';
+  import addOpportunityDialog from './components/addOpportunityDialog.vue';
+  import opportunityDetailDialog from './components/opportunityDetailDialog.vue';
+  import followList from './components/followList.vue';
+  import popModal from '@/components/pop-modal';
+  import {
+    getTableList,
+    getDetail,
+    UpdateInformation,
+    addInformation,
+    deleteInformation,
+    updateStatus
+  } from '@/api/saleManage/businessOpportunity';
+  import dictMixins from '@/mixins/dictMixins';
+  import { reviewStatus } from '@/enum/dict';
 
-export default {
+  export default {
     mixins: [dictMixins],
     components: {
       opportunitySearch,
       followList,
       popModal,
       addOpportunityDialog,
-      opportunityDetailDialog,
+      opportunityDetailDialog
     },
     data() {
       return {
-        selection:[],
-        delVisible:false,
+        selection: [],
+        delVisible: false,
         // 加载状态
         loading: false,
         columns: [
-        {
-             width: 45,
-             type: 'selection',
-             columnKey: 'selection',
-             align: 'center'
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
           },
           {
             columnKey: 'index',
@@ -155,7 +177,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 140
           },
-         
+
           {
             prop: 'name',
             label: '商机名称',
@@ -185,7 +207,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.budget+'万元';
+              return _row.budget + '万元';
             }
           },
           {
@@ -195,7 +217,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.winRate+'%';
+              return _row.winRate + '%';
             }
           },
           {
@@ -205,7 +227,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.expectedClosingDate?.substr(0,10)||'';
+              return _row.expectedClosingDate?.substr(0, 10) || '';
             }
           },
           {
@@ -222,10 +244,10 @@ export default {
             showOverflowTooltip: true,
             minWidth: 120
           },
-         
+
           {
             prop: 'status',
-            label: '状态',
+            label: '启用状态',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 100,
@@ -233,6 +255,16 @@ export default {
               return _row.status === 1 ? '启用' : '禁用';
             }
           },
+          {
+            prop: 'approvalStatus',
+            label: '审核状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.approvalStatus];
+            }
+          },
           {
             prop: 'createTime',
             label: '创建时间',
@@ -251,7 +283,7 @@ export default {
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true,
-            fixed: 'right',
+            fixed: 'right'
           }
         ],
         current: {},
@@ -264,7 +296,7 @@ export default {
           children: 'children',
           label: 'name'
         },
-        showEdit: true,
+        showEdit: true
       };
     },
     computed: {},
@@ -280,32 +312,32 @@ export default {
           ...where
         });
       },
-    
+
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
-      openEdit(type,row) {
+      openEdit(type, row) {
         this.current = row;
         this.showEdit = true;
-        this.$refs.addContactDialogRef.open( type,row, row.id);
+        this.$refs.addContactDialogRef.open(type, row, row.id);
         this.$refs.addContactDialogRef.$refs.form &&
-        this.$refs.addContactDialogRef.$refs.form.clearValidate();
+          this.$refs.addContactDialogRef.$refs.form.clearValidate();
       },
       //跟进
-      handleFollow(row){
+      handleFollow(row) {
         this.current = row;
-        this.$refs.followDialogRef.open(row)
+        this.$refs.followDialogRef.open(row);
       },
       //批量删除
-      allDelBtn(){
-        if(this.selection.length===0) return
-        this.delVisible=true
+      allDelBtn() {
+        if (this.selection.length === 0) return;
+        this.delVisible = true;
       },
-      
-      commitBtn(){
-        console.log(this.selection)
-        const dataId=this.selection.map(v=>v.id)
+
+      commitBtn() {
+        console.log(this.selection);
+        const dataId = this.selection.map((v) => v.id);
         deleteInformation(dataId).then((res) => {
           this.$message.success('删除成功!');
           this.reload();
@@ -321,7 +353,7 @@ export default {
       enableOption(row) {
         updateStatus(row.id, 1)
           .then((msg) => {
-            this.$message.success("启用成功");
+            this.$message.success('启用成功');
             this.reload();
           })
           .catch((e) => {
@@ -332,36 +364,36 @@ export default {
       disableOption(row) {
         updateStatus(row.id, 2)
           .then((msg) => {
-            this.$message.success("禁用成功");
+            this.$message.success('禁用成功');
             this.reload();
           })
           .catch((e) => {
             this.$message.error(e.message);
           });
       },
-      openDetail(row){
+      openDetail(row) {
         this.$refs.contactDetailDialogRef.open(row);
-      },
+      }
     }
   };
 </script>
 
 <style lang="scss" scoped>
-:deep(.el-link--inner){
-  margin-left: 0px !important;
-}
+  :deep(.el-link--inner) {
+    margin-left: 0px !important;
+  }
 
-.sys-organization-list {
-  height: calc(100vh - 264px);
-  box-sizing: border-box;
-  border-width: 1px;
-  border-style: solid;
-  overflow: auto;
-}
-.sys-organization-list :deep(.el-tree-node__content) {
-  height: 40px;
-  & > .el-tree-node__expand-icon {
-    margin-left: 10px;
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
   }
-}
 </style>

+ 17 - 2
src/views/saleManage/quotation/components/addDialog.vue

@@ -34,6 +34,7 @@
               v-model="form.opportunityId"
               placeholder="请选择"
               style="width: 100%"
+              @change="opportunityChange"
             >
               <el-option
                 v-for="item in businessList"
@@ -157,7 +158,7 @@
             <el-input
               clearable
               v-model="form.quoteLinkName"
-              @click.native="handHead"
+              @click.native="handHead()"
               placeholder="请输入"
             />
           </el-form-item>
@@ -285,6 +286,9 @@
     addInformation,
     submit
   } from '@/api/saleManage/quotation';
+  import {
+    getOpportunityDetail,
+  } from '@/api/saleManage/businessOpportunity';
   import { getTableList } from '@/api/saleManage/businessOpportunity';
   import { enterprisePage } from '@/api/contractManage/contractBook';
   import { getcontactlink } from '@/api/saleManage/businessFollow';
@@ -443,6 +447,17 @@
           });
         }
       },
+      opportunityChange(id){
+        console.log(id,'id')
+        getOpportunityDetail(id).then(res=>{
+          if(res.productList.length>0){
+            this.$refs.inventoryTable &&
+              this.$refs.inventoryTable.putTableValue(res.productList);
+          }
+
+        })
+
+      },
 
       //更新联系人数据
       async getLinkInfo(contactId) {
@@ -485,7 +500,7 @@
         let item = {
           id: this.form.quoteLinkId
         };
-        this.$refs.headRef.open(item, 0);
+        this.$refs.headRef.open(item, 0,title);
       },
       //选择报价方人回调
       changePersonel(obj, index, title) {

+ 364 - 364
src/views/saleManage/quotation/components/detailDialog.vue

@@ -1,392 +1,392 @@
 <template>
-    <ele-modal
+  <ele-modal
     custom-class="ele-dialog-form long-dialog-form"
-      :centered="true"
-      v-if="visible"
-      :visible.sync="visible"
-      :title="title"
-      :close-on-click-modal="false"
-      width="80%"
-      @close="cancel"
-    >
- 
-        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-         
-     <headerTitle title="基本信息">
-      <el-button
-                  size="small"
-                  type="primary"
-                  icon="el-icon-s-grid"
-                  class="ele-btn-icon"
-                  @click="exportTable"
-                >
-                 导出
-                </el-button>
-     </headerTitle>
-       <el-row>
-         <el-col :span="12">
+    :centered="true"
+    v-if="visible"
+    :visible.sync="visible"
+    :title="title"
+    :close-on-click-modal="false"
+    width="80%"
+    @close="cancel"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <headerTitle title="基本信息">
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-s-grid"
+          class="ele-btn-icon"
+          @click="exportTable"
+        >
+          导出
+        </el-button>
+      </headerTitle>
+      <el-row>
+        <el-col :span="12">
           <el-form-item
-             label="关联商机名称"
-             prop="opportunityName"
-             style="margin-bottom: 22px"
-           >
-           {{detailData.opportunityName}}
-           </el-form-item>
-           <el-form-item
-             label="询价方名称"
-             prop="contactName"
-             style="margin-bottom: 22px"
-           >
-           {{form.contactName}}
-           </el-form-item>
-       
-           <el-form-item
-             label="询价方联系人"
-             prop="contactLinkName"
-             style="margin-bottom: 22px"
-           >
-           {{form.contactLinkName}}
-           </el-form-item>
-           
-           <el-form-item
-             label="询价方电话"
-             prop="contactTel"
-             style="margin-bottom: 22px"
-           >
-           {{form.contactTel}}
-           </el-form-item>
-           <el-form-item
-             label="询价方传真"
-             prop="contactFax"
-             style="margin-bottom: 22px"
-           >
-           {{form.contactFax}}
-           </el-form-item>
-           <el-form-item
-             label="询价方Email"
-             prop="contactEmail"
-             style="margin-bottom: 22px"
-           >
-           {{form.contactEmail}}
-           </el-form-item>
-           <el-form-item
-             label="询价方地址"
-             prop="contactAddress"
-             style="margin-bottom: 22px"
-           >
-           {{form.contactAddress}}
-           </el-form-item>
-         <el-form-item prop="askFile" label="询价单附件">
-          <el-link v-if="form.askFile && form.askFile !== ''"
-                         type="primary" :underline="false"
-                         @click="downloadFile(form.askFile)"> {{ form.askFile.name }}</el-link>
-             </el-form-item>
-         
-         </el-col>
-         <el-col :span="12">
-           <el-form-item
-             label="报价方名称"
-             prop="quoteName"
-             style="margin-bottom: 22px"
-           >
-           {{form.quoteName}}
-           </el-form-item>
-
-           <el-form-item
-             label="报价方联系人"
-             prop="quoteLinkName"
-             style="margin-bottom: 22px"
-           >
-           {{form.quoteLinkName}}
-           </el-form-item>
-           <el-form-item prop="quoteTel" label="报价方联系电话">
-            {{form.quoteTel}}
-             </el-form-item>
-             <el-form-item prop="quoteFax" label="报价方传真">
-              {{form.quoteFax}}
-             </el-form-item>
-
-             <el-form-item
-             label="报价方Email"
-             prop="quoteEmail"
-             style="margin-bottom: 22px"
-           >
-           {{form.quoteEmail}}
-           </el-form-item>
+            label="关联商机名称"
+            prop="opportunityName"
+            style="margin-bottom: 22px"
+          >
+            {{ detailData.opportunityName }}
+          </el-form-item>
+          <el-form-item
+            label="询价方名称"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            {{ form.contactName }}
+          </el-form-item>
 
-           <el-form-item
-             label="报价方地址"
-             prop="quoteAddress"
-             style="margin-bottom: 22px"
-           >
-           {{form.quoteAddress}}
-           </el-form-item>
+          <el-form-item
+            label="询价方联系人"
+            prop="contactLinkName"
+            style="margin-bottom: 22px"
+          >
+            {{ form.contactLinkName }}
+          </el-form-item>
 
-         </el-col>
-       </el-row>
+          <el-form-item
+            label="询价方电话"
+            prop="contactTel"
+            style="margin-bottom: 22px"
+          >
+            {{ form.contactTel }}
+          </el-form-item>
+          <el-form-item
+            label="询价方传真"
+            prop="contactFax"
+            style="margin-bottom: 22px"
+          >
+            {{ form.contactFax }}
+          </el-form-item>
+          <el-form-item
+            label="询价方Email"
+            prop="contactEmail"
+            style="margin-bottom: 22px"
+          >
+            {{ form.contactEmail }}
+          </el-form-item>
+          <el-form-item
+            label="询价方地址"
+            prop="contactAddress"
+            style="margin-bottom: 22px"
+          >
+            {{ form.contactAddress }}
+          </el-form-item>
+          <el-form-item prop="askFile" label="询价单附件">
+            <el-link
+              v-if="form.askFile && form.askFile !== ''"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(form.askFile)"
+            >
+              {{ form.askFile.name }}</el-link
+            >
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="报价方名称"
+            prop="quoteName"
+            style="margin-bottom: 22px"
+          >
+            {{ form.quoteName }}
+          </el-form-item>
 
+          <el-form-item
+            label="报价方联系人"
+            prop="quoteLinkName"
+            style="margin-bottom: 22px"
+          >
+            {{ form.quoteLinkName }}
+          </el-form-item>
+          <el-form-item prop="quoteTel" label="报价方联系电话">
+            {{ form.quoteTel }}
+          </el-form-item>
+          <el-form-item prop="quoteFax" label="报价方传真">
+            {{ form.quoteFax }}
+          </el-form-item>
 
+          <el-form-item
+            label="报价方Email"
+            prop="quoteEmail"
+            style="margin-bottom: 22px"
+          >
+            {{ form.quoteEmail }}
+          </el-form-item>
 
-     
-   
-    
-       <el-row style="margin-top:20px">
-         <el-col :span="6">
-           <el-form-item prop="taxRate" label="税率">
-            {{form.taxRate}}%
-             </el-form-item>
-           </el-col>
-         <el-col :span="6">
-           <el-form-item prop="deliveryDate" label="交货日期">
-            {{form.deliveryDate?.substr(0,10)}}
-             </el-form-item>
-           </el-col>
-           <el-col :span="6">
-           <el-form-item
-             label="付款方式"
-             prop="payWay"
-             style="margin-bottom: 22px"
-           >
-           {{form.payWayName}}
-           </el-form-item>
-         </el-col>
-         <el-col :span="6">
-           <el-form-item label="是否接受拆单" prop="acceptUnpack" style="margin-bottom: 22px">
-            {{form.acceptUnpack==1?'接受':'不接受'}}
-           </el-form-item>
-         </el-col>
-       </el-row>
-   </el-form>
+          <el-form-item
+            label="报价方地址"
+            prop="quoteAddress"
+            style="margin-bottom: 22px"
+          >
+            {{ form.quoteAddress }}
+          </el-form-item>
+        </el-col>
+      </el-row>
 
+      <el-row style="margin-top: 20px">
+        <el-col :span="6">
+          <el-form-item prop="taxRate" label="税率">
+            {{ form.taxRate }}%
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item prop="deliveryDate" label="交货日期">
+            {{ form.deliveryDate?.substr(0, 10) }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item
+            label="付款方式"
+            prop="payWay"
+            style="margin-bottom: 22px"
+          >
+            {{ form.payWayName }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item
+            label="是否接受拆单"
+            prop="acceptUnpack"
+            style="margin-bottom: 22px"
+          >
+            {{ form.acceptUnpack == 1 ? '接受' : '不接受' }}
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
 
-       
-        <headerTitle title="报价单产品清单"></headerTitle>
-        <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns"  :toolkit="[]" :datasource="detailData.quoteProductList" row-key="id">
-          <template v-slot:toolbar>
+    <headerTitle title="报价单产品清单"></headerTitle>
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="competAnalysisListcolumns"
+      :toolkit="[]"
+      :datasource="detailData.quoteProductList"
+      row-key="id"
+    >
+      <template v-slot:toolbar>
         <div class="headbox">
-        <span class="amount">总计:{{form.totalPrice}}元</span>
-       
-      </div>
+          <span class="amount">总计:{{ form.totalPrice }}元</span>
+        </div>
       </template>
-          <template v-slot:technicalDrawings="{ row }">
-            <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
-            <el-link 
-            v-for="link in row.technicalDrawings" :key="link.id"
-                         type="primary" :underline="false"
-                         @click="downloadFile(link)"> {{ link.name }}</el-link>
-                        </div>
-                        </template>
-                     
-          </ele-pro-table>
-       
-      <div slot="footer" class="footer">
-        <el-button @click="cancel">返回</el-button>
-      </div>
-    </ele-modal>
-  </template>
-  
-  <script>
-  import { getDetail,getExport} from '@/api/saleManage/quotation';
-  import {getFile} from '@/api/system/file';
+      <template v-slot:technicalDrawings="{ row }">
+        <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+          <el-link
+            v-for="link in row.technicalDrawings"
+            :key="link.id"
+            type="primary"
+            :underline="false"
+            @click="downloadFile(link)"
+          >
+            {{ link.name }}</el-link
+          >
+        </div>
+      </template>
+    </ele-pro-table>
+
+    <div slot="footer" class="footer">
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getDetail, getExport } from '@/api/saleManage/quotation';
+  import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
-  import {download } from '@/utils/file';
-  import {copyObj} from '@/utils/util';
-  
-  
+  import { download } from '@/utils/file';
+  import { copyObj } from '@/utils/util';
+
   export default {
-      mixins: [dictMixins],
-      data() {
-      
-        return {
-          visible: false,
-          detailId:'',
-          title: '详情',
-          row: {},
-          activeName: 'base',
-          form:{},
-          rules:{},
-          detailData:{},
-          competAnalysisListcolumns: [
-        
+    mixins: [dictMixins],
+    data() {
+      return {
+        visible: false,
+        detailId: '',
+        title: '详情',
+        row: {},
+        activeName: 'base',
+        form: {},
+        rules: {},
+        detailData: {},
+        competAnalysisListcolumns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 200,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName'
+          },
+          {
+            width: 120,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode'
+          },
+          {
+            width: 200,
+            prop: 'productCategoryName',
+            label: '类型',
+            slot: 'productCategoryName'
+          },
+          {
+            width: 160,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand'
+          },
           {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          width: 200,
-          prop: 'productName',
-          label: '名称',
-          slot: 'productName'
-        },
-        {
-          width: 120,
-          prop: 'productCode',
-          label: '编码',
-          slot: 'productCode'
-        },
-        {
-          width: 200,
-          prop: 'productCategoryName',
-          label: '类型',
-          slot: 'productCategoryName'
-        },
-        {
-          width: 160,
-          prop: 'productBrand',
-          label: '牌号',
-          slot: 'productBrand'
-        },
-        {
-          width: 120,
-          prop: 'modelType',
-          label: '型号',
-          slot: 'modelType'
-        },
-        {
-          width: 120,
-          prop: 'specification',
-          label: '规格',
-          slot: 'specification'
-        },
-       
-        {
-          width: 160,
-          prop: 'singlePrice',
-          label: '单价',
-          slot: 'singlePrice'
-        },
-        {
-          width: 120,
-          prop: 'totalCount',
-          label: '数量',
-          slot: 'totalCount'
-        },
-        {
-          width: 120,
-          prop: 'totalPrice',
-          label: '销售总金额',
-          slot: 'totalPrice',
-          formatter: (_row, _column, cellValue) => {
-              return _row.totalPrice+'元'
+            width: 120,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType'
+          },
+          {
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification'
+          },
+
+          {
+            width: 160,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice'
+          },
+          {
+            width: 120,
+            prop: 'totalCount',
+            label: '数量',
+            slot: 'totalCount'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '销售总金额',
+            slot: 'totalPrice',
+            formatter: (_row, _column, cellValue) => {
+              return _row.totalPrice + '元';
             }
-        },
-        {
-          width: 120,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          slot: 'measuringUnit'
-        },
-        {
-          width: 120,
-          prop: 'deliveryDays',
-          label: '交期(天)',
-          slot: 'deliveryDays'
-        },
-        {
-          width: 200,
-          prop: 'guaranteePeriod',
-          label: '质保期',
-          slot: 'guaranteePeriod',
-          formatter: (_row, _column, cellValue) => {
-              return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+          },
+          {
+            width: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit'
+          },
+          {
+            width: 120,
+            prop: 'deliveryDays',
+            label: '交期(天)',
+            slot: 'deliveryDays'
+          },
+          {
+            width: 200,
+            prop: 'guaranteePeriod',
+            label: '质保期',
+            slot: 'guaranteePeriod',
+            formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
             }
-        },
-        // {
-        //   width: 120,
-        //   prop: 'guaranteePeriodUnitCode',
-        //   label: '',
-        //   slot: 'guaranteePeriodUnitCode'
-        // },
-         {
-          width: 120,
-          prop: 'technicalAnswerName',
-          label: '技术答疑人',
-          slot: 'technicalAnswerName'
-        },
-        {
-          width: 220,
-          prop: 'technicalParams',
-          label: '技术参数',
-          slot: 'technicalParams'
-        },
-        {
-          width:240,
-          prop: 'technicalDrawings',
-          label: '技术图纸',
-          slot: 'technicalDrawings',
-          formatter: (_row, _column, cellValue) => {
-              return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+          },
+          // {
+          //   width: 120,
+          //   prop: 'guaranteePeriodUnitCode',
+          //   label: '',
+          //   slot: 'guaranteePeriodUnitCode'
+          // },
+          {
+            width: 120,
+            prop: 'technicalAnswerName',
+            label: '技术答疑人',
+            slot: 'technicalAnswerName'
+          },
+          {
+            width: 220,
+            prop: 'technicalParams',
+            label: '技术参数',
+            slot: 'technicalParams'
+          },
+          {
+            width: 240,
+            prop: 'technicalDrawings',
+            label: '技术图纸',
+            slot: 'technicalDrawings',
+            formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
             }
+          },
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark'
+          }
+        ]
+      };
+    },
+    methods: {
+      //导出
+      async exportTable() {
+        this.loading = true;
+        const response = await getExport(this.detailId);
+      },
+      async open(row) {
+        this.form = row;
+        this.visible = true;
+        this.getDetailData(row.id);
+        this.detailId = row.id;
+      },
 
-        },
-        {
-          width: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark'
-        }
-           ],
-        };
+      cancel() {
+        this.$nextTick(() => {
+          // 关闭后,销毁所有的表单数据
+          (this.form = copyObj(this.formDef)),
+            (this.otherForm = copyObj(this.otherFormDef)),
+            (this.tableBankData = []);
+          this.tableLinkData = [];
+          this.visible = false;
+        });
       },
-      methods: {
-         //导出
-       async exportTable(){
-        this.loading = true;
-          const response = await getExport(this.detailId);
-         
-     },
-        async open(row) {
-          this.form = row;
-          this.visible = true;
-          this.getDetailData(row.id)
-          this.detailId=row.id
-        },
-  
-        cancel() {
-          this.$nextTick(() => {
-            // 关闭后,销毁所有的表单数据
-            this.form = copyObj(this.formDef),
-            this.otherForm = copyObj(this.otherFormDef),
-            this.tableBankData = []
-            this.tableLinkData = []
-            this.visible = false;
-          })
-        },
-        downloadFile(file){
+      downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);
       },
-        async getDetailData (id) {
-          this.loading = true;
-          const data = await getDetail(id);
-          this.loading = false;
-          if (data) {
-            this.detailData = data;
-            
-          }
-        },
-  
+      async getDetailData(id) {
+        this.loading = true;
+        const data = await getDetail(id);
+        this.loading = false;
+        if (data) {
+          this.detailData = data;
+        }
       }
-    };
-  </script>
-  
-  <style scoped lang="scss">
-  .ele-dialog-form{
-    .el-form-item{
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .ele-dialog-form {
+    .el-form-item {
       margin-bottom: 10px;
     }
   }
 
-  .headbox{
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  .amount{
-    font-size: 14px;
-    font-weight: bold;
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+    }
   }
-}
-  </style>
-  
+</style>

+ 14 - 4
src/views/saleManage/quotation/components/inventoryTable.vue

@@ -99,7 +99,7 @@
       <!-- <template v-slot:guaranteePeriodUnitCode="scope"> </template> -->
       <template v-slot:measuringUnit="scope">
         <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.measuringUnit'">
-            <el-input v-model="scope.row.measuringUnit" placeholder="请输入"></el-input>
+            <el-input disabled v-model="scope.row.measuringUnit" placeholder="请输入"></el-input>
         </el-form-item>
       </template>
       <template v-slot:remark="scope">
@@ -152,8 +152,15 @@
         </el-form-item>
       </template>
      
-      
-
+      <template v-slot:headerProductName="{column  }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerTotalCount="{column  }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerSinglePrice="{column  }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
       <template v-slot:workHour="scope">
         {{ getHour(scope.row) }}
       </template>
@@ -213,7 +220,8 @@ export default {
           width: 200,
           prop: 'productName',
           label: '名称',
-          slot: 'productName'
+          slot: 'productName',
+          headerSlot: 'headerProductName',
         },
         {
           width: 120,
@@ -250,12 +258,14 @@ export default {
           width: 160,
           prop: 'singlePrice',
           label: '单价',
+          headerSlot: 'headerSinglePrice',
           slot: 'singlePrice'
         },
         {
           width: 80,
           prop: 'totalCount',
           label: '数量',
+          headerSlot: 'headerTotalCount',
           slot: 'totalCount'
         },
         {

+ 222 - 120
src/views/saleManage/quotation/index.vue

@@ -2,118 +2,145 @@
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
       <div class="ele-border-lighter form-content" v-loading="loading">
-            <search-quotation @search="reload"> </search-quotation>
+        <search-quotation @search="reload"> </search-quotation>
 
-            <!-- 数据表格 -->
-            <ele-pro-table
-              ref="table"
-              :columns="columns"
-              :datasource="datasource"
-              height="calc(100vh - 350px)"
-              full-height="calc(100vh - 116px)"
-              tool-class="ele-toolbar-form"
-              :selection.sync="selection"
-              cache-key="eomContactPageTable"
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 350px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          cache-key="eomContactPageTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="openEdit('add', {})"
             >
-              <!-- 表头工具栏 -->
-              <template v-slot:toolbar>
-                <el-button
-                  size="small"
-                  type="primary"
-                  icon="el-icon-plus"
-                  class="ele-btn-icon"
-                  @click="openEdit('add',{})"
-                >
-                  新建
-                </el-button>
-              
-                <el-button
-                  size="small"
-                  type="danger"
-                  el-icon-delete
-                  class="ele-btn-icon"
-                  @click="allDelBtn"
-                  :disabled="selection?.length===0"
-                >
-                  批量删除
-                </el-button>
-              </template>
+              新建
+            </el-button>
 
-              <!-- 查看详情列 -->
-              <template v-slot:contactName="{ row }">
-                <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.contactName }}</el-link>
-              </template>
+            <el-button
+              size="small"
+              type="danger"
+              el-icon-delete
+              class="ele-btn-icon"
+              @click="allDelBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量删除
+            </el-button>
+          </template>
+
+          <!-- 查看详情列 -->
+          <template v-slot:contactName="{ row }">
+            <el-link type="primary" :underline="false" @click="openDetail(row)">
+              {{ row.contactName }}</el-link
+            >
+          </template>
 
-              <!-- 操作列 -->
-              <template v-slot:action="{ row }">
-                
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              v-if="[0, 3].includes(row.status)"
+              @click="openEdit('edit', row)"
+            >
+              修改
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              v-if="[2].includes(row.status)"
+              @click="addGenerateContract(row)"
+            >
+              生成合同
+            </el-link>
+
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此信息吗?"
+              @confirm="remove([row.id])"
+            >
+              <template v-slot:reference>
                 <el-link
-                  type="primary"
+                  type="danger"
                   :underline="false"
-                  icon="el-icon-edit"
-                  v-if="[0,3].includes(row.status)"
-                  @click="openEdit('edit',row)"
+                  icon="el-icon-delete"
+                  v-if="[0, 3].includes(row.status)"
                 >
-                  修改
+                  删除
                 </el-link>
-                <el-popconfirm
-                  class="ele-action"
-                  title="确定要删除此信息吗?"
-                  @confirm="remove([row.id])"
-                >
-                  <template v-slot:reference>
-                    <el-link
-                      type="danger"
-                      :underline="false"
-                      icon="el-icon-delete"
-                      v-if="[0,3].includes(row.status)"
-                    >
-                      删除
-                    </el-link>
-                  </template>
-                </el-popconfirm>
               </template>
-            </ele-pro-table>
-          </div>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </div>
     </el-card>
 
-
-    <add-dialog ref="addDialogRef"  @done="reload"></add-dialog>
+    <add-dialog ref="addDialogRef" @done="reload"></add-dialog>
     <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
-<!-- 多选删除弹窗 -->
-    <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+    <!-- 多选删除弹窗 -->
+    <pop-modal
+      :visible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
+    <addContractBookDialog
+      ref="addContractBookDialogRef"
+      :categoryTreeList="treeList"
+    ></addContractBookDialog>
   </div>
 </template>
 
 <script>
-import searchQuotation from './components/searchQuotation.vue';
-import addDialog from './components/addDialog.vue';
-import detailDialog from './components/detailDialog.vue';
-import popModal from '@/components/pop-modal';
-import {reviewStatus} from '@/enum/dict';
-import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/quotation';
-import dictMixins from '@/mixins/dictMixins';
+  import searchQuotation from './components/searchQuotation.vue';
+  import addDialog from './components/addDialog.vue';
+  import detailDialog from './components/detailDialog.vue';
+  import popModal from '@/components/pop-modal';
+  import { reviewStatus } from '@/enum/dict';
+  import addContractBookDialog from '@/views/contractManage/contractBook/components/addDialog.vue';
+  import { contactTypeTree } from '@/api/saleManage/contact';
+
+  import {
+    getTableList,
+    getDetail,
+    deleteInformation
+  } from '@/api/saleManage/quotation';
 
+  import dictMixins from '@/mixins/dictMixins';
 
-export default {
+  export default {
     mixins: [dictMixins],
     components: {
       searchQuotation,
       popModal,
       addDialog,
       detailDialog,
+      addContractBookDialog
     },
     data() {
       return {
-        selection:[],   //单选中集合
-        delVisible:false,  //批量删除弹框状态
-        loading: false,  // 加载状态
+        selection: [], //单选中集合
+        delVisible: false, //批量删除弹框状态
+        loading: false, // 加载状态
+        treeList: [],
         columns: [
           {
-             width: 45,
-             type: 'selection',
-             columnKey: 'selection',
-             align: 'center'
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
           },
           {
             columnKey: 'index',
@@ -160,7 +187,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 140
           },
-          
+
           {
             prop: 'quoteTel',
             label: '报价方联系电话',
@@ -182,7 +209,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 100
           },
-        
+
           {
             prop: 'taxRate',
             label: '税率',
@@ -190,7 +217,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.taxRate+'%'
+              return _row.taxRate + '%';
             }
           },
           {
@@ -228,7 +255,7 @@ export default {
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true,
-            fixed: 'right',
+            fixed: 'right'
           }
         ]
       };
@@ -236,6 +263,7 @@ export default {
     computed: {},
     created() {
       this.requestDict('客户状态');
+      this.getTreeData();
     },
     methods: {
       /* 表格数据源 */
@@ -246,25 +274,38 @@ export default {
           ...where
         });
       },
-    
+      //获取合同分类
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+          const res = await contactTypeTree({ type: 20 });
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
-      
+
       //新增编辑
-      openEdit(type,row) {
-        this.$refs.addDialogRef.open( type,row, row.id);
+      openEdit(type, row) {
+        this.$refs.addDialogRef.open(type, row, row.id);
         this.$refs.addDialogRef.$refs.form &&
-        this.$refs.addDialogRef.$refs.form.clearValidate();
+          this.$refs.addDialogRef.$refs.form.clearValidate();
       },
-     
+
       //批量删除
-      allDelBtn(){
-        if(this.selection.length===0) return
-        this.delVisible=true
+      allDelBtn() {
+        if (this.selection.length === 0) return;
+        this.delVisible = true;
       },
-      
+
       //删除接口
       remove(delData) {
         deleteInformation(delData).then((res) => {
@@ -273,36 +314,97 @@ export default {
         });
       },
 
-    //删除弹框确定
-      commitBtn(){
-        const dataId=this.selection.map(v=>v.id)
-        this.remove(dataId)
+      //删除弹框确定
+      commitBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        this.remove(dataId);
       },
-
-    //查看详情
-      openDetail(row){
-        this.$refs.contactDetailDialogRef.open(row);
+      //新增合同
+      async addGenerateContract(row) {
+        //获取详情
+        const data = await getDetail(row.id);
+        console.log(data);
+        let obj = {
+          contractVO: {
+            categoryId: '',
+            categoryName: '',
+            contractEndDate: '',
+            contractFile: [],
+            contractName: '',
+            contractNo: '',
+            contractNumber: '',
+            contractStartDate: '',
+            createDept: '',
+            createTime: '',
+            createUsername: '',
+            discountTotalPrice: '',
+            enabled: '',
+            id: '',
+            opportunityId: '',
+            partaAddress: data.contactAddress,
+            partaEmail: data.contactEmail,
+            partaFax: data.contactFax,
+            partaId: data.contactId,
+            partaLinkId: data.contactLinkId,
+            partaLinkName: data.contactLinkName,
+            partaName: data.contactName,
+            partaTel: data.contactTel,
+            partaUnifiedSocialCreditCode: '',
+            partbAddress: data.quoteAddress,
+            partbEmail: data.quoteEmail,
+            partbFax: data.quoteFax,
+            partbId: data.quoteCompanyId,
+            partbLinkId: data.quoteLinkId,
+            partbLinkName: data.quoteLinkName,
+            partbName: data.quoteName,
+            partbTel: data.quoteTel,
+            partbUnifiedSocialCreditCode: '',
+            receiptPaymentType: '',
+            reviewerId: '',
+            reviewerName: '',
+            reviewerTime: '',
+            sourceId: row.id,
+            sourceType: 1,
+            status: '',
+            totalPrice: data.totalPrice,
+            type: '1',
+            typeName: '销售合同',
+            updateUsername: ''
+          },
+          receiptPaymentList: [],
+          productList: data.quoteProductList
+        };
+        // return;
+        console.log(
+          this.$refs.addContractBookDialogRef,
+          'this.$refs.addContractBookDialogRef'
+        );
+        this.$refs.addContractBookDialogRef.open('add', obj, true);
       },
+      //查看详情
+      openDetail(row) {
+        this.$refs.contactDetailDialogRef.open(row);
+      }
     }
   };
 </script>
 
 <style lang="scss" scoped>
-:deep(.el-link--inner){
-  margin-left: 0px !important;
-}
+  :deep(.el-link--inner) {
+    margin-left: 0px !important;
+  }
 
-.sys-organization-list {
-  height: calc(100vh - 264px);
-  box-sizing: border-box;
-  border-width: 1px;
-  border-style: solid;
-  overflow: auto;
-}
-.sys-organization-list :deep(.el-tree-node__content) {
-  height: 40px;
-  & > .el-tree-node__expand-icon {
-    margin-left: 10px;
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
   }
-}
 </style>

Разница между файлами не показана из-за своего большого размера
+ 683 - 588
src/views/saleManage/saleOrder/components/addDialog.vue


+ 1 - 1
src/views/saleManage/saleOrder/components/inventoryTable.vue

@@ -195,7 +195,7 @@
             :prop="'datasource.' + scope.$index + '.measuringUnit'"
           >
             <el-input
-              v-model="scope.row.measuringUnit"
+              v-model="scope.row.measuringUnit" disabled
               placeholder="请输入"
             ></el-input>
           </el-form-item>

Некоторые файлы не были показаны из-за большого количества измененных файлов