yusheng 11 месяцев назад
Родитель
Сommit
cc73d61078

+ 338 - 0
src/components/contactDialog/api.js

@@ -0,0 +1,338 @@
+import request from '@/utils/request';
+
+/**
+ * 获取客户信息列表
+ */
+export async function contactPage(params) {
+  const res = await request.get(`/eom/contact/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 获取客户信息列表
+ */
+export async function contactPageUsages(params) {
+  const res = await request.get(`/eom/contact/page2Usages`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取客户信息详情
+ */
+export async function contactDetail(id) {
+  const res = await request.get(`/eom/contact/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新客户信息
+ */
+export async function contactUpdate(data) {
+  const res = await request.put(`/eom/contact/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增客户信息
+ */
+export async function contactSave(data) {
+  const res = await request.post(`/eom/contact/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 客户证书资质信息分页
+ */
+export async function contactQcPackPageAPI(params) {
+  const res = await request.get(
+    `/main/professionCertification/selectByRelationIdAndType`,
+    { params }
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 新增客户证书资质信息
+ */
+export async function contactQcPackSaveAPI(data) {
+  const res = await request.post(`/main/professionCertification/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 修改客户证书资质信息
+ */
+export async function contactQcPackUpdateAPI(data) {
+  const res = await request.put(`/main/professionCertification/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取客户证书资质信息详情
+ */
+export async function contactQcPackDetailAPI(id) {
+  const res = await request.get(
+    `/main/professionCertification/getById/${id}`,
+    {}
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 删除客户证书资质包
+ */
+export async function contactQcPackDeleteAPI(data) {
+  const res = await request.delete(`/main/professionCertification/delete`, {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 提交客户证书资质信息  开启流程
+ */
+export async function contactQcSubmit(data) {
+  const res = await request.post(`/bpm/ProfessionCertification/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除事项
+ */
+export async function contactDelete(data) {
+  const res = await request.post('/eom/contact/delete', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取客户分类树
+ */
+export async function contactTypeTree(data) {
+  const res = await request.get(`/main/categoryLevel/getTreeByPid/${data.id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新用户状态
+ */
+export async function updateStatus(id, status) {
+  const res = await request.get(
+    `/eom/contact/updateStatus?id=` + id + '&status=' + status
+  );
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 指派
+ */
+export async function assign(data) {
+  const res = await request.post('/eom/contact/assign', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 释放
+ */
+export async function free(data) {
+  const res = await request.post('/eom/contact/free', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 申请
+ */
+export async function applySave(data) {
+  const res = await request.post('/eom/contactlistapply/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 供应商维护供货产品
+ */
+export async function contactProductSaveAPI(data) {
+  const res = await request.post('/main/contactproduct/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 供应商维护供货产品
+ */
+export async function contactProductUpdateAPI(data) {
+  const res = await request.post('/main/contactproduct/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 通过产品查供应商
+ */
+export async function contactQueryByCategoryIdsAPI(data) {
+  const res = await request.post('/eom/contact/queryByCategoryIds', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 发布动态
+ */
+export async function updateContactDynamics(data) {
+  const res = await request.put('/eom/contact/updateContactDynamics', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 回复动态
+ */
+export async function updateContactComment(data) {
+  const res = await request.put('/eom/contact/updateContactComment', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 摘要卡片
+ */
+export async function queryContactIdCount(id) {
+  const res = await request.get(`eom/contact/queryContactIdCount/` + id);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新客户关联状态
+ */
+export async function updateRelationStatus(data) {
+  const res = await request.post('/eom/contact/updateRelationStatus', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取供应商最小订购数量
+ */
+export async function listByContactId(data) {
+  const res = await request.post('/eom/contactproduct/listByContactId',  data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 跟进记录统计
+ */
+export async function groupByContact(params) {
+  const res = await request.get(`/eom/businessopportunityfollowup/groupByContact`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+/**
+ * 客户资质证照
+ */
+export async function identityphotoList(data) {
+  const res = await request.post(`/main/identityphoto/list`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 保存or更新
+export async function saveOrEdit (data) {
+  const res = await request.post(`/main/identityphoto/saveOrUpdate`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+// 获取证照信息详情
+export async function getPhotoInfo (id) {
+  const res = await request.get(`/main/identityphoto/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 物品信息列表
+export async function getList(params) {
+  const res = await request.get('/main/category/getList', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deleteIdentityphoto(data) {
+  const res = await request.delete('/main/identityphoto/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 104 - 0
src/components/contactDialog/contactSearch.vue

@@ -0,0 +1,104 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+<script>
+  import { reviewStatusSelect } from '@/enum/dict';
+  export default {
+    data() {
+      return {};
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+        {
+            label: '关键字:',
+            value: 'searchName',
+            type: 'input',
+            placeholder: '编码/代号/客户名称/电话'
+          },
+          {
+            label: '编码/代号:',
+            value: 'codeOrSerialNo',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '客户名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入',
+          },
+          // {
+          //   label: '电话:',
+          //   value: 'phone',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '注册地址:',
+          //   value: 'addressName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '联系地址:',
+          //   value: 'otherAddressName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '联系人:',
+          //   value: 'linkName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '状态',
+          //   value: 'targetTime',
+          //   width: 380,
+          //   type: 'select',
+          //   placeholder: '请选择状态',
+          //   planList:reviewStatusSelect
+          // },
+          // {
+          //   label: '部门:',
+          //   value: 'assessmentObject',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入',
+          // },
+          // {
+          //   label: '创建人:',
+          //   value: 'createUsername',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入姓名'
+          // },
+          {
+            label: '创建时间:',
+            value: 'createTime',
+            type: 'date',
+            dateType: 'datetimerange',
+            placeholder: '',
+            width: 380,
+            valueAr: ['createTimeStart', 'createTimeEnd']
+          },
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
+    }
+  };
+</script>

+ 204 - 0
src/components/contactDialog/index.vue

@@ -0,0 +1,204 @@
+<template>
+  <ele-modal title="选择客户" custom-class="ele-dialog-form long-dialog-form" :visible.sync="visible"
+             :before-close="handleClose" :close-on-click-modal="false" top="5vh"
+             :close-on-press-escape="false" append-to-body width="70%" :maxable="true">
+    <el-card shadow="never">
+
+      <contact-search @search="reload"></contact-search>
+
+      <ele-split-layout width="244px" allow-collapse :right-style="{ overflow: 'hidden' }">
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree @handleNodeClick="handleNodeClick" id="17" :isFirstRefreshTable="false" ref="treeList"/>
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id"
+                         height="calc(100vh - 460px)" class="dict-table" @cell-click="cellClick">
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+
+  </ele-modal>
+</template>
+
+<script>
+
+import {contactPageUsages} from './api.js';
+import ContactSearch from './contactSearch.vue';
+import AssetTree from '@/components/AssetTree';
+
+export default {
+  components: {
+    ContactSearch,
+    AssetTree
+  },
+  props: {
+    classType: {
+      type: Number | String,
+      default: 1
+    }
+  },
+  data() {
+    return {
+      visible: false,
+
+
+      columns: [
+
+        {
+          action: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '选择'
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '客户编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'name',
+          label: '客户名称',
+          align: 'center',
+          slot: 'name',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
+        {
+          prop: 'serialNo',
+          label: '客户代号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'phone',
+          label: '客户电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'addressName',
+          label: '单位地址',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (_row, _column, cellValue) => {
+            let addr = '' + _row.addressName ? _row.addressName.replaceAll(',', '') : '';
+            addr += _row.address ? _row.address : '';
+            return addr;
+          }
+        },
+        {
+          prop: 'linkName',
+          label: '联系人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'linkPhone',
+          label: '联系人电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 100,
+          formatter: (_row, _column, cellValue) => {
+            return _row.status === 1 ? '启用' : '禁用';
+          }
+        },
+
+
+      ],
+
+      radio: null,
+    }
+  },
+
+  watch: {},
+  methods: {
+    open(item) {
+      if (item) {
+
+        this.radio = item.id
+      }
+      this.visible = true
+    },
+
+
+    /* 表格数据源 */
+    datasource({page, limit, where, order}) {
+      return contactPageUsages({
+        pageNum: page,
+        size: limit,
+        type: this.classType,
+        ...where,
+        status: '1'
+      });
+    },
+
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({page: 1, where});
+    },
+
+    handleNodeClick(data, node) {
+      this.curNodeData = data;
+      this.reload({categoryId: data.id});
+    },
+
+
+    // 单击获取id
+    cellClick(row) {
+      this.current = row
+      this.radio = row.id
+    },
+    handleClose() {
+      this.visible = false
+      this.current = null
+      this.radio = ''
+    },
+
+    selected() {
+      if (!this.current) {
+        return this.$message.warning('请选择客户')
+      }
+      this.$emit('changeParent', this.current)
+      this.handleClose()
+    },
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 25 - 0
src/components/contactDialog/openContactDialog.vue

@@ -0,0 +1,25 @@
+<template>
+  <el-button type="primary" size="small" @click="$refs.indexRef.open()">
+    <index ref="indexRef" @changeParent="changeParent"></index>
+    选择
+  </el-button>
+</template>
+
+<script>
+  import index from './index.vue';
+
+  export default {
+    components: {
+      index
+    },
+    data() {},
+
+    methods: {
+      changeParent(data) {
+        this.$emit('changeParent', data);
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 22 - 4
src/views/productionPlan/components/factoryAdd/index.vue

@@ -55,6 +55,23 @@
               ></el-input>
               ></el-input>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="客户名称:">
+              <el-input
+                clearable
+                v-model="form.customerName"
+                style="width: calc(100% - 80px)"
+              />
+
+              <contactDialog
+                style="margin-left: 3px"
+                @changeParent="contactDialogSuccess"
+              ></contactDialog>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row :gutter="24">
           <el-col :span="6">
           <el-col :span="6">
             <el-form-item
             <el-form-item
               label="计划开始日期:"
               label="计划开始日期:"
@@ -78,9 +95,6 @@
               </el-date-picker>
               </el-date-picker>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
-        </el-row>
-
-        <el-row :gutter="24">
           <el-col :span="6">
           <el-col :span="6">
             <el-form-item
             <el-form-item
               label="计划结束日期:"
               label="计划结束日期:"
@@ -421,11 +435,12 @@
     temporarilyUpdate,
     temporarilyUpdate,
     temporaryPlanSave
     temporaryPlanSave
   } from '@/api/saleOrder';
   } from '@/api/saleOrder';
+  import contactDialog from '@/components/contactDialog/openContactDialog.vue';
 
 
   export default {
   export default {
     components: {
     components: {
       EquipmentDialog,
       EquipmentDialog,
-      ProcessRoute
+      ProcessRoute,contactDialog
     },
     },
     props: {
     props: {
       factoryType: {
       factoryType: {
@@ -1022,7 +1037,10 @@
           this.$forceUpdate();
           this.$forceUpdate();
         });
         });
       },
       },
+      contactDialogSuccess(data){
+        this.$set(this.form,'customerName',data.name)
 
 
+      },
       // 清空BOM 跟工艺路线
       // 清空BOM 跟工艺路线
       wipeData(index) {
       wipeData(index) {
         let row = this.form.productInfoList[index];
         let row = this.form.productInfoList[index];

+ 14 - 1
src/views/saleOrder/components/create-order.vue

@@ -63,8 +63,14 @@
                 clearable
                 clearable
                 v-model="form.customerName"
                 v-model="form.customerName"
                 :disabled="form.saleType == 3"
                 :disabled="form.saleType == 3"
+                style="width:calc(100% - 80px);"
               />
               />
+              <!-- <el-button style="margin-left: 3px;" size="small" type="primary" @click.native="$refs.contactDialogRef.open()"
+              >选择
+            </el-button> -->
+            <contactDialog style="margin-left: 3px;" @changeParent="contactDialogSuccess"></contactDialog>
             </el-form-item>
             </el-form-item>
+      
           </el-col>
           </el-col>
 
 
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -515,12 +521,13 @@
   import { parameterGetByCode } from '@/api/mainData/index';
   import { parameterGetByCode } from '@/api/mainData/index';
   import dayjs from 'dayjs';
   import dayjs from 'dayjs';
   import { multiply } from '@/utils/math';
   import { multiply } from '@/utils/math';
+  import contactDialog from '@/components/contactDialog/openContactDialog.vue';
   export default {
   export default {
     components: {
     components: {
       EquipmentDialog,
       EquipmentDialog,
       orderHomogeneityInspectDialog,
       orderHomogeneityInspectDialog,
       orderHomogeneityInspectInstallDialog,
       orderHomogeneityInspectInstallDialog,
-      ProcessRoute
+      ProcessRoute,contactDialog
     },
     },
     data() {
     data() {
       return {
       return {
@@ -722,6 +729,12 @@
         this.visible = false;
         this.visible = false;
       },
       },
 
 
+      contactDialogSuccess(data){
+        this.$set(this.form,'customerName',data.name)
+        this.$set(this.form,'simpleName',data.simpleName)
+        this.$set(this.form,'serialNo',data.serialNo)
+        this.$set(this.form,'simpleName',data.simpleName)
+      },
       // 表格:模数、数量(方)、块数输入框 输入事件
       // 表格:模数、数量(方)、块数输入框 输入事件
       tableHandleKeyUp(row, index, e, name) {
       tableHandleKeyUp(row, index, e, name) {
         let modelArr = row.specification.split('*');
         let modelArr = row.specification.split('*');

+ 1 - 1
vue.config.js

@@ -39,7 +39,7 @@ module.exports = {
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18186',
-        target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.116:18086',
 
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域