Browse Source

Merge branch 'dev-mlchen-customer' into dev

mlchen 13 hours ago
parent
commit
27fe765d68

+ 26 - 1
src/api/saleManage/contact.js

@@ -21,6 +21,19 @@ export async function contactPageUsages(params) {
   return Promise.reject(new Error(res.data.message));
 }
 
+/**
+ * 校验客户证书资质是否可用于业务单据
+ */
+export async function assertContactQualification(id) {
+  const res = await request.get(`/eom/contact/qualification/assert/${id}`, {
+    showErrorToast: false
+  });
+  if (res.data.code == 0) {
+    return true;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 /**
  * 获取客户信息详情
  */
@@ -32,6 +45,18 @@ export async function contactDetail(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
+export async function contactVersionList(contactId) {
+  const res = await request.get('/eom/contact/version/list', { params: { contactId } });
+  if (res.data.code == 0) return res.data.data;
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function contactVersionDetail(contactId, version) {
+  const res = await request.get(`/eom/contact/version/getById/${contactId}/${version}`);
+  if (res.data.code == 0) return res.data.data;
+  return Promise.reject(new Error(res.data.message));
+}
+
 /**
  * 更新客户信息
  */
@@ -358,4 +383,4 @@ export async function customerAdd(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 1 - 1
src/components/upload/import-dialog.vue

@@ -135,7 +135,7 @@
             this.$message.success('操作成功!');
             this.dialogVisible = false;
             this.isProgress = false;
-            this.$emit('success');
+            this.$emit('success', res.data);
           })
           .catch(() => {
             this.isProgress = false;

+ 14 - 0
src/views/financialManage/components/customerListDialog.vue

@@ -95,6 +95,13 @@ export default {
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'serialNo',
             label: '客户代号',
@@ -195,6 +202,13 @@ export default {
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'serialNo',
             label: '供应商代号',

+ 7 - 0
src/views/purchasingManage/producerManage/components/parentList.vue

@@ -91,6 +91,13 @@ export default {
           showOverflowTooltip: true,
           minWidth: 200
         },
+        {
+          prop: 'version',
+          label: '版本号',
+          align: 'center',
+          width: 80,
+          formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+        },
         {
           prop: 'serialNo',
           label: '代号',

+ 7 - 0
src/views/purchasingManage/producerManage/index.vue

@@ -201,6 +201,13 @@ import tabMixins from '@/mixins/tableColumnsMixin';
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'serialNo',
             label: '代号',

+ 7 - 0
src/views/purchasingManage/supplierManage/components/parentList.vue

@@ -110,6 +110,13 @@ import tabMixins from '@/mixins/tableColumnsMixin';
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'serialNo',
             label: '供应商代号',

+ 7 - 0
src/views/purchasingManage/supplierManage/index.vue

@@ -226,6 +226,13 @@
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'serialNo',
             label: '代号',

+ 17 - 2
src/views/saleManage/contact/components/addContactDialog.vue

@@ -806,7 +806,7 @@
         v-if="
           form.type == 1 &&
           activeName == '5' &&
-          form.qualificationCensorship == '1'
+          contactApprovalEnabled
         "
         @click="save('sub')"
         v-click-once
@@ -953,6 +953,7 @@ import tabMixins from '@/mixins/tableColumnsMixin';
       return {
       cacheKeyUrl: 'views_saleManage_contact_components_addContactDialog',
         enableStatus: '2',
+        contactApprovalEnabled: false,
         fullscreen: false,
         visible: false,
         certificateQualificationsDialogFlag: false,
@@ -961,6 +962,7 @@ import tabMixins from '@/mixins/tableColumnsMixin';
         row: {},
         activeName: '1',
         formDef,
+        editVersion: null,
         supplyList: [],
         otherFormDef,
         form: copyObj(formDef),
@@ -1410,9 +1412,15 @@ import tabMixins from '@/mixins/tableColumnsMixin';
     created() {
       this.getGroupAll();
       this.requestDict('生产类型');
+<<<<<<< HEAD
       // 副表(联系人信息、供货列表)列宽缓存,与主表列配置隔离
       this.loadScopedColumnWidth('sub1');
       this.loadScopedColumnWidth('sub2');
+=======
+      parameterGetByCode({ code: 'contact_is_approval' }).then((res) => {
+        this.contactApprovalEnabled = String(res.value) === '1';
+      });
+>>>>>>> dev-mlchen-customer
     },
     methods: {
       // 副表(联系人信息)表头拖拽列宽持久化,scope: sub1
@@ -1433,6 +1441,7 @@ import tabMixins from '@/mixins/tableColumnsMixin';
       },
       async open(type, row, contactCategoryId, pageType) {
         this.resetForm()
+        this.editVersion = null;
         // return
         this.form.type = pageType || 1;
         this.title = type;
@@ -1758,7 +1767,7 @@ import tabMixins from '@/mixins/tableColumnsMixin';
             this.form.type != 1 ? (this.getLabel == '供货列表' ? '2' : '3') : 1;
             console.log(this.form, 'this.form~~~~~~~~');
           const data = {
-            base: this.form,
+            base: this.isUpdate ? { ...this.form, version: this.editVersion } : this.form,
             other: this.otherForm,
             bankList: this.tableBankData,
             linkList: this.tableLinkData,
@@ -1766,6 +1775,11 @@ import tabMixins from '@/mixins/tableColumnsMixin';
           };
           this.tableCertificateDataList = this.$refs.certificateManagementRef.getTableValue();
           if (this.isUpdate) {
+            if (this.editVersion == null) {
+              this.loading = false;
+              this.$message.error('客户版本缺失,请刷新后重试');
+              return;
+            }
             contactUpdate(data)
               .then((res) => {
                 this.loading = false;
@@ -1843,6 +1857,7 @@ import tabMixins from '@/mixins/tableColumnsMixin';
       async _getById(id) {
         const data = await contactDetail(id);
         this.form = data.base;
+        this.editVersion = data.base.version;
         this.otherForm = data.other;
         this.tableBankData = data.bankList;
         this.tableLinkData = data.linkList;

+ 73 - 7
src/views/saleManage/contact/components/contactDetailDialog.vue

@@ -325,6 +325,10 @@
             </el-col>
           </el-row>
         </el-form>
+        <template v-if="versionMode">
+          <headerTitle title="关联产品" style="margin-top: 30px"></headerTitle>
+          <ele-pro-table :columns="productColumns" :datasource="productList" :need-page="false" :toolkit="[]" height="300px"></ele-pro-table>
+        </template>
       </el-tab-pane>
 <!--      <el-tab-pane label="银行信息" name="bank">-->
 <!--       -->
@@ -343,7 +347,7 @@
           <!-- 操作栏 -->
           <template v-slot:action="scope">
             <el-link
-              v-if="[1,2].includes(scope.row.approvalStatus)"
+              v-if="!versionMode && [1,2].includes(scope.row.approvalStatus)"
               type="primary"
               :underline="false"
               icon="el-icon-edit"
@@ -353,7 +357,7 @@
           </template>
         </ele-pro-table>
       </el-tab-pane>
-      <el-tab-pane label="订单记录"  name="order">
+      <el-tab-pane v-if="!versionMode" label="订单记录"  name="order">
         <headerTitle title="订单记录" style="margin-top: 30px"></headerTitle>
         <div class="ele-border-lighter form-content">
           <!-- 数据表格 -->
@@ -391,7 +395,7 @@
           </ele-pro-table>
         </div>
       </el-tab-pane>
-      <el-tab-pane label="发货记录" name="send">
+      <el-tab-pane v-if="!versionMode" label="发货记录" name="send">
         <headerTitle title="发货记录" style="margin-top: 30px"></headerTitle>
         <div class="ele-border-lighter form-content" >
           <!-- 数据表格 -->
@@ -474,7 +478,7 @@
           </ele-pro-table>
         </div>
       </el-tab-pane>
-      <el-tab-pane label="退货记录" name="return">
+      <el-tab-pane v-if="!versionMode" label="退货记录" name="return">
         <headerTitle title="退货记录" style="margin-top: 30px"></headerTitle>
         <div class="ele-border-lighter form-content">
           <!-- 数据表格 -->
@@ -573,7 +577,7 @@
         </div>
 
       </el-tab-pane>
-      <el-tab-pane label="对账记录" name="reconciliation">
+      <el-tab-pane v-if="!versionMode" label="对账记录" name="reconciliation">
         <headerTitle title="对账记录" style="margin-top: 30px"></headerTitle>
         <div class="ele-border-lighter form-content">
           <!-- 数据表格 -->
@@ -665,7 +669,7 @@
           </ele-pro-table>
         </div>
       </el-tab-pane>
-      <el-tab-pane label="开票记录" name="invoice">
+      <el-tab-pane v-if="!versionMode" label="开票记录" name="invoice">
         <headerTitle title="开票记录" style="margin-top: 30px"></headerTitle>
         <el-card shadow="never" >
           <!-- 数据表格 -->
@@ -701,6 +705,14 @@
           </ele-pro-table>
         </el-card>
       </el-tab-pane>
+      <el-tab-pane label="版本历史" name="versions">
+        <el-alert v-if="versionMode" title="当前正在查看历史快照,内容只读。" type="info" :closable="false" />
+        <ele-pro-table :columns="versionColumns" :datasource="versionList" :need-page="false" height="420px">
+          <template v-slot:action="{ row }">
+            <el-link type="primary" :underline="false" @click="openVersion(row)">查看</el-link>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
       <el-tab-pane label="审批流程" name="bpm">
         <bpmDetail
           v-if="activeName === 'bpm' && form.processInstanceId"
@@ -710,6 +722,8 @@
     </el-tabs>
 
     <div slot="footer" class="footer">
+      <span v-if="versionMode" class="ele-text-info">历史版本只读</span>
+      <el-button v-if="versionMode" type="primary" @click="returnCurrent">返回当前版本</el-button>
       <el-button @click="cancel">返回</el-button>
     </div>
     <!-- 资质证书弹窗   -->
@@ -725,7 +739,7 @@
 </template>
 
 <script>
-import {contactDetail, contactQcPackPageAPI} from '@/api/saleManage/contact';
+import {contactDetail, contactQcPackPageAPI, contactVersionList, contactVersionDetail} from '@/api/saleManage/contact';
 import {getFile} from '@/api/system/file';
 import {getInfoById as getCategoryInfo, getInfoByIds} from '@/api/classifyManage/index';
 import fileUpload from '@/components/upload/fileUpload';
@@ -817,6 +831,31 @@ export default {
       otherForm: copyObj(otherFormDef),
       tableBankData: [],
       tableLinkData: [],
+      productList: [],
+      productColumns: [
+        { prop: 'productCode', label: '产品编码', minWidth: 130 },
+        { prop: 'productName', label: '产品名称', minWidth: 150 },
+        { prop: 'purchasingCycle', label: '采购周期', minWidth: 100 },
+        { prop: 'purchaseMultiplier', label: '采购倍数', minWidth: 100 },
+        { prop: 'minimumOrderQuantity', label: '最低订购数量', minWidth: 120 },
+        { prop: 'provenance', label: '产地', minWidth: 130 },
+        { prop: 'manufacturer', label: '生产厂家', minWidth: 130 },
+        { prop: 'imgCode', label: '图号/件号', minWidth: 120 },
+        { prop: 'packingSpecification', label: '包装规格', minWidth: 110 },
+        { prop: 'brandNum', label: '牌号', minWidth: 100 },
+        { prop: 'modelType', label: '型号', minWidth: 100 },
+        { prop: 'specification', label: '规格', minWidth: 100 },
+        { prop: 'measuringUnit', label: '计量单位', minWidth: 100 }
+      ],
+      certificateList: [],
+      versionList: [],
+      versionMode: false,
+      versionColumns: [
+        { prop: 'version', label: '版本号', align: 'center', formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0` },
+        { prop: 'createTime', label: '修改时间', align: 'center' },
+        { prop: 'approvalStatus', label: '审批状态', align: 'center' },
+        { action: 'action', slot: 'action', label: '操作', align: 'center' }
+      ],
       ifChiefList: [
         {
           value: 0,
@@ -1601,8 +1640,27 @@ bankColumns() {
     async open(row) {
       this.row = row;
       this.visible = true;
+      this.versionMode = false;
       await this._getById(row.id);
     },
+    async openSnapshot(data, version) {
+      this.versionMode = true;
+      this.title = `客户历史版本 V${version || 1}.0`;
+      this.visible = true;
+      await this._applyData(data);
+    },
+    async returnCurrent() {
+      this.versionMode = false;
+      this.title = '客户详情';
+      await this._getById(this.form.id);
+    },
+    async openVersion(version) {
+      const data = await contactVersionDetail(this.form.id, version.version);
+      this.visible = true;
+      this.title = `客户历史版本 V${version.version || 1}.0`;
+      await this._applyData(data);
+      this.activeName = 'base';
+    },
     /* 订单记录表格数据源 */
     orderDatasource({page, limit, where, order}) {
       return  getTableList({
@@ -1657,15 +1715,22 @@ bankColumns() {
           this.tableBankData = []
         this.tableLinkData = []
         this.visible = false;
+        this.versionMode = false;
       })
     },
 
     async _getById(id) {
       const data = await contactDetail(id);
+      this._applyData(data);
+      this.versionList = await contactVersionList(id);
+    },
+    async _applyData(data) {
       this.form = data.base;
       this.otherForm = data.other;
       this.tableBankData = data.bankList;
       this.tableLinkData = data.linkList;
+      this.productList = data.productList || [];
+      this.certificateList = data.certificateList || [];
       if (this.tableLinkData && this.tableLinkData.length > 0) {
         this.tableLinkData.forEach(e => e.status = e.status + "");
       }
@@ -1692,6 +1757,7 @@ bankColumns() {
     /* 证书资质表格数据源 */
     tableCertificateData({page, limit, where}) {
       if (!this.form.id) return []
+      if (this.versionMode) return this.certificateList;
       return contactQcPackPageAPI({
         pageNum: page,
         size: limit,

+ 27 - 3
src/views/saleManage/contact/components/drawer.vue

@@ -151,6 +151,13 @@
               :id="row.base?.processInstanceId"
             ></bpmDetail>
           </el-tab-pane>
+          <el-tab-pane label="版本历史" name="版本历史">
+            <ele-pro-table :columns="versionColumns" :datasource="versionList" :need-page="false" height="420px">
+              <template v-slot:action="{ row }">
+                <el-link type="primary" :underline="false" @click="openVersion(row)">查看</el-link>
+              </template>
+            </ele-pro-table>
+          </el-tab-pane>
           <el-tab-pane label="售后工单" name="售后工单">
             
           <saleOderAftersalesList
@@ -203,6 +210,7 @@
           <el-button type="primary" @click="commitComment">发布</el-button>
         </div>
       </ele-modal>
+      <contact-detail-dialog ref="versionDetailRef"></contact-detail-dialog>
     </div>
   </el-drawer>
 </template>
@@ -211,7 +219,9 @@
   import {
     contactDetail,
     updateContactDynamics,
-    queryContactIdCount
+    queryContactIdCount,
+    contactVersionList,
+    contactVersionDetail
   } from '@/api/saleManage/contact';
   import dictMixins from '@/mixins/dictMixins';
   import contactInfo from './darwerComponents/contactInfo.vue';
@@ -261,6 +271,7 @@
   import { mapGetters } from 'vuex';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import certificateManagement from '@/views/saleManage/contact/components/certificateManagement/index.vue';
+  import contactDetailDialog from './contactDetailDialog.vue';
   export default {
     mixins: [dictMixins],
 
@@ -288,7 +299,8 @@
       applyList,
       supplyList,
       saleOderAftersalesList,
-      entrustedReceive
+      entrustedReceive,
+      contactDetailDialog
     },
     data() {
       return {
@@ -306,7 +318,14 @@
           totalAmountSaleOrder: '', //销售订单总额
           totalAmountReturn: '' //回款总额
         },
-        pageName: 'myList'
+        pageName: 'myList',
+        versionList: [],
+        versionColumns: [
+          { prop: 'version', label: '版本号', align: 'center', formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0` },
+          { prop: 'createTime', label: '修改时间', align: 'center' },
+          { prop: 'approvalStatus', label: '审批状态', align: 'center' },
+          { action: 'action', slot: 'action', label: '操作', align: 'center' }
+        ]
       };
     },
     created() {
@@ -321,6 +340,7 @@
         this.activeName = '详细信息';
 
         this.row = await contactDetail(row.id);
+        this.versionList = await contactVersionList(row.id);
         if (this.row?.listApply) {
           this.row?.listApply.forEach((item, index) => {
             this.$set(
@@ -352,6 +372,10 @@
           this.$refs.saleOderAftersalesListRef.init();
         });
       },
+      async openVersion(version) {
+        const data = await contactVersionDetail(this.row.base.id, version.version);
+        this.$refs.versionDetailRef.openSnapshot(data, version.version);
+      },
       async commitComment() {
         await updateContactDynamics({
           id: this.row.base.id,

+ 19 - 4
src/views/saleManage/contact/components/parentList.vue

@@ -58,7 +58,10 @@
 </template>
 
 <script>
-  import { contactPageUsages } from '@/api/saleManage/contact';
+  import {
+    assertContactQualification,
+    contactPageUsages
+  } from '@/api/saleManage/contact';
   import ContactSearch from './contactSearch.vue';
   import AssetTree from '@/components/AssetTree';
 import tabMixins from '@/mixins/tableColumnsMixin';
@@ -112,6 +115,13 @@ import tabMixins from '@/mixins/tableColumnsMixin';
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'serialNo',
             label: '客户代号',
@@ -227,12 +237,17 @@ import tabMixins from '@/mixins/tableColumnsMixin';
         this.radio = '';
       },
 
-      selected() {
+      async selected() {
         if (!this.current) {
           return this.$message.warning('请选择客户');
         }
-        this.$emit('changeParent', this.current);
-        this.handleClose();
+        try {
+          await assertContactQualification(this.current.id);
+          this.$emit('changeParent', this.current);
+          this.handleClose();
+        } catch (error) {
+          this.$message.error(error.message || '客户资质校验失败');
+        }
       }
     }
   };

+ 25 - 12
src/views/saleManage/contact/contactList.vue

@@ -103,9 +103,7 @@
             <el-link
               type="primary"
               v-if="
-                [0, 3].includes(row.approvalStatus) ||
-                ([2].includes(row.approvalStatus) &&
-                  contact_approval_afterupdate == 1)
+                    row.assignStatus !== 1 && [0, 2, 3].includes(row.approvalStatus)
               "
               :underline="false"
               icon="el-icon-edit"
@@ -113,6 +111,12 @@
             >
               修改
             </el-link>
+            <el-link
+              type="primary"
+              v-if="contactApprovalEnabled && [0, 3].includes(row.approvalStatus)"
+              :underline="false"
+              @click="sub(row)"
+            >提交</el-link>
 
             <el-popconfirm
               class="ele-action"
@@ -122,9 +126,7 @@
               <template v-slot:reference>
                 <el-link
                   v-if="
-                    [0, 3].includes(row.approvalStatus) ||
-                    ([2].includes(row.approvalStatus) &&
-                      contact_approval_afterupdate == 1)
+                    row.assignStatus !== 1 && [0, 3].includes(row.approvalStatus)
                   "
                   type="danger"
                   :underline="false"
@@ -154,7 +156,7 @@
     ></process-submit-dialog>
     <importDialog
       ref="importDialogRef"
-      @success="reload"
+      @success="handleImportSuccess"
       :fileUrl="'/eos/importTemplate/客户信息导入模板.xlsx'"
       fileName="客户信息导入模板"
       apiUrl="/eom/contact/importFile"
@@ -207,8 +209,8 @@
     data() {
       return {
         selection: [],
+        contactApprovalEnabled: null,
         defaultExpandedKeys: [],
-        contact_approval_afterupdate: 0,
         params: {},
         delVisible: false,
         // 加载状态
@@ -239,6 +241,13 @@
             minWidth: 140,
             fixed: 'left'
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'name',
             label: '名称',
@@ -395,10 +404,8 @@
     created() {
       this.requestDict('状态');
       this.getTreeData();
-      parameterGetByCode({
-        code: 'contact_approval_afterupdate'
-      }).then((res) => {
-        this.contact_approval_afterupdate = res.value;
+      parameterGetByCode({ code: 'contact_is_approval' }).then((res) => {
+        this.contactApprovalEnabled = String(res.value) === '1';
       });
     },
     methods: {
@@ -562,6 +569,12 @@
       uploadFile() {
         this.$refs.importDialogRef.open();
       },
+      handleImportSuccess(data) {
+        this.reload();
+        if (this.contactApprovalEnabled === true && data && data.successList && data.successList.length) {
+          this.$message.info(`导入成功 ${data.successList.length} 条,请提交审批`);
+        }
+      },
       openDetail(row) {
         this.$refs.drawerRef.open(row);
       }

+ 35 - 14
src/views/saleManage/contact/contactListAdmin.vue

@@ -62,7 +62,7 @@
               type="primary"
               class="el-icon-icon"
               @click="assign('all')"
-              :disabled="selection?.length === 0"
+              :disabled="selection?.length === 0 || selection.some(item => item.approvalStatus !== 2)"
               v-if="$hasPermission('eom:contact:assign')"
             >
               批量指派
@@ -122,17 +122,21 @@
               v-if="
                 row.assignStatus !== 1 &&
                 $hasPermission('eom:contact:update') &&
-                (([2].includes(row.approvalStatus) &&
-                  contact_approval_afterupdate == 1) ||
-                  [0, 3].includes(row.approvalStatus))
+                [0, 2, 3].includes(row.approvalStatus)
               "
             >
               修改
             </el-link>
+            <el-link
+              type="primary"
+              v-if="contactApprovalEnabled && [0, 3].includes(row.approvalStatus)"
+              :underline="false"
+              @click="sub(row)"
+            >提交</el-link>
             <el-link
               type="primary"
               v-if="
-                row.assignStatus === 0 && $hasPermission('eom:contact:assign')
+                row.assignStatus === 0 && row.approvalStatus === 2 && $hasPermission('eom:contact:assign')
               "
               :underline="false"
               @click="assign('', row)"
@@ -182,9 +186,7 @@
               v-if="
                 row.assignStatus !== 1 &&
                 $hasPermission('eom:contact:delete') &&
-                (([2].includes(row.approvalStatus) &&
-                  contact_approval_afterupdate == 1) ||
-                  [0, 3].includes(row.approvalStatus))
+                [0, 3].includes(row.approvalStatus)
               "
               @confirm="remove(row)"
             >
@@ -223,7 +225,7 @@
     <myqsCode ref="qsCodeRef"></myqsCode>
     <importDialog
       ref="importDialogRef"
-      @success="reload"
+      @success="handleImportSuccess"
       :fileUrl="'/eos/importTemplate/客户信息导入模板.xlsx'"
       fileName="客户信息导入模板"
       apiUrl="/eom/contact/importFile"
@@ -275,10 +277,10 @@
     data() {
       return {
         selection: [],
+        contactApprovalEnabled: null,
         defaultExpandedKeys: [],
         delVisible: false,
         processSubmitDialogFlag: false,
-        contact_approval_afterupdate: 0,
         params: {},
         // 加载状态
         loading: false,
@@ -306,6 +308,13 @@
             minWidth: 140,
             fixed: 'left'
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'name',
             label: '名称',
@@ -474,10 +483,8 @@
     created() {
       this.requestDict('状态');
       this.getTreeData();
-      parameterGetByCode({
-        code: 'contact_approval_afterupdate'
-      }).then((res) => {
-        this.contact_approval_afterupdate = res.value;
+      parameterGetByCode({ code: 'contact_is_approval' }).then((res) => {
+        this.contactApprovalEnabled = String(res.value) === '1';
       });
     },
     methods: {
@@ -618,12 +625,20 @@
         if (type == 'all') {
           contactIds = this.selection.map((item) => item.id);
           contactNames = this.selection.map((item) => item.name);
+          if (this.selection.some((item) => item.approvalStatus !== 2)) {
+            this.$message.warning('未审批通过客户不能指派!');
+            return;
+          }
           this.selection.forEach((item) => {
             if (item.assignStatus === 1) {
               isAssign = true;
             }
           });
         } else {
+          if (row.approvalStatus !== 2) {
+            this.$message.warning('未审批通过客户不能指派!');
+            return;
+          }
           contactIds = [row.id];
           contactNames = [row.name];
         }
@@ -655,6 +670,12 @@
       uploadFile() {
         this.$refs.importDialogRef.open();
       },
+      handleImportSuccess(data) {
+        this.reload();
+        if (this.contactApprovalEnabled === true && data && data.successList && data.successList.length) {
+          this.$message.info(`导入成功 ${data.successList.length} 条,请提交审批`);
+        }
+      },
       openDetail(row) {
         // this.$refs.contactDetailDialogRef.open(row);
         this.$refs.drawerRef.open(row, 'allList');

+ 7 - 0
src/views/saleManage/contact/index.vue

@@ -307,6 +307,13 @@
             minWidth: 140,
             fixed: 'left'
           },
+          {
+            prop: 'version',
+            label: '版本号',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => `V${cellValue || 1}.0`
+          },
           {
             prop: 'name',
             label: '名称',

+ 1 - 1
vue.config.js

@@ -2,7 +2,7 @@
  * @Author: mlchen 374826075@qq.com
  * @Date: 2026-07-22 15:43:30
  * @LastEditors: mlchen 374826075@qq.com
- * @LastEditTime: 2026-08-11 10:52:40
+ * @LastEditTime: 2026-10-13 10:07:46
  * @FilePath: /kd-aiot-frontend-eom/vue.config.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */