taoyuqing пре 1 година
родитељ
комит
396f3d44bd

+ 152 - 0
src/views/modules/contact/manage-add-or-update.vue

@@ -0,0 +1,152 @@
+<template>
+  <div>
+    <div class="my-title">{{ !id ? "新增" : "修改" }}</div>
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      @keyup.enter.native="dataFormSubmit()"
+      label-width="100px"
+    >
+      <el-row class="my-row">
+        <el-col :span="6">
+          <el-form-item label="客户名称" prop="optionCode">
+            <el-input
+              v-model="dataForm.optionCode"
+              placeholder="方案编码"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="客户联系人" prop="optionCode">
+            <el-input
+              v-model="dataForm.optionCode"
+              placeholder="方案编码"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="客户联系电话" prop="optionCode">
+            <el-input
+              v-model="dataForm.optionCode"
+              placeholder="方案编码"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="沟通方式" prop="optionCode">
+            <el-input
+              v-model="dataForm.optionCode"
+              placeholder="方案编码"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-col :span="6">
+          <el-form-item label="沟通类别" prop="optionCode">
+            <el-input
+              v-model="dataForm.optionCode"
+              placeholder="方案编码"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-col :span="12">
+          <el-form-item label="沟通主要内容" prop="optionCode">
+            <el-input
+              v-model="dataForm.optionCode"
+              placeholder=""
+              type="textarea"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="备注" prop="optionCode">
+            <el-input
+              v-model="dataForm.optionCode"
+              placeholder=""
+              type="textarea"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-col :span="12">
+          <upload-component
+            :title="'技术资料'"
+            :accept="'*'"
+            :file-obj-list="fileList"
+            @uploadSuccess="uploadSuccess"
+          />
+        </el-col>
+        <el-col :span="12">
+          <upload-component
+            :title="'数模/图纸'"
+            :accept="'*'"
+            :file-obj-list="fileList"
+            @uploadSuccess="uploadSuccess"
+          />
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-col :span="12">
+          <upload-component
+            :title="'沟通表原件'"
+            :accept="'*'"
+            :file-obj-list="fileList"
+            @uploadSuccess="uploadSuccess"
+          />
+        </el-col>
+        <el-col :span="12">
+          <upload-component
+            :title="'其他附件'"
+            :accept="'*'"
+            :file-obj-list="fileList"
+            @uploadSuccess="uploadSuccess"
+          />
+        </el-col>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+import UploadComponent from "../common/upload-component";
+export default {
+  name: "manage-add-or-update",
+  components: { UploadComponent },
+  data() {
+    return {
+      id: 0,
+      dataForm: {},
+      fileList: [],
+      dataRule: {},
+    };
+  },
+  created() {},
+  methods: {
+    onChose() {
+      this.$emit("onChose");
+    },
+    async init(id, display) {
+      this.id = id || 0;
+      this.fileList = [];
+      this.$refs["dataForm"].resetFields();
+
+      if (!id) return;
+    },
+    uploadSuccess(fileList) {
+      this.fileList = fileList;
+    },
+    dataFormSubmit(){}
+  },
+};
+</script>
+
+<style></style>

+ 15 - 12
src/views/modules/contact/manage.vue

@@ -17,16 +17,7 @@
           />
         </el-form-item>
         <el-form-item label="部门">
-          <el-select v-model="dataForm.productId" filterable remote clearable placeholder="请选择">
-            <el-option
-                v-for="item in materialList"
-                :key="item.materialId"
-                :label="item.materialName"
-                :value="item.materialId"
-              >
-              </el-option>
-            </el-option>
-          </el-select>
+          <org-component v-model="dataForm.orgId"/>
         </el-form-item>
         <el-form-item label="沟通类别">
           <el-select v-model="dataForm.productId" filterable remote clearable placeholder="请选择">
@@ -185,14 +176,17 @@
       >
       </el-pagination>
     </template>
+    <add-or-update ref="addOrUpdate" v-if="addOrUpdateVisible" @onChose="onChose"></add-or-update>
   </div>
 </template>
 
 <script>
