Browse Source

同一个计划内的核价单才能合并生成合同
去掉采购收货单中的收货单类型
采购订单中的采购类型改为采购订单类型
采购收货单根据采购的需求类型,确定走生产还是非生产的流程
采购收货单驳回到发起人后,点击通过,无反应
采购需求、采购计划、采购询价单增加名称字段,必填

Z 2 years ago
parent
commit
9b8012dc86
24 changed files with 982 additions and 743 deletions
  1. BIN
      dist.rar
  2. 11 0
      src/api/purchasingManage/purchaseOrder.js
  3. 3 2
      src/enum/dict.js
  4. 20 6
      src/views/purchasingManage/inquiryManage/components/addDialog.vue
  5. 18 6
      src/views/purchasingManage/inquiryManage/components/detailDialog.vue
  6. 13 6
      src/views/purchasingManage/inquiryManage/index.vue
  7. 16 1
      src/views/purchasingManage/purchaseNeedManage/components/addDialog.vue
  8. 6 2
      src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue
  9. 15 1
      src/views/purchasingManage/purchaseNeedManage/index.vue
  10. 44 9
      src/views/purchasingManage/purchaseOrder/components/addDialog.vue
  11. 8 1
      src/views/purchasingManage/purchaseOrder/components/detailDialog.vue
  12. 1 1
      src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue
  13. 1 1
      src/views/purchasingManage/purchaseOrder/index.vue
  14. 31 20
      src/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog.vue
  15. 8 8
      src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue
  16. 1 1
      src/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.vue
  17. 2 2
      src/views/purchasingManage/purchaseOrder/invoice/index.vue
  18. 23 5
      src/views/purchasingManage/purchasePlanManage/components/addDialog.vue
  19. 8 2
      src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue
  20. 14 8
      src/views/purchasingManage/purchasePlanManage/index.vue
  21. 3 3
      src/views/purchasingManage/supplierManage/components/addContactDialog.vue
  22. 1 1
      src/views/purchasingManage/supplierManage/components/contactDetailDialog.vue
  23. 466 419
      src/views/saleManage/contact/components/addContactDialog.vue
  24. 269 238
      src/views/saleManage/contact/components/contactDetailDialog.vue

BIN
dist.rar


+ 11 - 0
src/api/purchasingManage/purchaseOrder.js