+import AddOrUpdate from "./manage-add-or-update.vue";
+import OrgComponent from '../common/org-component'
 import { getCusCommunicationTypeList } from "@/api/contact";
 export default {
   name: "contact-manage",
-  components: {},
+  components: {AddOrUpdate,OrgComponent},
   data() {
     return {
       addOrUpdateVisible: false,
@@ -202,7 +196,7 @@ export default {
       materialList: [],
       dataForm: {
         customerName: "",
-
+orgId:''
       },
       options: [],
       dataList: [],
@@ -248,6 +242,9 @@ export default {
           current: this.pageIndex,
           size: this.pageSize,
           customerName: this.dataForm.customerName,
+          orgId: this.dataForm.orgId,
+          coType: this.dataForm.coType,
+          content: this.dataForm.content
         }),
       }).then(({ data }) => {
         if (data && data.code === "200") {
@@ -271,6 +268,12 @@ export default {
       this.pageIndex = val;
       this.getDataList();
     },
+    addOrUpdateHandle(id, disabled){
+      this.addOrUpdateVisible = true;
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(id, disabled);
+      });
+    }
   },
 };
 </script>

+ 440 - 213
src/views/modules/cus/communicate-add-or-update.vue

@@ -1,72 +1,140 @@
 <template>
-<div>
-  <!-- <el-dialog
-    :title="!id ? '新增': display ? '详情' : '修改'"
-    width="70%"
-    :close-on-click-modal="false"
-    :visible.sync="visible"> -->
-    <div class="my-title">{{ !id ? '新增': display ? '详情' : '修改' }}</div>
-    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+  <div>
+    <div class="my-title">{{ !id ? "新增" : display ? "详情" : "修改" }}</div>
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      label-width="auto"
+    >
       <el-row class="my-row">
-        <el-col :span="8">
+        <el-col :span="6">
           <el-form-item label="客户名称" prop="cusId">
             <el-select
               v-model="dataForm.cusId"
               :disabled="display"
               remote
-              placeholder="请选择">
+              placeholder="请选择"
+              style="width:100%"
+            >
               <el-option
                 v-for="item in optionsCus"
                 :key="item.value"
                 :label="item.customerName"
-                :value="item.customerId">
+                :value="item.customerId"
+              >
               </el-option>
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="8" style="padding-left: 20px">
-          <el-form-item label="联系人" prop="name">
-            <el-input v-model="dataForm.name" disabled placeholder="联系人"></el-input>
+        <el-col :span="6">
+          <el-form-item label="客户联系人" prop="contact">
+            <el-input
+              v-model="dataForm.contact"
+              disabled
+              placeholder="联系人"
+            ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="8" style="padding-left: 20px">
+        <el-col :span="6">
+          <el-form-item label="联系电话" prop="contactTel">
+            <el-input v-model="dataForm.contactTel" placeholder=""></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="沟通方式" prop="way">
+            <el-input v-model="dataForm.way" placeholder=""></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="my-row">
+        <el-col :span="6">
           <el-form-item label="沟通类别" prop="coType">
             <el-select
               v-model="dataForm.coType"
               :disabled="display"
               remote
               @change="typeChanged"
-              placeholder="请选择">
+              placeholder="请选择"
+              style="width:100%"
+            >
               <el-option
                 v-for="item in options"
                 :key="item.code"
                 :label="item.value"
-                :value="item.code">
+                :value="item.code"
+              >
               </el-option>
             </el-select>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row class="my-row">
-        <el-form-item label="备注说明">
-            <el-input v-model="dataForm.notes" :disabled="display"></el-input>
+        <el-col :span="12">
+          <el-form-item label="沟通主要内容" prop="content">
+            <el-input v-model="dataForm.content" :disabled="display" type="textarea"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="备注">
+            <el-input v-model="dataForm.notes" :disabled="display" type="textarea"></el-input>
           </el-form-item>
+        </el-col>
       </el-row>
       <el-row class="my-row">
-        <upload-component :display="display" :title="'沟通扫描件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
+        <el-col :span="12">
+          <upload-component
+            :display="display"
+            :displayStar=false
+            :title="'技术资料'"
+            :accept="'*'"
+            :file-obj-list="attachListTechnical"
+            @uploadSuccess="uploadSuccessTechnical"
+          />
+        </el-col>
+        <el-col :span="12">
+          <upload-component
+            :display="display"
+            :displayStar=false
+            :title="'数模/图纸'"
+            :accept="'*'"
+            :file-obj-list="attachListDrawing"
+            @uploadSuccess="uploadSuccessDrawing"
+          />
+        </el-col>
+      </el-row>
+      <el-row class="my-row" style="margin:10px 0">
+        <el-col :span="12">
+          <upload-component
+            :display="display"
+            :displayStar=false
+            :title="'沟通表原件'"
+            :accept="'*'"
+            :file-obj-list="attachList"
+            @uploadSuccess="uploadSuccess"
+          />
+        </el-col>
+        <el-col :span="12">
+          <upload-component
+            :display="display"
+            :displayStar=false
+            :title="'其他附件'"
+            :accept="'*'"
+            :file-obj-list="attachListOther"
+            @uploadSuccess="uploadSuccessOther"
+          />
+        </el-col>
       </el-row>
       <div v-show="detailVisible">
-        <div class="title"><span style="color: red">*</span> 订单产品明细</div>
+        <div class="title"><span style="color: red">*</span> 沟通物料明细</div>
         <el-row>
-          <el-table
-            :data="cusRCommProductVOS"
-            border
-            style="width: 100%;">
+          <el-table :data="cusRCommProductVOS" border style="width: 100%">
             <el-table-column
               label="序号"
               type="index"
               width="50"
-              align="center">
+              align="center"
+            >
             </el-table-column>
             <el-table-column
               prop="productName"
@@ -74,38 +142,50 @@
               align="center"
               min-width="120"
               :show-tooltip-when-overflow="true"
-              label="产品名称">
+              label="物料名称"
+            >
             </el-table-column>
             <el-table-column
               prop="productSpecifications"
               header-align="center"
               align="center"
-              min-width="120"
               :show-tooltip-when-overflow="true"
-              label="规格">
+              label="规格"
+            >
             </el-table-column>
             <el-table-column
               prop="cnt"
               header-align="center"
               align="center"
-              min-width="100"
-              label="数量">
+              label="数量"
+            >
             </el-table-column>
             <el-table-column
+              prop="cnt"
+              header-align="center"
+              align="center"
+              min-width="100"
+              width="150"
+              label="交付日期"
+            >
+            </el-table-column>
+            <!-- <el-table-column
               prop="price"
               header-align="center"
               align="center"
               min-width="100"
-              label="含税单价">
+              label="含税单价"
+            >
             </el-table-column>
             <el-table-column
               prop="amount"
               header-align="center"
               align="center"
               min-width="100"
-              label="含税总价">
+              label="含税总价"
+            >
               <template slot-scope="scope">