@@ -64,3 +64,14 @@ export async function submit(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+/**
+ * 获取采购询价表信息
+ */
+export async function getPurchaseinquiryAPI(id) {
+  const res = await request.get(`/eom/purchaseinquiry/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 3 - 2
src/enum/dict.js

@@ -18,7 +18,7 @@ export default {
   交付要求: 'require_ments',
   交货状态: 'delivery_status',
   客户状态: 'contact_status',
-  企业类型: 'company_category',
+  营业类型: 'company_category',
   结算方式: 'settlement_mode',
   商机来源:'business_opport_code',
   影响力:'influence_level_code',
@@ -31,9 +31,10 @@ export default {
   退货类型:'sale_return_type',
   客户联系人状态: 'contact_link_status',
   需求来源类型:'requirement_source_type',
-  采购类型:'purchase_type',
+  采购订单类型:'purchase_type',
   流程实例的结果: 'bpm_process_instance_result',
   采购收货单类型: 'purchase_receive_type',
+  企业类型: 'enterprise_type',
 };
 
 export const numberList = [

+ 20 - 6
src/views/purchasingManage/inquiryManage/components/addDialog.vue

@@ -14,17 +14,25 @@
       <el-row>
         <el-col :span="12">
           <el-form-item
-            label="采购计划"
-            prop="planCode"
-            style="margin-bottom: 22px"
-          >
+            label="采购计划单名称"
+            prop="planCode">
             <el-input
               @click.native="handParent"
-              v-model="form.planCode"
+              v-model="form.planName"
               placeholder="请选择"
             ></el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="询价单名称"
+            prop="inquiryName"
+            style="margin-bottom: 22px">
+            <el-input
+              v-model="form.inquiryName"
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <!-- <el-col :span="12">
           <el-form-item
             label="供应商"
@@ -159,6 +167,8 @@
       let formDef = {
         id: '',
         planCode: null,
+        planName: null,
+        inquiryName: null,
         remark: null,
         planId: '',
         detailList: '',
@@ -197,7 +207,10 @@
           ],
           requireDeptId: [
             { required: true, message: '请选择需求部门', trigger: 'change' }
-          ]
+          ],
+          inquiryName: [
+            { required: true, message: '请输入询价单名称', trigger: 'blur' }
+          ],
         },
 
         // 提交状态
@@ -258,6 +271,7 @@
           this.$set(this.form, 'acceptUnpack', data.acceptUnpack);
           this.form.planId = data.id;
           this.form.planCode = data.planCode;
+          this.form.planName = data.planName;
 
           if (type == 'change') {
             this.supplierList.forEach((item) => {

+ 18 - 6
src/views/purchasingManage/inquiryManage/components/detailDialog.vue

@@ -25,7 +25,7 @@
       </div>
     </div>
     <div v-if="activeComp == 'main'">
-      <el-form ref="form" :model="form" label-width="120px">
+      <el-form ref="form" :model="form" label-width="140px">
         <headerTitle title="基本信息">
           <!-- <el-button
                   size="small"
@@ -38,18 +38,29 @@
                 </el-button> -->
         </headerTitle>
         <el-row>
-          <el-col :span="12" style="height: 46px">
-            <el-form-item label="采购计划:" prop="planCode">
+          <el-col :span="12">
+            <el-form-item label="采购计划单名称:" prop="planName">
               <el-link
                 type="primary"
                 :underline="false"
                 @click="openPlanDetail(form)"
               >
-                {{ form.planCode }}
+                {{ form.planName }}
               </el-link>
             </el-form-item>
           </el-col>
-
+          <el-col :span="12">
+            <el-form-item label="询价单名称:" prop="inquiryName">
+              {{ form.inquiryName }}
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item prop="remark" label="是否接受拆单:">
+              {{form.acceptUnpack?'接受':'不接受'}}
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item prop="askFile" label="附件:">
               <el-link
@@ -62,6 +73,8 @@
               >
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="12">
             <el-form-item prop="remark" label="备注:">
               {{ form.remark }}
@@ -274,7 +287,6 @@
       },
       //查看详情
       openPlanDetail(row) {
-        console.log(row);
         this.$refs.planDetaillogRef.open(row);
       }
       // //获取需求详情

+ 13 - 6
src/views/purchasingManage/inquiryManage/index.vue

@@ -54,13 +54,13 @@
             >
           </template>
           <!-- 查看详情列 -->
-          <template v-slot:planCode="{ row }">
+          <template v-slot:planName="{ row }">
             <el-link
               type="primary"
               :underline="false"
               @click="openPlanDetail(row)"
             >
-              {{ row.planCode }}</el-link
+              {{ row.planName }}</el-link
             >
           </template>
           <!-- 状态 -->
@@ -185,15 +185,22 @@
           {
             prop: 'inquiryCode',
             slot: 'inquiryCode',
-            label: '采购询价编码',
+            label: '采购询价单编码',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 200
           },
           {
-            prop: 'planCode',
-            slot: 'planCode',
-            label: '采购计划编码',
+            prop: 'inquiryName',
+            label: '采购询价单名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'planName',
+            slot: 'planName',
+            label: '采购计划单名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 200

+ 16 - 1
src/views/purchasingManage/purchaseNeedManage/components/addDialog.vue

@@ -23,6 +23,14 @@
             </DictSelection>
           </el-form-item>
         </el-col>
+        <el-col :span="12" style="height: 58px">
+          <el-form-item label="需求单名称" prop="requirementName">
+            <el-input
+              v-model="form.requirementName"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
 
         <el-col :span="12">
           <el-form-item
@@ -167,10 +175,13 @@
         receiveDate: null,
         remark: null,
         requireDeptId: '',
+        requireDeptName: '',
         requireUserId: '',
+        requireUserName: '',
         sourceCode: '',
         sourceId: '',
         sourceType: '',
+        requirementName: '',
         files: [],
         acceptUnpack: 1
       };
@@ -195,6 +206,9 @@
           requireDeptId: [
             { required: true, message: '请选择需求部门', trigger: 'change' }
           ],
+          requirementName: [
+            { required: true, message: '请输入需求单名称', trigger: 'blur' }
+          ],
           requireUserId: [
             { required: true, message: '请选择需求人', trigger: 'change' }
           ],
@@ -239,6 +253,7 @@
       // 选择负责人部门
       change_principalDep(id) {
         const info = this.groupData.find((e) => e.id == id);
+        console.log(info);
         this.form.requireDeptName = info.name;
         this.form.requireUserId = '';
         this.form.requireUserName = '';
@@ -290,7 +305,7 @@
             this.form.requireUserId = this.$store.getters.user.info.userId;
             this.form.requireDeptName = this.$store.getters.user.info.groupName;
             this.form.requireUserName = this.$store.getters.user.info.name;
-
+            console.log(this.$store.getters.user.info.groupName);
             this.getrequireUser(this.form.requireDeptId);
           });
         } else {

+ 6 - 2
src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue

@@ -43,7 +43,11 @@
               {{ form?.sourceTypeName }}
             </el-form-item>
           </el-col>
-
+          <el-col :span="12">
+            <el-form-item label="需求单名称:" prop="requirementName">
+              {{ form.requirementName }}
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item label="需求部门:" prop="requireDeptName">
               {{ detailData.requireDeptName }}
@@ -118,7 +122,7 @@
             </el-link>
           </div>
         </template>
-        
+
         <template v-slot:technicalDrawings="{ row }">
           <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
             <el-link

+ 15 - 1
src/views/purchasingManage/purchaseNeedManage/index.vue

@@ -45,6 +45,12 @@
               {{ row.requirementCode }}</el-link
             >
           </template>
+          <!-- 查看详情列 -->
+          <template v-slot:requirementName="{ row }">
+            <el-link type="primary" :underline="false" @click="openDetail(row)">
+              {{ row.requirementName }}</el-link
+            >
+          </template>
           <!-- 状态 -->
           <template v-slot:status="{ row }">
             {{ getStatus(row.status) }}
@@ -155,7 +161,15 @@
           {
             prop: 'requirementCode',
             slot: 'requirementCode',
-            label: '需求编码',
+            label: '需求单编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'requirementName',
+            slot: 'requirementName',
+            label: '需求单名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 200

+ 44 - 9
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -25,12 +25,12 @@
             />
           </el-form-item>
           <el-form-item
-            label="采购类型"
+            label="采购订单类型"
             prop="purchaseType"
             style="margin-bottom: 22px"
           >
             <DictSelection
-              dictName="采购类型"
+              dictName="采购订单类型"
               clearable
               v-model="form.purchaseType"
             >
@@ -53,6 +53,21 @@
               default-expand-all
             />
           </el-form-item>
+          <el-form-item
+            label="需求类型"
+            prop="sourceType"
+            style="margin-bottom: 22px"
+          >
+            <DictSelection
+              dictName="需求来源类型"
+              clearable
+              v-model="form.sourceType"
+              :disabled="isFlag"
+
+            >
+              <!--  v-if="form.sourceType != 1" -->
+            </DictSelection>
+          </el-form-item>
           <el-form-item prop="orderFiles" label="附件">
             <fileUpload
               v-model="form.orderFiles"
@@ -343,7 +358,7 @@
     getpurchaseorderDetail,
     UpdateInformation,
     addInformation,
-    submit
+    submit, getPurchaseinquiryAPI,
   } from '@/api/purchasingManage/purchaseOrder';
 
   import { getcontactlink } from '@/api/saleManage/businessFollow';
@@ -373,6 +388,8 @@
         projectName: '',
         projectId: '',
         receiveAddress: '',
+        sourceType: '',
+        sourceTypeName: '',
         remark: '',
         saleType: '',
         saleTypeName: '',
@@ -400,6 +417,7 @@
       };
 
       return {
+        isFlag: false, //需求类型是否不可修改
         clearing: false, //是否清除合同
         payWayOptions: [],
         delDetailIds: [],
@@ -421,7 +439,7 @@
             { required: true, message: '请选择交货日期', trigger: 'change' }
           ],
           purchaseType: [
-            { required: true, message: '请选择采购类型', trigger: 'change' }
+            { required: true, message: '请选择采购订单类型', trigger: 'change' }
           ],
           settlementMode: [
             { required: true, message: '请选择结算方式', trigger: 'change' }
@@ -435,6 +453,9 @@
           acceptUnpack: [
             { required: true, message: '请选择是否接受', trigger: 'change' }
           ],
+          sourceType: [
+            { required: true, message: '请选择需求类型', trigger: 'change' }
+          ],
           partaTel: [
             {
               required: true,
@@ -683,18 +704,20 @@
 
       //选择合同回调
       changeContract(obj) {
+
         this.form = Object.assign({}, this.form, {
           contractId: obj.id,
           contractName: obj.contractName,
-          contractNo: obj.contractNo
+          contractNo: obj.contractNo,
         });
         this.getDetailData(obj.id);
+        //采购询价表
+        this.getPurchaseinquiry(obj.sourceId);
         this.$store.commit('order/setContractId', obj.id);
       },
 
       //选择合同弹框
       handleContractBtn() {
-        console.log('5556666');
         if (this.clearing) return;
         let item = {
           id: this.form.contractId
@@ -704,6 +727,7 @@
       //清除合同
       clearContrcat() {
         this.clearing = true;
+        this.isFlag = false;
         let {
           id,
           projectName,
@@ -741,7 +765,15 @@
         };
         this.$refs.parentRef.open(item);
       },
-
+      //通过合同获取需求类型
+     async getPurchaseinquiry(sourceId){
+       let data = await getPurchaseinquiryAPI(sourceId)
+       this.isFlag = !!data.sourceType
+       this.form = Object.assign({}, this.form, {
+         sourceType: data.sourceType,
+         sourceTypeName: data.sourceTypeName,
+       });
+     },
       //打开新增编辑弹框
       async open(type, row, contactCategoryId) {
         this.title = type === 'add' ? '新增' : '修改';
@@ -803,11 +835,14 @@
           let commitData = Object.assign({}, this.form, {
             productList: this.$refs.inventoryTable.getTableValue(),
             purchaseTypeName: this.getDictValue(
-              '采购类型',
+              '采购订单类型',
               this.form.purchaseType
+            ) ,
+            sourceTypeName: this.getDictValue(
+              '需求来源类型',
+              this.form.sourceType
             )
           });
-
           if (this.isUpdate) {
             UpdateInformation(commitData)
               .then((res) => {

+ 8 - 1
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -50,7 +50,14 @@
               {{ form.requireDeptName }}
             </el-form-item>
             <el-form-item
-              label="采购类型:"
+              label="需求类型:"
+              prop="requireDeptName"
+              style="margin-bottom: 16px"
+            >
+              {{ form.sourceTypeName }}
+            </el-form-item>
+            <el-form-item
+              label="采购订单类型:"
               prop="purchaseTypeName"
               style="margin-bottom: 16px"
             >

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

@@ -541,7 +541,7 @@
         }
         if (data) {
           data.forEach((item) => {
-            item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode + '';
+            item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode ? item.guaranteePeriodUnitCode + '' :'';
 
             // if (item.deliveryDays) {
             //   item['deliveryDeadline'] = this.setDay(item.deliveryDays);

+ 1 - 1
src/views/purchasingManage/purchaseOrder/index.vue

@@ -247,7 +247,7 @@
           // },
           {
             prop: 'purchaseTypeName',
-            label: '采购类型',
+            label: '采购订单类型',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 140

+ 31 - 20
src/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog.vue

@@ -39,7 +39,12 @@
           >
             <el-input clearable v-model="form.linkName" placeholder="请输入" />
           </el-form-item>
-
+          <el-form-item
+            label="需求类型"
+            style="margin-bottom: 22px"
+          >
+            <span>{{ form.sourceTypeName }}</span>
+          </el-form-item>
           <el-form-item prop="receiveFiles" label="附件">
             <fileUpload
               v-model="form.receiveFiles"
@@ -51,18 +56,18 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item
-            label="收货单类型"
-            prop="receiveType"
-            style="margin-bottom: 22px"
-          >
-            <DictSelection
-              dictName="采购收货单类型"
-              clearable
-              v-model="form.receiveType"
-            >
-            </DictSelection>
-          </el-form-item>
+<!--          <el-form-item-->
+<!--            label="收货单类型"-->
+<!--            prop="receiveType"-->
+<!--            style="margin-bottom: 22px"-->
+<!--          >-->
+<!--            <DictSelection-->
+<!--              dictName="采购收货单类型"-->
+<!--              clearable-->
+<!--              v-model="form.receiveType"-->
+<!--            >-->
+<!--            </DictSelection>-->
+<!--          </el-form-item>-->
 
           <el-form-item
             label="供应商车辆号"
@@ -78,7 +83,7 @@
               style="margin-bottom: 22px"
             >
             <span>{{form.orderNo}}</span>
-              
+
             </el-form-item> -->
 
           <el-form-item
@@ -159,6 +164,7 @@
         orderNo: '',
         orderId: '',
         sendNoteNo: '',
+        sourceTypeName: '',
         receiveType:""
       };
 
@@ -222,7 +228,9 @@
               orderNo,
               id,
               partbLinkName,
-              productList
+              productList,
+              sourceTypeName,
+              sourceType
             } = data;
             if (productList && productList.length > 0) {
               productList.forEach((v) => {
@@ -236,7 +244,9 @@
               linkPhone: partbTel,
               orderNo,
               orderId: id,
-              productList
+              sourceTypeName,
+              sourceType,
+              productList,
             });
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(productList);
@@ -338,7 +348,7 @@
                 this.loading = false;
                 this.$message.success('修改成功');
                 if (type === 'sub') {
-                  this.sub(res);
+                  this.sub(res,commitData.sourceType);
                   return;
                 }
                 this.cancel();
@@ -353,7 +363,7 @@
                 this.loading = false;
                 this.$message.success('新增成功');
                 if (type === 'sub') {
-                  this.sub(res);
+                  this.sub(res,commitData.sourceType);
                   return;
                 }
                 this.cancel();
@@ -368,10 +378,11 @@
           // 表单验证未通过,不执行保存操作
         }
       },
-      sub(res) {
+      sub(res,sourceType) {
         submit({
           businessId: this.businessId || res,
-          receiveType: this.form.receiveType
+          receiveType: this.form.receiveType,
+          sourceType
         }).then((res) => {
           this.cancel();
           this.$emit('done');

+ 8 - 8
src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue

@@ -85,13 +85,13 @@
           </el-col>
 
           <el-col :span="12">
-            <el-form-item
-              label="采购单类型:"
-              prop="receiveTypeName"
-              style="margin-bottom: 16px"
-            >
-              {{ form.receiveTypeName }}
-            </el-form-item>
+<!--            <el-form-item-->
+<!--              label="采购单类型:"-->
+<!--              prop="receiveTypeName"-->
+<!--              style="margin-bottom: 16px"-->
+<!--            >-->
+<!--              {{ form.receiveTypeName }}-->
+<!--            </el-form-item>-->
             <el-form-item
               label="车牌号:"
               prop="carNo"
@@ -99,7 +99,7 @@
             >
               {{ form.carNo }}
             </el-form-item>
-    
+
 
             <el-form-item
               label="收货单编码:"

+ 1 - 1
src/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.vue

@@ -93,7 +93,7 @@
           // },
           {
             prop: 'purchaseTypeName',
-            label: '采购类型',
+            label: '采购订单类型',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 140

+ 2 - 2
src/views/purchasingManage/purchaseOrder/invoice/index.vue

@@ -289,8 +289,8 @@
       sub(res) {
         submit({
           businessId: res.id,
-          receiveType: res.receiveType
-
+          receiveType: res.receiveType,
+          sourceType:res.sourceType
         }).then((res) => {
           this.$message.success('提交成功');
           this.reload();

+ 23 - 5
src/views/purchasingManage/purchasePlanManage/components/addDialog.vue

@@ -14,13 +14,25 @@
       <el-row>
         <el-col :span="12">
           <el-form-item
-            label="采购需求"
-            prop="requirementCode"
+            label="需求单名称"
+            prop="requirementName"
             style="margin-bottom: 22px"
           >
             <el-input
               @click.native="handParent"
-              v-model="form.requirementCode"
+              v-model="form.requirementName"
+              placeholder="请选择"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="计划单名称"
+            prop="planName"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              v-model="form.planName"
               placeholder="请选择"
             ></el-input>
           </el-form-item>
@@ -51,7 +63,7 @@
               v-model="form.sourceType"
               :disabled="!!form.requirementCode"
               :listFormatte="listFormatte"
-             
+
             >
             <!--  v-if="form.sourceType != 1" -->
             </DictSelection>
@@ -223,9 +235,12 @@
         sourceId: '',
         sourceType: '',
         files: [],
+        planName: '',
         responsibleName: '',
         responsibleId: '',
         requirementId: '',
+        requirementName: '',
+        sourceTypeName: '',
         acceptUnpack: 1
       };
 
@@ -348,7 +363,10 @@
           ],
           sourceType: [
             { required: true, message: '请选择需求类型', trigger: 'change' }
-          ]
+          ],
+          planName: [
+            { required: true, message: '请输入计划单名称', trigger: 'blur' }
+          ],
         },
 
         // 提交状态

+ 8 - 2
src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue

@@ -39,17 +39,23 @@
         </headerTitle>
         <el-row>
           <el-col :span="12" style="height: 46px">
-            <el-form-item label="采购需求:" prop="requirementCode">
+            <el-form-item label="需求单名称:" prop="requirementCode">
               <el-link
                 type="primary"
                 :underline="false"
                 @click="openDetail(form)"
               >
-                {{ form?.requirementCode }}
+                {{ form?.requirementName }}
               </el-link>
               <!-- {{ form.requirementCode }} -->
             </el-form-item>
           </el-col>
+          <el-col :span="12" style="height: 46px">
+            <el-form-item label="计划单名称:" prop="planName">
+              {{ form.planName }}
+              <!-- {{ form.requirementCode }} -->
+            </el-form-item>
+          </el-col>
 
           <el-col :span="12">
             <el-form-item label="负责人:" prop="responsibleName">

+ 14 - 8
src/views/purchasingManage/purchasePlanManage/index.vue

@@ -46,13 +46,13 @@
             >
           </template>
           <!-- 查看详情列 -->
-          <template v-slot:requirementCode="{ row }">
+          <template v-slot:requirementName="{ row }">
             <el-link
               type="primary"
               :underline="false"
               @click="openNeedDetail(row)"
             >
-              {{ row.requirementCode }}</el-link
+              {{ row.requirementName }}</el-link
             >
           </template>
           <!-- 状态 -->
@@ -75,7 +75,7 @@
               type="primary"
               :underline="false"
               v-if="[2].includes(row.status)"
-              icon="el-icon-plus" 
+              icon="el-icon-plus"
               @click="addInquiry('add', row)"
             >
               生成核价单
@@ -157,17 +157,23 @@
           {
             prop: 'planCode',
             slot: 'planCode',
-
-            label: '采购计划编码',
+            label: '采购计划单编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'planName',
+            label: '采购计划单名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 200
           },
           {
-            prop: 'requirementCode',
-            slot: 'requirementCode',
+            prop: 'requirementName',
+            slot: 'requirementName',
 
-            label: '采购需求编码',
+            label: '采购需求单名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 200

+ 3 - 3
src/views/purchasingManage/supplierManage/components/addContactDialog.vue

@@ -62,8 +62,8 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="企业类型" prop="companyCategoryId">
-                <DictSelection dictName="企业类型" clearable v-model="form.companyCategoryId">
+              <el-form-item label="营业类型" prop="companyCategoryId">
+                <DictSelection dictName="营业类型" clearable v-model="form.companyCategoryId">
                 </DictSelection>
               </el-form-item>
             </el-col>
@@ -664,7 +664,7 @@ export default {
         }
         if (this.form.companyCategoryId) {
           this.form.companyCategoryName = this.getDictValue(
-            '企业类型',
+            '营业类型',
             this.form.companyCategoryId
           );
         }

+ 1 - 1
src/views/purchasingManage/supplierManage/components/contactDetailDialog.vue

@@ -76,7 +76,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="企业类型:" prop="companyCategoryId">
+              <el-form-item label="营业类型:" prop="companyCategoryId">
                 {{form.companyCategoryName}}
               </el-form-item>
             </el-col>

+ 466 - 419
src/views/saleManage/contact/components/addContactDialog.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"
@@ -55,13 +55,31 @@
                 ></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="法定代表人" prop="legalPerson">
+                <el-input
+                  placeholder="请输入"
+                  v-model="form.legalPerson"
+                  maxlength="50"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="注册资金" prop="registeredCapital">
+                <el-input
+                  placeholder="请输入"
+                  v-model="form.registeredCapital"
+                  maxlength="50"
+                ></el-input>
+              </el-form-item>
+            </el-col>
             <el-col :span="8">
               <el-form-item label="授信额度" prop="authorizationLimit">
                 <el-input
                   placeholder="请输入"
                   v-model="form.authorizationLimit"
                   maxlength="17"
-                  oninput ="value=value.replace(/[^0-9.]/g,'')"
+                  oninput="value=value.replace(/[^0-9.]/g,'')"
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -117,13 +135,23 @@
             <el-col :span="8">
               <el-form-item label="营业类型" prop="companyCategoryId">
                 <DictSelection
-                  dictName="企业类型"
+                  dictName="营业类型"
                   clearable
                   v-model="form.companyCategoryId"
                 >
                 </DictSelection>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="企业类型" prop="enterpriseTypeId">
+                <DictSelection
+                  dictName="企业类型"
+                  clearable
+                  v-model="form.enterpriseTypeId"
+                >
+                </DictSelection>
+              </el-form-item>
+            </el-col>
             <el-col :span="8">
               <el-form-item label="登记日期" prop="registerDate">
                 <el-date-picker
@@ -150,14 +178,14 @@
               <el-form-item
                 label="关联上级单位"
                 prop="parentId"
-             
+
               >
-              <el-input
+                <el-input
                   placeholder="请选择关联上级单位"
                   v-model="form.parentName"
                   readonly
                   @click.native="handParent"
-               
+
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -175,10 +203,9 @@
               <el-form-item label="经营范围" prop="businessScope">
                 <el-input
                   type="textarea"
-                  :max="500"
+                  maxlength="500"
                   placeholder="请输入"
                   v-model="form.businessScope"
-                  maxlength="100"
                 ></el-input>
               </el-form-item>
             </el-col>
@@ -213,7 +240,8 @@
           </template>
           <template v-slot:action="{ row, $index }">
             <el-link type="primary" @click="handleBankDel(row, $index)"
-              >删除</el-link
+            >删除
+            </el-link
             >
           </template>
           <template v-slot:accountNameHeader="{ column }">
@@ -249,7 +277,8 @@
           </template>
           <template v-slot:action="{ row, $index }">
             <el-link type="primary" @click="handleLinkDel(row, $index)"
-              >删除</el-link
+            >删除
+            </el-link
             >
           </template>
           <template v-slot:linkNameHeader="{ column }">
@@ -279,11 +308,15 @@
           <template v-slot:email="{ row }">
             <el-input v-model="row.email" placeholder="请输入" maxlength="50"></el-input>
           </template>
+          <template v-slot:deptName="{ row }">
+            <el-input v-model="row.deptName" placeholder="请输入" maxlength="50"></el-input>
+          </template>
           <template v-slot:post="{ row }">
             <el-input v-model="row.post" placeholder="请输入" maxlength="20"></el-input>
           </template>
           <template v-slot:ifChief="{ row, $index }">
-            <el-select v-model="row.ifChief" placeholder="请选择" class="w100" @change="((value)=>{ifChiefChange(value, $index)})">
+            <el-select v-model="row.ifChief" placeholder="请选择" class="w100"
+                       @change="((value)=>{ifChiefChange(value, $index)})">
               <el-option
                 v-for="item in ifChiefList"
                 :key="item.value"
@@ -325,14 +358,14 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="税率" prop="taxRate">
-                <el-input v-model="otherForm.taxRate" maxlength="5" oninput ="value=value.replace(/[^0-9.]/g,'')">
+                <el-input v-model="otherForm.taxRate" maxlength="5" oninput="value=value.replace(/[^0-9.]/g,'')">
                   <template slot="append">%</template>
                 </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="折扣率" prop="discount">
-                <el-input v-model="otherForm.discount" maxlength="5" oninput ="value=value.replace(/[^0-9.]/g,'')">
+                <el-input v-model="otherForm.discount" maxlength="5" oninput="value=value.replace(/[^0-9.]/g,'')">
                   <template slot="append">%</template>
                 </el-input>
               </el-form-item>
@@ -393,7 +426,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="收件人详细地址" prop="address"
-                 label-width="130px">
+                            label-width="130px">
                 <el-input
                   placeholder="请输入"
                   v-model="otherForm.address"
@@ -414,7 +447,7 @@
     <parentList ref="parentRef" classType="1" @changeParent="changeParent"></parentList>
 
   </ele-modal>
-  
+
 </template>
 
 <script>
@@ -431,358 +464,367 @@ import {copyObj} from '@/utils/util';
 import parentList from './parentList.vue'
 
 export default {
-    props: {
-      categoryTreeList: Array
-    },
-    mixins: [dictMixins],
-    components: {
-      fileUpload,
-      deptSelect,
-      personSelect,
-      parentList
-    },
-    data() {
-      let formDef = {
-          address: '',
-          addressId: '',
-          addressName: '',
-          authorizationLimit: 0,
-          businessLicenseFiles: [],
-          businessLicenseFile: {},
-          businessScope: '',
-          categoryId: '',
-          companyCategoryId: '',
-          companyCategoryName: '',
-          parentId: '',
-          industry: '',
-          industryCode: '',
-          industryFullName: '',
-          mainProduct: '',
-          name: '',
-          officialIndustry: '',
-          phone: '',
-          registerDate: '',
-          remark: '',
-          serialNo: '',
-          simpleName: '',
-          type: 1,
-          unifiedSocialCreditCode: ''
-        };
-      let otherFormDef = {
-        settlementMode: '',
-        settlementModeName: '',
-        taxRate: 0,
-        address: '',
-        addressId: '',
-        deptId: '',
-        deptName: '',
-        discount: 0,
-        salesmanId: '',
-        salesmanName: '',
-        sender: '',
-        senderPhone: ''
-      };
-      return {
-        visible: false,
-        title: '',
-        row: {},
-        activeName: 'base',
-        formDef,
-        otherFormDef,
-        form: copyObj(formDef),
-        otherForm: copyObj(otherFormDef),
-        // removeBankList: [],
-        // removeLinkList: [],
-        tableBankData: [],
-        tableLinkData: [],
-        ifChiefList: [
-          {
-            value: 0,
-            label: '否'
-          },
-          {
-            value: 1,
-            label: '是'
-          }
-        ],
-        bankColumns: [
-          {
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            label: '单位名称',
-            prop: 'accountName',
-            slot: 'accountName',
-            action: 'accountName',
-            headerSlot: 'accountNameHeader'
-          },
-          {
-            label: '银行账号',
-            prop: 'accountNo',
-            slot: 'accountNo',
-            action: 'accountNo'
-          },
-          {
-            label: '开户行',
-            prop: 'bankName',
-            slot: 'bankName',
-            action: 'bankName'
-          },
-          {
-            label: '银行银联号',
-            prop: 'interbankNo',
-            slot: 'interbankNo',
-            action: 'interbankNo'
-          },
-          {
-            action: 'action',
-            slot: 'action',
-            label: '操作'
-          }
-        ],
-        linkColumns: [
-          {
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            label: '姓名',
-            prop: 'linkName',
-            slot: 'linkName',
-            action: 'linkName',
-            headerSlot: 'linkNameHeader'
-          },
-          {
-            label: '手机',
-            prop: 'mobilePhone',
-            slot: 'mobilePhone',
-            action: 'mobilePhone',
-            headerSlot: 'mobilePhoneHeader'
-          },
-          {
-            label: '电话',
-            prop: 'phone',
-            slot: 'phone',
-            action: 'phone'
-          },
-
-          {
-            label: '微信号',
-            prop: 'wechat',
-            slot: 'wechat',
-            action: 'wechat',
-          },
-          {
-            label: '邮箱',
-            prop: 'email',
-            slot: 'email',
-            action: 'email'
-          },
-          {
-            label: '职务',
-            prop: 'post',
-            slot: 'post',
-            action: 'post'
-          },
-          {
-            label: '状态',
-            prop: 'status',
-            slot: 'status',
-            action: 'status',
-            headerSlot: 'statusHeader'
-          },
-          {
-            label: '是否首要',
-            prop: 'ifChief',
-            slot: 'ifChief',
-            action: 'ifChief'
-          },
-          {
-            label: '备注',
-            prop: 'remark',
-            slot: 'remark',
-            action: 'remark'
-          },
-          {
-            action: 'action',
-            slot: 'action',
-            label: '操作'
-          }
-        ],
-        rules: {
-          
-          categoryId: [
-            { required: true, message: '请选择客户分类', trigger: 'change' }
-          ],
-          simpleName: [
-            { required: true, message: '请输入客户简称', trigger: 'change' }
-          ],
-          name: [
-            { required: true, message: '请输入客户名称', trigger: 'blur' }
-          ],
-          authorizationLimit: [
-            { required: true, message: '请输入授信额度', trigger: 'blur' }
-          ],
-
-          addressId: [
-          { required: true, message: '请选择地址', trigger: 'change' }
-          ]
+  props: {
+    categoryTreeList: Array
+  },
+  mixins: [dictMixins],
+  components: {
+    fileUpload,
+    deptSelect,
+    personSelect,
+    parentList
+  },
+  data() {
+    let formDef = {
+      address: '',
+      addressId: '',
+      addressName: '',
+      authorizationLimit: 0,
+      businessLicenseFiles: [],
+      businessLicenseFile: {},
+      businessScope: '',
+      categoryId: '',
+      companyCategoryId: '',
+      companyCategoryName: '',
+      enterpriseTypeId: '',
+      enterpriseTypeName: '',
+      legalPerson: '',
+      registeredCapital: '',
+      parentId: '',
+      industry: '',
+      industryCode: '',
+      industryFullName: '',
+      mainProduct: '',
+      name: '',
+      officialIndustry: '',
+      phone: '',
+      registerDate: '',
+      remark: '',
+      serialNo: '',
+      simpleName: '',
+      type: 1,
+      unifiedSocialCreditCode: ''
+    };
+    let otherFormDef = {
+      settlementMode: '',
+      settlementModeName: '',
+      taxRate: 0,
+      address: '',
+      addressId: '',
+      deptId: '',
+      deptName: '',
+      discount: 0,
+      salesmanId: '',
+      salesmanName: '',
+      sender: '',
+      senderPhone: ''
+    };
+    return {
+      visible: false,
+      title: '',
+      row: {},
+      activeName: 'base',
+      formDef,
+      otherFormDef,
+      form: copyObj(formDef),
+      otherForm: copyObj(otherFormDef),
+      // removeBankList: [],
+      // removeLinkList: [],
+      tableBankData: [],
+      tableLinkData: [],
+      ifChiefList: [
+        {
+          value: 0,
+          label: '否'
+        },
+        {
+          value: 1,
+          label: '是'
+        }
+      ],
+      bankColumns: [
+        {
+          type: 'index',
+          width: 55,
+          align: 'center'
+        },
+        {
+          label: '单位名称',
+          prop: 'accountName',
+          slot: 'accountName',
+          action: 'accountName',
+          headerSlot: 'accountNameHeader'
+        },
+        {
+          label: '银行账号',
+          prop: 'accountNo',
+          slot: 'accountNo',
+          action: 'accountNo'
+        },
+        {
+          label: '开户行',
+          prop: 'bankName',
+          slot: 'bankName',
+          action: 'bankName'
+        },
+        {
+          label: '银行银联号',
+          prop: 'interbankNo',
+          slot: 'interbankNo',
+          action: 'interbankNo'
+        },
+        {
+          action: 'action',
+          slot: 'action',
+          label: '操作'
+        }
+      ],
+      linkColumns: [
+        {
+          type: 'index',
+          width: 55,
+          align: 'center'
+        },
+        {
+          label: '姓名',
+          prop: 'linkName',
+          slot: 'linkName',
+          action: 'linkName',
+          headerSlot: 'linkNameHeader'
+        },
+        {
+          label: '手机',
+          prop: 'mobilePhone',
+          slot: 'mobilePhone',
+          action: 'mobilePhone',
+          headerSlot: 'mobilePhoneHeader'
+        },
+        {
+          label: '电话',
+          prop: 'phone',
+          slot: 'phone',
+          action: 'phone'
         },
-        otherRules: {
-          // settlementMode: [
-          //   { required: true, message: '请输入结算方式', trigger: 'blur' }
-          // ],
-          taxRate: [
-            { required: true, message: '请输入税率', trigger: 'change' }
-          ],
-
-        
 
+        {
+          label: '微信号',
+          prop: 'wechat',
+          slot: 'wechat',
+          action: 'wechat',
         },
-        options: {
-          cityData,
-          categoryData,
+        {
+          label: '邮箱',
+          prop: 'email',
+          slot: 'email',
+          action: 'email'
         },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false,
-
-        // 组织机构树形结构数据
-        groupTreeData: [],
-        // 组织机构平铺数据
-        groupData: [],
-
-        parentShow: false
-      };
-    },
-    created () {
-      this.getGroupAll();
-    },
-    methods: {
-      async open(type, row, contactCategoryId) {
-        this.title = type;
-        this.row = row;
-        this.visible = true;
-        if (type == '新建客户') {
-          this.isUpdate = false;
-          // 默认带出列表页面选中的分类
-          this.form.categoryId = contactCategoryId;
-        } else {
-          this.isUpdate = true;
-          await this._getById(row.id);
+        {
+          label: '部门',
+          prop: 'deptName',
+          slot: 'deptName',
+          action: 'deptName'
+        },
+        {
+          label: '职务',
+          prop: 'post',
+          slot: 'post',
+          action: 'post'
+        },
+        {
+          label: '状态',
+          prop: 'status',
+          slot: 'status',
+          action: 'status',
+          headerSlot: 'statusHeader'
+        },
+        {
+          label: '是否首要',
+          prop: 'ifChief',
+          slot: 'ifChief',
+          action: 'ifChief'
+        },
+        {
+          label: '备注',
+          prop: 'remark',
+          slot: 'remark',
+          action: 'remark'
+        },
+        {
+          action: 'action',
+          slot: 'action',
+          label: '操作'
         }
-      },
+      ],
+      rules: {
 
-      // 获取公司数据
-      getGroupAll () {
-        listOrganizations().then((list) => {
-          this.groupData = list;
-          this.groupTreeData = this.$util.toTreeData({
-            data: list,
-            idField: 'id',
-            parentIdField: 'parentId'
-          });
-        });
-      },
+        categoryId: [
+          {required: true, message: '请选择客户分类', trigger: 'change'}
+        ],
+        simpleName: [
+          {required: true, message: '请输入客户简称', trigger: 'change'}
+        ],
+        name: [
+          {required: true, message: '请输入客户名称', trigger: 'blur'}
+        ],
+        authorizationLimit: [
+          {required: true, message: '请输入授信额度', trigger: 'blur'}
+        ],
 
-      // 选择负责人部门
-      change_principalDep(id) {
-        const info = this.groupData.find(e => e.id == id);
-        this.otherForm.deptName = info.name;
-        this.otherForm.salesmanId = '';
-        this.otherForm.salesmanName = '';
-        // 根据部门获取人员
-        const params = { groupId: id };
-        this.$nextTick(() => {
-          this.$refs.directorRef.getList(params);
-        });
-      },
-      salesmanChange(val, info){
-        this.otherForm.salesmanName = info.name;
+        addressId: [
+          {required: true, message: '请选择地址', trigger: 'change'}
+        ]
       },
-      settlementModeChange(info){
-        this.otherForm.settlementModeName = info.dictValue;
-      },
-      ifChiefChange(value, idx){
-        if(value === 1){
-          this.tableLinkData.forEach(e => e.ifChief = 0);
-          this.tableLinkData[idx].ifChief = 1;
-        }
+      otherRules: {
+        // settlementMode: [
+        //   { required: true, message: '请输入结算方式', trigger: 'blur' }
+        // ],
+        taxRate: [
+          {required: true, message: '请输入税率', trigger: 'change'}
+        ],
+
+
       },
-      addBank() {
-        this.tableBankData.push({
-          accountName: '',
-          accountNo: '',
-          bankName: '',
-          interbankNo: ''
-        });
+      options: {
+        cityData,
+        categoryData,
       },
-      addLink() {
-        this.tableLinkData.push({
-          linkName: '',
-          mobilePhone: '',
-          phone: '',
-          email: '',
-          post: '',
-          status: '',
-          ifChief: 0,
-          remark: ''
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+
+      // 组织机构树形结构数据
+      groupTreeData: [],
+      // 组织机构平铺数据
+      groupData: [],
+
+      parentShow: false
+    };
+  },
+  created() {
+    this.getGroupAll();
+  },
+  methods: {
+    async open(type, row, contactCategoryId) {
+      this.title = type;
+      this.row = row;
+      this.visible = true;
+      if (type == '新建客户') {
+        this.isUpdate = false;
+        // 默认带出列表页面选中的分类
+        this.form.categoryId = contactCategoryId;
+      } else {
+        this.isUpdate = true;
+        await this._getById(row.id);
+      }
+    },
+
+    // 获取公司数据
+    getGroupAll() {
+      listOrganizations().then((list) => {
+        this.groupData = list;
+        this.groupTreeData = this.$util.toTreeData({
+          data: list,
+          idField: 'id',
+          parentIdField: 'parentId'
         });
-      },
-      handleBankDel(row, index) {
-        this.tableBankData.splice(index, 1);
-        if (row?.id) {
+      });
+    },
+
+    // 选择负责人部门
+    change_principalDep(id) {
+      const info = this.groupData.find(e => e.id == id);
+      this.otherForm.deptName = info.name;
+      this.otherForm.salesmanId = '';
+      this.otherForm.salesmanName = '';
+      // 根据部门获取人员
+      const params = {groupId: id};
+      this.$nextTick(() => {
+        this.$refs.directorRef.getList(params);
+      });
+    },
+    salesmanChange(val, info) {
+      this.otherForm.salesmanName = info.name;
+    },
+    settlementModeChange(info) {
+      this.otherForm.settlementModeName = info.dictValue;
+    },
+    ifChiefChange(value, idx) {
+      if (value === 1) {
+        this.tableLinkData.forEach(e => e.ifChief = 0);
+        this.tableLinkData[idx].ifChief = 1;
+      }
+    },
+    addBank() {
+      this.tableBankData.push({
+        accountName: '',
+        accountNo: '',
+        bankName: '',
+        interbankNo: ''
+      });
+    },
+    addLink() {
+      this.tableLinkData.push({
+        linkName: '',
+        mobilePhone: '',
+        phone: '',
+        email: '',
+        post: '',
+        status: '',
+        ifChief: 0,
+        remark: ''
+      });
+    },
+    handleBankDel(row, index) {
+      this.tableBankData.splice(index, 1);
+      if (row?.id) {
         //   this.removeBankList.push(row.id);
-        }
-      },
-      handleLinkDel(row, index) {
-        this.tableLinkData.splice(index, 1);
-        if (row?.id) {
+      }
+    },
+    handleLinkDel(row, index) {
+      this.tableLinkData.splice(index, 1);
+      if (row?.id) {
         //   this.removeLinkList.push(row.id);
-        }
-      },
-      getValidate() {
-          return Promise.all([
-            new Promise((resolve, reject) => {
-              this.$refs.form.validate((valid) => {
-                if (!valid) {
-                  this.activeName = 'base';
-                  reject(false);
-                } else {
-                  resolve(true);
-                }
-              });
-            }),
-            new Promise((resolve, reject) => {
-              this.$refs.otherForm.validate((valid) => {
-                if (!valid) {
-                  this.activeName = 'other';
-                  reject(false);
-                } else {
-                  resolve(true);
-                }
-              });
-            }),
-            new Promise((resolve, reject) => {
-              if (this.tableLinkData.length === 0) {
-                this.$message.error("联系人信息至少有1条");
-                this.activeName = 'link';
-                reject(false);
-              } else {
-                resolve(true);
-              }
-            })
-          ]);
-     },
-      async save() {
-        try {
-           await this.getValidate();
-           // 表单验证通过,执行保存操作
-           this.loading = true;
+      }
+    },
+    getValidate() {
+      return Promise.all([
+        new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              this.activeName = 'base';
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        }),
+        new Promise((resolve, reject) => {
+          this.$refs.otherForm.validate((valid) => {
+            if (!valid) {
+              this.activeName = 'other';
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        }),
+        new Promise((resolve, reject) => {
+          if (this.tableLinkData.length === 0) {
+            this.$message.error("联系人信息至少有1条");
+            this.activeName = 'link';
+            reject(false);
+          } else {
+            resolve(true);
+          }
+        })
+      ]);
+    },
+    async save() {
+      try {
+        await this.getValidate();
+        // 表单验证通过,执行保存操作
+        this.loading = true;
         // 基本信息处理
         if (this.$refs.address.getCheckedNodes()) {
           let node = this.$refs.address.getCheckedNodes()[0];
@@ -806,11 +848,17 @@ export default {
         }
         if (this.form.companyCategoryId) {
           this.form.companyCategoryName = this.getDictValue(
-            '企业类型',
+            '营业类型',
             this.form.companyCategoryId
           );
         }
-        if(this.form.businessLicenseFiles && this.form.businessLicenseFiles.length > 0){
+        if (this.form.enterpriseTypeId) {
+          this.form.enterpriseTypeName = this.getDictValue(
+            '企业类型',
+            this.form.enterpriseTypeId
+          );
+        }
+        if (this.form.businessLicenseFiles && this.form.businessLicenseFiles.length > 0) {
           this.form.businessLicenseFile = this.form.businessLicenseFiles[0];
         } else {
           this.form.businessLicenseFile = null;
@@ -837,8 +885,8 @@ export default {
         if (!this.isUpdate) {
           delete this.form.id;
         } else {
-        //   this.form.removeBankList = this.removeBankList;
-        //   this.form.removeLinkList = this.removeLinkList;
+          //   this.form.removeBankList = this.removeBankList;
+          //   this.form.removeLinkList = this.removeLinkList;
         }
         const data = {
           base: this.form,
@@ -868,76 +916,75 @@ export default {
             .catch((e) => {
               //this.loading = false;
             });
-          }
-        } catch (error) {
-          // 表单验证未通过,不执行保存操作
         }
+      } catch (error) {
+        // 表单验证未通过,不执行保存操作
+      }
 
-      },
-      cancel() {
-        this.$nextTick(() => {
-          this.activeName = 'base';
-          // 关闭后,销毁所有的表单数据
-          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
-          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
-          this.form = copyObj(this.formDef),
+    },
+    cancel() {
+      this.$nextTick(() => {
+        this.activeName = 'base';
+        // 关闭后,销毁所有的表单数据
+        this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
+        this.$refs['formRef'] && this.$refs['formRef'].resetFields();
+        this.form = copyObj(this.formDef),
           this.otherForm = copyObj(this.otherFormDef),
           this.tableBankData = []
-          this.tableLinkData = []
-          this.visible = false;
-        })
-      },
-      async _getById(id) {
-        const data = await contactDetail(id);
-        this.form = data.base;
-        this.otherForm = data.other;
-        this.tableBankData = data.bankList;
-        this.tableLinkData = data.linkList;
-        if(data.base.businessLicenseFile && data.base.businessLicenseFile !== ""){
-          this.$set(this.form,'businessLicenseFiles',[data.base.businessLicenseFile])
-        }
-
-        if(this.tableLinkData && this.tableLinkData.length > 0){
-          this.tableLinkData.forEach(e => e.status = e.status+"");
-        }
-        if(this.otherForm.settlementMode){
-          this.otherForm.settlementMode = this.otherForm.settlementMode + "";
-        }
-
-        // 回显地址选择器
-        if(this.form.addressId && this.form.addressId.length > 0){
-          this.form.addressId = this.form.addressId.split(",");
-        }
-        if(this.otherForm.addressId && this.otherForm.addressId.length > 0){
-          this.otherForm.addressId = this.otherForm.addressId.split(",");
-        }
-        // 回显行业
-        if(this.form.industryCode && this.form.industryCode.length > 0){
-          this.form.industry = this.form.industryCode.split(",");
-        }
-        if(this.otherForm.deptId) {
-          // 编辑时,默认查询组织相关的用户列表,用于回显
-          this.$nextTick(async () => {
-            await this.$refs.directorRef.getList({groupId: this.otherForm.deptId});
-          })
-        }
-      },
-
-      handParent() {
-        let item = {
-          id:  this.form.parentId
-        }
-        this.$refs.parentRef.open(item)
-      },
+        this.tableLinkData = []
+        this.visible = false;
+      })
+    },
+    async _getById(id) {
+      const data = await contactDetail(id);
+      this.form = data.base;
+      this.otherForm = data.other;
+      this.tableBankData = data.bankList;
+      this.tableLinkData = data.linkList;
+      if (data.base.businessLicenseFile && data.base.businessLicenseFile !== "") {
+        this.$set(this.form, 'businessLicenseFiles', [data.base.businessLicenseFile])
+      }
 
-      changeParent(obj) {
-        this.$set( this.form, 'parentId',  obj.id)
-        this.$set( this.form, 'parentName',  obj.name)
+      if (this.tableLinkData && this.tableLinkData.length > 0) {
+        this.tableLinkData.forEach(e => e.status = e.status + "");
+      }
+      if (this.otherForm.settlementMode) {
+        this.otherForm.settlementMode = this.otherForm.settlementMode + "";
+      }
 
+      // 回显地址选择器
+      if (this.form.addressId && this.form.addressId.length > 0) {
+        this.form.addressId = this.form.addressId.split(",");
+      }
+      if (this.otherForm.addressId && this.otherForm.addressId.length > 0) {
+        this.otherForm.addressId = this.otherForm.addressId.split(",");
       }
+      // 回显行业
+      if (this.form.industryCode && this.form.industryCode.length > 0) {
+        this.form.industry = this.form.industryCode.split(",");
+      }
+      if (this.otherForm.deptId) {
+        // 编辑时,默认查询组织相关的用户列表,用于回显
+        this.$nextTick(async () => {
+          await this.$refs.directorRef.getList({groupId: this.otherForm.deptId});
+        })
+      }
+    },
 
+    handParent() {
+      let item = {
+        id: this.form.parentId
+      }
+      this.$refs.parentRef.open(item)
+    },
 
+    changeParent(obj) {
+      this.$set(this.form, 'parentId', obj.id)
+      this.$set(this.form, 'parentName', obj.name)
 
     }
-  };
+
+
+  }
+};
 </script>

+ 269 - 238
src/views/saleManage/contact/components/contactDetailDialog.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"
@@ -24,7 +24,7 @@
                 label="客户分类:"
                 prop="categoryId"
               >
-                {{form.categoryName}}
+                {{ form.categoryName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -33,47 +33,59 @@
                 prop="deptId"
                 style="margin-bottom: 22px"
               >
-                {{form.deptName}}
+                {{ form.deptName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="业务员:" prop="salesmanId">
-                {{form.salesmanName}}
+                {{ form.salesmanName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="客户名称:" prop="name">
-                {{form.name}}
+                {{ form.name }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="客户代号:" prop="serialNo">
-                {{form.serialNo}}
+                {{ form.serialNo }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="客户简称:" prop="simpleName">
-                {{form.simpleName}}
+                {{ form.simpleName }}
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="法定代表人:" prop="legalPerson">
+                {{ form.legalPerson }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="注册资金:" prop="registeredCapital">
+                {{ form.registeredCapital }}
+              </el-form-item>
+            </el-col>
+
+
             <el-col :span="8">
               <el-form-item label="授信额度:" prop="authorizationLimit">
-                {{form.authorizationLimit}}
+                {{ form.authorizationLimit }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="单位电话:" prop="phone">
-                {{form.phone}}
+                {{ form.phone }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="地址:" prop="addressId">
-                {{form.addressName}}
+                {{ form.addressName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="详细地址:" prop="address">
-                {{form.address}}
+                {{ form.address }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -81,32 +93,37 @@
                 label="统一社会信用代码:"
                 prop="unifiedSocialCreditCode"
               >
-                {{form.unifiedSocialCreditCode}}
+                {{ form.unifiedSocialCreditCode }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="所属行业:" prop="industry">
-                {{form.industryFullName}}
+                {{ form.industryFullName }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="营业类型:" prop="companyCategoryId">
+                {{ form.companyCategoryName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="企业类型:" prop="companyCategoryId">
-                {{form.companyCategoryName}}
+                {{ form.enterpriseTypeName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="登记日期:" prop="registerDate">
-                {{form.registerDate}}
+                {{ form.registerDate }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="经营范围:" prop="businessScope">
-                {{form.businessScope}}
+                {{ form.businessScope }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="主营产品:" prop="mainProduct">
-                {{form.mainProduct}}
+                {{ form.mainProduct }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -121,12 +138,13 @@
               <el-form-item prop="businessLicenseFile" label="营业执照附件:">
                 <el-link v-if="form.businessLicenseFile && form.businessLicenseFile !== ''"
                          type="primary" :underline="false"
-                         @click="downloadFile(form.businessLicenseFile)"> {{ form.businessLicenseFile.name }}</el-link>
+                         @click="downloadFile(form.businessLicenseFile)"> {{ form.businessLicenseFile.name }}
+                </el-link>
               </el-form-item>
             </el-col>
             <el-col :span="16">
               <el-form-item label="备注:" prop="remark">
-                {{form.remark}}
+                {{ form.remark }}
               </el-form-item>
             </el-col>
           </el-row>
@@ -146,16 +164,16 @@
           </template>
 
           <template v-slot:accountName="{ row }">
-            {{row.accountName}}
+            {{ row.accountName }}
           </template>
           <template v-slot:accountNo="{ row }">
-            {{row.accountNo}}
+            {{ row.accountNo }}
           </template>
           <template v-slot:bankName="{ row }">
-            {{row.bankName}}
+            {{ row.bankName }}
           </template>
           <template v-slot:interbankNo="{ row }">
-            {{row.interbankNo}}
+            {{ row.interbankNo }}
           </template>
         </ele-pro-table>
       </el-tab-pane>
@@ -179,19 +197,22 @@
           </template>
 
           <template v-slot:linkName="{ row }">
-            {{row.linkName}}
+            {{ row.linkName }}
           </template>
           <template v-slot:mobilePhone="{ row }">
-            {{row.mobilePhone}}
+            {{ row.mobilePhone }}
           </template>
           <template v-slot:phone="{ row }">
-            {{row.phone}}
+            {{ row.phone }}
           </template>
           <template v-slot:email="{ row }">
-            {{row.email}}
+            {{ row.email }}
+          </template>
+          <template v-slot:deptName="{ row }">
+            {{ row.deptName }}
           </template>
           <template v-slot:post="{ row }">
-            {{row.post}}
+            {{ row.post }}
           </template>
           <template v-slot:ifChief="{ row, $index }">
             <el-select v-model="row.ifChief" class="w100" disabled>
@@ -211,7 +232,7 @@
             ></DictSelection>
           </template>
           <template v-slot:remark="{ row }">
-            {{row.remark}}
+            {{ row.remark }}
           </template>
         </ele-pro-table>
       </el-tab-pane>
@@ -225,39 +246,39 @@
           <el-row>
             <el-col :span="8">
               <el-form-item label="结算方式:" prop="settlementMode">
-                {{otherForm.settlementModeName}}
+                {{ otherForm.settlementModeName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="税率:" prop="taxRate">
-                {{otherForm.taxRate}} %
+                {{ otherForm.taxRate }} %
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="折扣率:" prop="discount">
-                {{otherForm.discount}} %
+                {{ otherForm.discount }} %
               </el-form-item>
             </el-col>
-     
+
 
             <el-col :span="8">
               <el-form-item label="收件人:" prop="sender">
-                {{otherForm.sender}}
+                {{ otherForm.sender }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="收件人电话:" prop="senderPhone">
-                {{otherForm.senderPhone}}
+                {{ otherForm.senderPhone }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="收件人地址:" prop="addressId">
-                {{otherForm.addressName}}
+                {{ otherForm.addressName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="收件人详细地址:" prop="address" >
-                {{otherForm.address}}
+              <el-form-item label="收件人详细地址:" prop="address">
+                {{ otherForm.address }}
               </el-form-item>
             </el-col>
           </el-row>
@@ -283,213 +304,223 @@ import {copyObj} from '@/utils/util';
 
 
 export default {
-    props: {
-      categoryTreeList: Array
-    },
-    mixins: [dictMixins],
-    components: {
-      fileUpload,
-      deptSelect,
-      personSelect
-    },
-    data() {
-      let formDef = {
-          address: '',
-          addressId: 0,
-          addressName: '',
-          authorizationLimit: 0,
-          businessLicenseFile: {},
-          businessScope: '',
-          categoryId: '',
-          categoryName: '',
-          companyCategoryId: '',
-          companyCategoryName: '',
-          hasParentGroup: 0,
-          industry: '',
-          industryCode: '',
-          industryFullName: '',
-          mainProduct: '',
-          name: '',
-          officialIndustry: '',
-          phone: '',
-          registerDate: '',
-          remark: '',
-          serialNo: '',
-          simpleName: '',
-          type: 1,
-          unifiedSocialCreditCode: ''
-        };
-      let otherFormDef = {
-        settlementMode: '',
-        settlementModeName: '',
-        taxRate: 0,
-        address: '',
-        addressId: '',
-        deptId: '',
-        deptName: '',
-        discount: 0,
-        salesmanId: '',
-        salesmanName: '',
-        sender: '',
-        senderPhone: ''
-      };
-      return {
-        visible: false,
-        title: '客户详情',
-        row: {},
-        activeName: 'base',
-        formDef,
-        otherFormDef,
-        form: copyObj(formDef),
-        otherForm: copyObj(otherFormDef),
-        tableBankData: [],
-        tableLinkData: [],
-        ifChiefList: [
-          {
-            value: 0,
-            label: '否'
-          },
-          {
-            value: 1,
-            label: '是'
-          }
-        ],
-        bankColumns: [
-          {
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            label: '单位名称',
-            prop: 'accountName',
-            slot: 'accountName',
-            action: 'accountName',
-            headerSlot: 'accountNameHeader'
-          },
-          {
-            label: '银行账号',
-            prop: 'accountNo',
-            slot: 'accountNo',
-            action: 'accountNo'
-          },
-          {
-            label: '开户行',
-            prop: 'bankName',
-            slot: 'bankName',
-            action: 'bankName'
-          },
-          {
-            label: '银行银联号',
-            prop: 'interbankNo',
-            slot: 'interbankNo',
-            action: 'interbankNo'
-          },
-        ],
-        linkColumns: [
-          {
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            label: '姓名',
-            prop: 'linkName',
-            slot: 'linkName',
-            action: 'linkName',
-            headerSlot: 'linkNameHeader'
-          },
-          {
-            label: '手机',
-            prop: 'mobilePhone',
-            slot: 'mobilePhone',
-            action: 'mobilePhone',
-            headerSlot: 'mobilePhoneHeader'
-          },
-          {
-            label: '电话',
-            prop: 'phone',
-            slot: 'phone',
-            action: 'phone'
-          },
-          {
-            label: '微信号',
-            prop: 'wechat',
-            slot: 'wechat',
-            action: 'wechat'
-          },
-          {
-            label: '邮箱',
-            prop: 'email',
-            slot: 'email',
-            action: 'email'
-          },
-          {
-            label: '职务',
-            prop: 'post',
-            slot: 'post',
-            action: 'post'
-          },
-          {
-            label: '状态',
-            prop: 'status',
-            slot: 'status',
-            action: 'status',
-            headerSlot: 'statusHeader'
-          },
-          {
-            label: '是否首要',
-            prop: 'ifChief',
-            slot: 'ifChief',
-            action: 'ifChief'
-          },
-          {
-            label: '备注',
-            prop: 'remark',
-            slot: 'remark',
-            action: 'remark'
-          },
-        ],
-      };
+  props: {
+    categoryTreeList: Array
+  },
+  mixins: [dictMixins],
+  components: {
+    fileUpload,
+    deptSelect,
+    personSelect
+  },
+  data() {
+    let formDef = {
+      address: '',
+      addressId: 0,
+      addressName: '',
+      authorizationLimit: 0,
+      businessLicenseFile: {},
+      businessScope: '',
+      categoryId: '',
+      categoryName: '',
+      companyCategoryId: '',
+      companyCategoryName: '',
+      enterpriseTypeName: '',
+      enterpriseTypeId: '',
+      hasParentGroup: 0,
+      industry: '',
+      industryCode: '',
+      industryFullName: '',
+      mainProduct: '',
+      name: '',
+      officialIndustry: '',
+      phone: '',
+      registerDate: '',
+      remark: '',
+      serialNo: '',
+      simpleName: '',
+      legalPerson: '',
+      registeredCapital: '',
+      type: 1,
+      unifiedSocialCreditCode: ''
+    };
+    let otherFormDef = {
+      settlementMode: '',
+      settlementModeName: '',
+      taxRate: 0,
+      address: '',
+      addressId: '',
+      deptId: '',
+      deptName: '',
+      discount: 0,
+      salesmanId: '',
+      salesmanName: '',
+      sender: '',
+      senderPhone: ''
+    };
+    return {
+      visible: false,
+      title: '客户详情',
+      row: {},
+      activeName: 'base',
+      formDef,
+      otherFormDef,
+      form: copyObj(formDef),
+      otherForm: copyObj(otherFormDef),
+      tableBankData: [],
+      tableLinkData: [],
+      ifChiefList: [
+        {
+          value: 0,
+          label: '否'
+        },
+        {
+          value: 1,
+          label: '是'
+        }
+      ],
+      bankColumns: [
+        {
+          type: 'index',
+          width: 55,
+          align: 'center'
+        },
+        {
+          label: '单位名称',
+          prop: 'accountName',
+          slot: 'accountName',
+          action: 'accountName',
+          headerSlot: 'accountNameHeader'
+        },
+        {
+          label: '银行账号',
+          prop: 'accountNo',
+          slot: 'accountNo',
+          action: 'accountNo'
+        },
+        {
+          label: '开户行',
+          prop: 'bankName',
+          slot: 'bankName',
+          action: 'bankName'
+        },
+        {
+          label: '银行银联号',
+          prop: 'interbankNo',
+          slot: 'interbankNo',
+          action: 'interbankNo'
+        },
+      ],
+      linkColumns: [
+        {
+          type: 'index',
+          width: 55,
+          align: 'center'
+        },
+        {
+          label: '姓名',
+          prop: 'linkName',
+          slot: 'linkName',
+          action: 'linkName',
+          headerSlot: 'linkNameHeader'
+        },
+        {
+          label: '手机',
+          prop: 'mobilePhone',
+          slot: 'mobilePhone',
+          action: 'mobilePhone',
+          headerSlot: 'mobilePhoneHeader'
+        },
+        {
+          label: '电话',
+          prop: 'phone',
+          slot: 'phone',
+          action: 'phone'
+        },
+        {
+          label: '微信号',
+          prop: 'wechat',
+          slot: 'wechat',
+          action: 'wechat'
+        },
+        {
+          label: '邮箱',
+          prop: 'email',
+          slot: 'email',
+          action: 'email'
+        },
+        {
+          label: '部门',
+          prop: 'deptName',
+          slot: 'deptName',
+          action: 'deptName'
+        },
+        {
+          label: '职务',
+          prop: 'post',
+          slot: 'post',
+          action: 'post'
+        },
+        {
+          label: '状态',
+          prop: 'status',
+          slot: 'status',
+          action: 'status',
+          headerSlot: 'statusHeader'
+        },
+        {
+          label: '是否首要',
+          prop: 'ifChief',
+          slot: 'ifChief',
+          action: 'ifChief'
+        },
+        {
+          label: '备注',
+          prop: 'remark',
+          slot: 'remark',
+          action: 'remark'
+        },
+      ],
+    };
+  },
+  methods: {
+    async open(row) {
+      this.row = row;
+      this.visible = true;
+      await this._getById(row.id);
     },
-    methods: {
-      async open(row) {
-        this.row = row;
-        this.visible = true;
-        await this._getById(row.id);
-      },
 
-      cancel() {
-        this.$nextTick(() => {
-          // 关闭后,销毁所有的表单数据
-          this.form = copyObj(this.formDef),
+    cancel() {
+      this.$nextTick(() => {
+        // 关闭后,销毁所有的表单数据
+        this.form = copyObj(this.formDef),
           this.otherForm = copyObj(this.otherFormDef),
           this.tableBankData = []
-          this.tableLinkData = []
-          this.visible = false;
-        })
-      },
+        this.tableLinkData = []
+        this.visible = false;
+      })
+    },
 
-      async _getById(id) {
-        const data = await contactDetail(id);
-        this.form = data.base;
-        this.otherForm = data.other;
-        this.tableBankData = data.bankList;
-        this.tableLinkData = data.linkList;
+    async _getById(id) {
+      const data = await contactDetail(id);
+      this.form = data.base;
+      this.otherForm = data.other;
+      this.tableBankData = data.bankList;
+      this.tableLinkData = data.linkList;
 
-        if(this.tableLinkData && this.tableLinkData.length > 0){
-          this.tableLinkData.forEach(e => e.status = e.status+"");
-        }
+      if (this.tableLinkData && this.tableLinkData.length > 0) {
+        this.tableLinkData.forEach(e => e.status = e.status + "");
+      }
 
-        await getCategoryInfo(this.form.categoryId).then((res) => {
-          this.$set(this.form,'categoryName', res.data.name)
-        });
-      },
+      await getCategoryInfo(this.form.categoryId).then((res) => {
+        this.$set(this.form, 'categoryName', res.data.name)
+      });
+    },
 
-      downloadFile(file){
-        getFile({ objectName: file.storePath }, file.name);
-      },
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
+    },
 
-    }
-  };
+  }
+};
 </script>