-                <span>{{ (scope.row.cnt*scope.row.price).toFixed(1) }}</span>
+                <span>{{ (scope.row.cnt * scope.row.price).toFixed(1) }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -113,231 +193,378 @@
               header-align="center"
               align="center"
               min-width="100"
-              label="税率">
+              label="税率"
+            >
+              <template slot-scope="scope"> {{ scope.row.rate }}% </template>
+            </el-table-column> -->
+            <el-table-column
+              prop="notes"
+              header-align="center"
+              align="center"
+              min-width="180"
+              :show-tooltip-when-overflow="true"
+              label="备注"
+            >
+            </el-table-column>
+            <el-table-column
+              fixed="right"
+              header-align="center"
+              align="center"
+              width="100"
+              label="操作"
+            >
               <template slot-scope="scope">
-                {{scope.row.rate}}%
+                <el-button
+                  type="text"
+                  size="small"
+                  @click="updateProductHandle(scope.row)"
+                  >编辑</el-button
+                >
+                <el-button
+                  style="color: red"
+                  type="text"
+                  size="small"
+                  @click="deleteProductHandle(scope.row.recordId)"
+                  >删除</el-button
+                >
               </template>
             </el-table-column>
+          </el-table>
+        </el-row>
+        <el-row v-if="!display" style="text-align: center; margin-top: 10px">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            @click="inBound"
+          ></el-button>
+        </el-row>
+      </div>
+      <div v-show="detailVisible">
+        <div class="title"><span style="color: red">*</span> 任务工单派发</div>
+        <el-row>
+          <el-table :data="cusRCommProductVOS" border style="width: 100%">
+            <el-table-column
+              label="序号"
+              type="index"
+              width="50"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="productName"
+              header-align="center"
+              align="center"
+              min-width="120"
+              :show-tooltip-when-overflow="true"
+              label="工单类型"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="productSpecifications"
+              header-align="center"
+              align="center"
+              :show-tooltip-when-overflow="true"
+              label="工单名称"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="cnt"
+              header-align="center"
+              align="center"
+              label="级别"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="cnt"
+              header-align="center"
+              align="center"
+              min-width="100"
+              width="150"
+              label="工单内容"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="cnt"
+              header-align="center"
+              align="center"
+              min-width="100"
+              width="150"
+              label="任务接收人"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="cnt"
+              header-align="center"
+              align="center"
+              min-width="100"
+              width="150"
+              label="任务附件"
+            >
+            </el-table-column>
             <el-table-column
               prop="notes"
               header-align="center"
               align="center"
-              width="140"
+              min-width="180"
               :show-tooltip-when-overflow="true"
-              label="备注">
+              label="备注"
+            >
             </el-table-column>
             <el-table-column
               fixed="right"
               header-align="center"
               align="center"
               width="100"
-              label="操作">
+              label="操作"
+            >
               <template slot-scope="scope">
-                <el-button type="text" size="small" @click="updateProductHandle(scope.row)">编辑</el-button>
-                <el-button style="color: red" type="text" size="small" @click="deleteProductHandle(scope.row.recordId)">删除</el-button>
+                <el-button
+                  type="text"
+                  size="small"
+                  @click="updateProductHandle(scope.row)"
+                  >编辑</el-button
+                >
+                <el-button
+                  style="color: red"
+                  type="text"
+                  size="small"
+                  @click="deleteProductHandle(scope.row.recordId)"
+                  >删除</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
         </el-row>
-        <el-row v-if="!display" style="text-align: center; margin-top: 10px;">
-          <el-button type="primary" icon="el-icon-plus" @click="inBound"></el-button>
+        <el-row v-if="!display" style="text-align: center; margin-top: 10px">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            @click="inBound"
+          ></el-button>
         </el-row>
       </div>
     </el-form>
     <span slot="footer" class="dialog-footer">
       <el-button @click="onChose">取消</el-button>
-      <el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button>
+      <el-button v-if="!display" type="primary" @click="dataFormSubmit()"
+        >确定</el-button
+      >
     </span>
-  <!-- </el-dialog> -->
-<!--   <template-chose v-if="inboundVisible" ref="inbound" @addItems="addItems" />-->
-  <add-or-update v-if="inboundVisible"  ref="inbound" @addItem="addItem" />
-</div>
+    <add-or-update v-if="inboundVisible" ref="inbound" @addItem="addItem" />
+  </div>
 </template>
 
 <script>
-  // import templateChose from '../product/template-chose'
-  import { getCustomer, getCoDetail } from '@/api/cus'
-  import { getDictList } from '@/api/dict'
-  import uploadComponent from '../common/upload-component'
-  import AddOrUpdate from '../product/template-add-or-update'
-  export default {
-    name: 'communicate-add-or-update',
-    components: {AddOrUpdate, uploadComponent},
-    computed: {
-      orgId: {
-        get () { return this.$store.state.user.orgId }
-      }
+// import templateChose from '../product/template-chose'
+import { getCustomer, getCoDetail } from "@/api/cus";
+import { getDictList } from "@/api/dict";
+import uploadComponent from "../common/upload-component";
+import AddOrUpdate from "../product/template-add-or-update";
+export default {
+  name: "communicate-add-or-update",
+  components: { AddOrUpdate, uploadComponent },
+  computed: {
+    orgId: {
+      get() {
+        return this.$store.state.user.orgId;
+      },
     },
-    data () {
-      return {
-        inboundVisible: false,
-        detailVisible: false,
-        visible: false,
-        display: false,
-        dictType: 'material_type',
-        options: [],
-        optionsCus: [],
-        dataList: [],
-        fileList: [],
-        id: 0,
-        cusRCommProductVOS: [],
-        dataForm: {},
-        dataRule: {
-          cusId: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
-          coType: [{ required: true, message: '沟通类别不能为空', trigger: 'change' }],
-          name: [{ required: true, message: '联系人不能为空', trigger: 'blur' }]
+  },
+  data() {
+    return {
+      inboundVisible: false,
+      detailVisible: false,
+      visible: false,
+      display: false,
+      dictType: "material_type",
+      options: [],
+      optionsCus: [],
+      dataList: [],
+      attachListTechnical: [],//技术资料
+      attachListDrawing: [],//数模/图纸
+      attachList: [],//沟通表原件
+      attachListOther: [],//其他附件
+      id: 0,
+      cusRCommProductVOS: [],
+      dataForm: {},
+      dataRule: {
+        cusId: [
+          { required: true, message: "客户名称不能为空", trigger: "blur" },
+        ],
+        coType: [
+          { required: true, message: "沟通类别不能为空", trigger: "change" },
+        ],
+        name: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
+      },
+    };
+  },
+  watch: {
+    "dataForm.cusId"(value) {
+      this.optionsCus.forEach((v) => {
+        if (v.customerId === value) {
+          this.dataForm.name = v.contact;
         }
-      }
+      });
     },
-    watch: {
-      'dataForm.cusId' (value) {
-        this.optionsCus.forEach(v => {
-          if (v.customerId === value) {
-            this.dataForm.name = v.contact
-          }
-        })
-      }
+  },
+  methods: {
+    onChose() {
+      this.$emit("onChose");
     },
-    methods: {
-      onChose () {
-        this.$emit('onChose')
-      },
-      async init (id, display) {
-        this.dataForm = {}
-        this.cusRCommProductVOS = []
-        this.visible = true
-        this.id = id || 0
-        this.display = display
-        // 获取沟通类别
-        await getDictList({type: 'communication_type'}).then(({data}) => {
-          if (data) {
-            this.options = data
+    async init(id, display) {
+      this.dataForm = {};
+      this.cusRCommProductVOS = [];
+      this.visible = true;
+      this.id = id || 0;
+      this.display = display;
+      // 获取沟通类别
+      await getDictList({ type: "communication_type" }).then(({ data }) => {
+        if (data) {
+          this.options = data;
+        }
+      });
+      await getCustomer().then(({ data }) => {
+        if (data && data.code === "200") {
+          this.optionsCus = data.data;
+        }
+      });
+      if (!id) return;
+      this.detailVisible = true;
+      await getCoDetail(this.id).then(({ data }) => {
+        if (data && data.code === "200") {
+          this.dataForm = data.data;
+          if (this.dataForm.coType !== "1") {
+            this.detailVisible = false;
           }
-        })
-        await getCustomer().then(({data}) => {
-          if (data && data.code === '200') {
-            this.optionsCus = data.data
+          // 附件显示
+          this.fileList = [];
+          data.data.attachList.forEach((item) => {
+            this.fileList.push({
+              name: item.fileName,
+              url: item.url,
+              id: item.url,
+            });
+          });
+          if (data.data.cusRCommProductVOS) {
+            data.data.cusRCommProductVOS.forEach((item) => {
+              this.addItem(item);
+            });
           }
-        })
-        if (!id) return
-        this.detailVisible = true
-        await getCoDetail(this.id).then(({data}) => {
-          if (data && data.code === '200') {
-            this.dataForm = data.data
-            if (this.dataForm.coType !== '1') {
-              this.detailVisible = false
+        }
+      });
+    },
+    // 表单提交
+    dataFormSubmit() {
+      this.$refs["dataForm"].validate((valid) => {
+        if (valid) {
+          // 添加附件
+          let fList = this.fileList;
+          // console.log('fileList = ' + fList)
+          if (fList.length > 0) {
+            this.dataForm.attachList = [];
+            for (let i = 0; i < fList.length; i++) {
+              this.dataForm.attachList.push({
+                fileName: fList[i].name,
+                url: fList[i].url,
+              });
             }
-            // 附件显示
-            this.fileList = []
-            data.data.attachList.forEach((item) => {
-              this.fileList.push({
-                name: item.fileName,
-                url: item.url,
-                id: item.url
-              })
-            })
-            if (data.data.cusRCommProductVOS) {
-              data.data.cusRCommProductVOS.forEach((item) => {
-                this.addItem(item)
-              })
+          } else {
+            this.$message.error("请上传文件");
+            return;
+          }
+          if (this.dataForm.coType === "1") {
+            if (this.cusRCommProductVOS.length === 0) {
+              this.$message.error("请选择订单产品明细");
+              return;
             }
+            this.dataForm.cusRCommProductVOS = this.cusRCommProductVOS;
           }
-        })
-      },
-      // 表单提交
-      dataFormSubmit () {
-        this.$refs['dataForm'].validate((valid) => {
-          if (valid) {
-            // 添加附件
-            let fList = this.fileList
-            // console.log('fileList = ' + fList)
-            if (fList.length > 0) {
-              this.dataForm.attachList = []
-              for (let i = 0; i < fList.length; i++) {
-                this.dataForm.attachList.push({
-                  fileName: fList[i].name,
-                  url: fList[i].url
-                })
-              }
+          this.$http({
+            url: !this.id
+              ? this.$http.adornUrl(`/biz-service/cusCommunication/save`)
+              : this.$http.adornUrl(`/biz-service/cusCommunication/update`),
+            method: "post",
+            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId }),
+          }).then(({ data }) => {
+            if (data && data.code === "200") {
+              this.$message({
+                message: "操作成功",
+                type: "success",
+                duration: 1500,
+                onClose: () => {
+                  this.onChose();
+                  this.$emit("refreshDataList");
+                },
+              });
             } else {
-              this.$message.error('请上传文件')
-              return
-            }
-            if (this.dataForm.coType === '1') {
-              if (this.cusRCommProductVOS.length === 0) {
-                this.$message.error('请选择订单产品明细')
-                return
-              }
-              this.dataForm.cusRCommProductVOS = this.cusRCommProductVOS
+              this.$message.error(data.msg);
             }
-            this.$http({
-              url: !this.id ? this.$http.adornUrl(`/biz-service/cusCommunication/save`) : this.$http.adornUrl(`/biz-service/cusCommunication/update`),
-              method: 'post',
-              data: this.$http.adornData({...this.dataForm, orgId: this.orgId})
-            }).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success',
-                  duration: 1500,
-                  onClose: () => {
-                    this.onChose()
-                    this.$emit('refreshDataList')
-                  }
-                })
-              } else {
-                this.$message.error(data.msg)
-              }
-            })
-          }
-        })
-      },
-      validateField (type) {
-        this.$refs.dataForm.validateField(type)
-      },
-      inBound () {
-        this.inboundVisible = true
-        this.$nextTick(() => {
-          this.$refs.inbound.init(1)
-        })
-      },
-      // 编辑产品项
-      updateProductHandle (row) {
-        this.inboundVisible = true
-        this.$nextTick(() => {
-          this.$refs.inbound.init(1, row)
-        })
-      },
-      addItem (item) {
-        if (!item.recordId) {
-          item.recordId = Math.round(Math.random() * 1000000)
-        }
-        if (this.cusRCommProductVOS.findIndex(item1 => item1.recordId === item.recordId) === -1) {
-          this.cusRCommProductVOS.push({
-            ...item
-          })
+          });
         }
-      },
-      uploadSuccess (fileList) {
-        this.fileList = fileList
-      },
-      typeChanged (item) {
-        this.detailVisible = item === '1'
-      },
-      // 删除产品项
-      deleteProductHandle (recordId) {
-        this.cusRCommProductVOS.splice(this.cusRCommProductVOS.findIndex((item) => item.recordId === recordId), 1)
+      });
+    },
+    validateField(type) {
+      this.$refs.dataForm.validateField(type);
+    },
+    inBound() {
+      this.inboundVisible = true;
+      this.$nextTick(() => {
+        this.$refs.inbound.init(1);
+      });
+    },
+    // 编辑产品项
+    updateProductHandle(row) {
+      this.inboundVisible = true;
+      this.$nextTick(() => {
+        this.$refs.inbound.init(1, row);
+      });
+    },
+    addItem(item) {
+      if (!item.recordId) {
+        item.recordId = Math.round(Math.random() * 1000000);
+      }
+      if (
+        this.cusRCommProductVOS.findIndex(
+          (item1) => item1.recordId === item.recordId
+        ) === -1
+      ) {
+        this.cusRCommProductVOS.push({
+          ...item,
+        });
       }
-    }
-  }
+    },
+    uploadSuccessTechnical(fileList) {
+      this.attachListTechnical = fileList;
+    },
+    uploadSuccessDrawing(fileList) {
+      this.attachListDrawing = fileList;
+    },
+    uploadSuccess(fileList) {
+      this.attachList = fileList;
+    },
+    uploadSuccessOther(fileList) {
+      this.attachListOther = fileList;
+    },
+    typeChanged(item) {
+      this.detailVisible = item === "1";
+    },
+    // 删除产品项
+    deleteProductHandle(recordId) {
+      this.cusRCommProductVOS.splice(
+        this.cusRCommProductVOS.findIndex((item) => item.recordId === recordId),
+        1
+      );
+    },
+  },
+};
 </script>
 
 <style scoped>
-.my-line{
+.my-line {
   border-bottom: 1px solid #c0c4cc;
   margin-bottom: 10px;
 }
-.title{
-  padding: 10px 0 ;
+.title {
+  padding: 10px 0;
 }
 </style>

+ 62 - 26
src/views/modules/cus/communicate.vue

@@ -6,6 +6,28 @@
         <el-form-item label="名称">
           <el-input v-model="dataForm.cusName" placeholder="客户名称" clearable/>
         </el-form-item>
+        <el-form-item label="内容">
+          <el-input
+            v-model="dataForm.optionName"
+            placeholder=""
+            clearable
+          />
+        </el-form-item>
+        <el-form-item label="部门">
+          <org-component v-model="dataForm.orgId"/>
+        </el-form-item>
+        <el-form-item label="沟通类别">
+          <el-select v-model="dataForm.productId" filterable remote clearable placeholder="请选择">
+            <el-option
+                v-for="item in options"
+                :key="item.id"
+                :label="item.value"
+                :value="item.id"
+              >
+              </el-option>
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item>
           <el-button @click="getDataList()">查询</el-button>
           <el-button v-if="isAuth('cus:communication:save')" type="primary" @click="addOrUpdateHandle(0, false)">录入</el-button>
@@ -42,15 +64,21 @@
           prop="contact"
           header-align="center"
           align="center"
-          label="联系人">
+          label="客户联系人">
         </el-table-column>
-        <el-table-column
-          prop="bizManagerName"
+         <el-table-column
+          prop="contactTel"
           header-align="center"
           align="center"
           min-width="120"
-          label="对接业务员">
-        </el-table-column>
+          label="客户联系人电话"
+        > </el-table-column>
+        <el-table-column
+          prop="way"
+          header-align="center"
+          align="center"
+          label="沟通方式"
+        > </el-table-column>
         <el-table-column
           prop="coType"
           :formatter="typeFormat"
@@ -58,35 +86,38 @@
           align="center"
           label="沟通类别">
         </el-table-column>
+         <el-table-column
+          prop="content"
+          header-align="center"
+          align="center"
+          label="内容"
+          :show-tooltip-when-overflow="true"
+        > </el-table-column>
         <el-table-column
-          prop="createTime"
+          prop="notes"
           header-align="center"
           align="center"
-          min-width="160"
+          label="备注"
           :show-tooltip-when-overflow="true"
-          label="创建时间">
-        </el-table-column>
+        > </el-table-column>
         <el-table-column
-          prop="attachList"
+          prop="creatorId"
           header-align="center"
           align="center"
-          min-width="200"
-          label="附件">
-          <template slot-scope="scope">
-            <div v-for="(item, index) in scope.row.attachList" style="display: inline">
-              <span v-if="index > 0">,</span>
-              <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
-            </div>
-          </template>
-        </el-table-column>
+          label="沟通人"
+        > </el-table-column>
         <el-table-column
-          prop="notes"
+          prop="orgName"
           header-align="center"
           align="center"
-          min-width="180"
-          :show-tooltip-when-overflow="true"
-          label="备注">
-        </el-table-column>
+          label="部门"
+        > </el-table-column>
+        <el-table-column
+          prop="state"
+          header-align="center"
+          align="center"
+          label="审核状态"
+        > </el-table-column>
         <el-table-column
           fixed="right"
           header-align="center"
@@ -124,12 +155,14 @@
   import { getDictList } from '@/api/dict'
   import { downloadUrl } from '@/api/file'
   import PreviewComponent from '../common/preview-component'
+import OrgComponent from '../common/org-component'
   export default {
     name: 'communicate',
     components: {
       PreviewComponent,
       AddOrUpdate,
-      Detail
+      Detail,
+      OrgComponent
     },
     data () {
       return {
@@ -176,7 +209,10 @@
           params: this.$http.adornParams({
             'current': this.pageIndex,
             'size': this.pageSize,
-            'cusName': this.dataForm.cusName
+            'customerName': this.dataForm.cusName,
+            orgId: this.dataForm.orgId,
+            coType: this.dataForm.coType,
+            content: this.dataForm.content
           })
         }).then(({data}) => {
           if (data && data.code === '200') {

+ 15 - 4
src/views/modules/product/template-add-or-update.vue

@@ -7,8 +7,8 @@
       :visible.sync="visible">
       <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
         <el-row class="my-row">
-          <el-form-item label="产品名称" prop="productName">
-            <el-input v-model="dataForm.productName" :disabled="bizType === 3" placeholder="产品名称"></el-input>
+          <el-form-item label="物料名称" prop="productName">
+            <el-input v-model="dataForm.productName" :disabled="bizType === 3" placeholder="物料名称"></el-input>
           </el-form-item>
         </el-row>
         <el-row class="my-row">
@@ -21,7 +21,18 @@
             <el-input-number v-model="dataForm.cnt" :disabled="bizType === 3" ></el-input-number>
           </el-form-item>
         </el-row>
-        <el-row class="my-row">
+         <el-row class="my-row">
+          <el-form-item label="交付日期" prop="deliveryDate">
+            <el-date-picker
+              v-model="dataForm.deliveryDate"
+              value-format="yyyy-MM-dd"
+              type="date"
+              :disabled="bizType === 3"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-row>
+        <!-- <el-row class="my-row">
           <el-form-item label="含税单价" prop="price">
             <el-input-number v-model="dataForm.price" :step="1" :min="0" :precision="1" :disabled="bizType === 3" ></el-input-number>
           </el-form-item>
@@ -40,7 +51,7 @@
           <el-form-item label="订单编号" prop="productNumber">
             <el-input v-model="dataForm.productNumber" placeholder="订单编号" :disabled="bizType === 3" ></el-input>
           </el-form-item>
-        </el-row>
+        </el-row> -->
         <el-row class="my-row">
           <el-form-item label="备注" prop="notes">
             <el-input type="textarea" v-model="dataForm.notes" placeholder="备注"></el-input>