Эх сурвалжийг харах

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 2 жил өмнө
parent
commit
5892250e9e
53 өөрчлөгдсөн 4112 нэмэгдсэн , 1860 устгасан
  1. 21 0
      src/api/business/spd/bo/basic.js
  2. 9 0
      src/api/business/spd/bo/boJob.js
  3. 1 1
      src/api/business/spd/bo/boNode.js
  4. 10 1
      src/api/business/spd/bo/statement.js
  5. 69 0
      src/api/marketing/dealer-authorization.js
  6. 1 2
      src/components/Refers/treeRefer.vue
  7. 62 0
      src/components/input-dialog/index.js
  8. 3 0
      src/main.js
  9. 1 1
      src/views/business/spd/bo/authority/index.vue
  10. 147 10
      src/views/business/spd/bo/basic/details.vue
  11. 152 0
      src/views/business/spd/bo/basic/filemanager copy.vue
  12. 49 78
      src/views/business/spd/bo/basic/filemanager.vue
  13. 407 169
      src/views/business/spd/bo/basic/index.vue
  14. 329 96
      src/views/business/spd/bo/basic/process.vue
  15. 0 231
      src/views/business/spd/bo/behavior/AA copy.vue
  16. 0 230
      src/views/business/spd/bo/behavior/AA.vue
  17. 20 65
      src/views/business/spd/bo/behavior/behaviorList.vue
  18. 10 1
      src/views/business/spd/bo/behavior/index.vue
  19. 5 61
      src/views/business/spd/bo/contact/contactList.vue
  20. 10 1
      src/views/business/spd/bo/contact/index.vue
  21. 26 5
      src/views/business/spd/bo/education/educationList.vue
  22. 1 6
      src/views/business/spd/bo/filetemplate/botabs.vue
  23. 28 7
      src/views/business/spd/bo/filetemplate/index.vue
  24. 23 16
      src/views/business/spd/bo/pojpsn/pojpsnList.vue
  25. 4 10
      src/views/business/spd/bo/refer/contact/index.vue
  26. 4 12
      src/views/business/spd/bo/refer/customer/index.vue
  27. 0 242
      src/views/business/spd/bo/refer/dept/index copy.vue
  28. 4 10
      src/views/business/spd/bo/refer/dept/index.vue
  29. 4 10
      src/views/business/spd/bo/refer/org/index.vue
  30. 4 10
      src/views/business/spd/bo/refer/saleaea/index.vue
  31. 4 10
      src/views/business/spd/bo/refer/staff/index.vue
  32. 552 133
      src/views/business/spd/bo/statement/index.vue
  33. 232 0
      src/views/business/spd/bo/statement/proportion/index.vue
  34. 487 35
      src/views/business/spd/bo/task/index.vue
  35. 31 9
      src/views/business/spd/bo/task/taskList.vue
  36. 169 0
      src/views/marketing/dealer-authorization/authprivAdd.vue
  37. 74 0
      src/views/marketing/dealer-authorization/authprivSee.vue
  38. 56 0
      src/views/marketing/dealer-authorization/column.js
  39. 290 0
      src/views/marketing/dealer-authorization/index.vue
  40. 22 0
      src/views/marketing/utils/date.js
  41. 11 0
      src/views/marketing/utils/init.js
  42. 70 36
      src/views/material/basicFile/details.vue
  43. 11 6
      src/views/material/basicFile/index.vue
  44. 1 1
      src/views/material/config/detailsTabs.js
  45. 6 4
      src/views/material/requisition/add.vue
  46. 7 0
      src/views/monitor/job/log.vue
  47. 2 0
      src/views/purchase/DemandSummary/index.vue
  48. 49 86
      src/views/purchase/MaterialClassDivision/add.vue
  49. 173 99
      src/views/purchase/MaterialClassDivision/index.vue
  50. 24 6
      src/views/purchase/PurchaseDemandList/add.vue
  51. 92 29
      src/views/purchase/deliveryAddress/add.vue
  52. 108 44
      src/views/purchase/deliveryAddress/index.vue
  53. 237 87
      src/views/purchase/transferOrder/add.vue

+ 21 - 0
src/api/business/spd/bo/basic.js

@@ -59,6 +59,18 @@ export function delBasic(id) {
   })
 }
 
+//新增商机附件
+export function insertAccessory(data) {
+  return request({
+    url: '/mk/bo/basic/upload',
+    method: 'post',
+    data: data,
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    }
+  })
+}
+
 // 删除商机附件
 export function delAccessory(boId,f,boType,fileId) {
   return request({
@@ -91,3 +103,12 @@ export function updateWinningState(data) {
     data: data
   })
 }
+
+//分配负责人
+export function allocationParticipant(data) {
+  return request({
+    url: '/mk/bo/basic/allocationParticipant',
+    method: 'put',
+    data: data
+  })
+}

+ 9 - 0
src/api/business/spd/bo/boJob.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+// 查询节点
+export function getBoJobListByType(boType) {
+  return request({
+    url: '/mk/bo/job/list/' + boType,
+    method: 'get'
+  })
+}

+ 1 - 1
src/api/business/spd/bo/boNode.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 
 // 查询节点
-export function getBoNodeList(boType) {
+export function getBoNodeListByType(boType) {
   return request({
     url: '/mk/bo/node/type/' + boType,
     method: 'get'

+ 10 - 1
src/api/business/spd/bo/statement.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-// 查询商机基础信息列表
+// 查询商机阶段信息列表
 export function listBasic(query) {
   return request({
     url: '/mk/bo/statement/list',
@@ -8,3 +8,12 @@ export function listBasic(query) {
     params: query
   })
 }
+
+// 查询商机百分比列表
+export function listProportion(query) {
+  return request({
+    url: '/mk/bo/statement/listCollect',
+    method: 'get',
+    params: query
+  })
+}

+ 69 - 0
src/api/marketing/dealer-authorization.js

@@ -0,0 +1,69 @@
+/* 经销商授权信息管理 */
+
+import request from '@/utils/request';
+
+
+// 经销商授权信息列表
+const list = (params) => {
+  return request({
+    url: `/dealer/list`,
+    method: 'get',
+    params,
+  })
+}
+
+// 经销商授权信息新增接口
+const insert = (data) => {
+  return request({
+    url: `/dealer/insert`,
+    method: 'post',
+    data,
+  })
+}
+
+// 经销商授权信息列表
+const remove = (params) => {
+// ?id=${params.id}
+  return request({
+    url: `/dealer/delete`,
+    method: 'get',
+    params,
+  })
+}
+
+// 经销商授权信息新增接口
+const update = (data) => {
+  return request({
+    url: `/dealer/update`,
+    method: 'post',
+    data,
+  })
+}
+
+// 提交OA
+const submitOA = (data) => {
+  return request({
+    url: `/dealer/OA`,
+    method: 'post',
+    data,
+  })
+}
+
+// 下载授权书
+const download = (data) => {
+  return request({
+    url: `/dealer/download`,
+    method: 'post',
+    data,
+  })
+}
+
+
+export default {
+  list,
+  insert,
+  remove,
+  update,
+  submitOA,
+  download,
+}

+ 1 - 2
src/components/Refers/treeRefer.vue

@@ -59,6 +59,7 @@ export default {
   methods: {
     init(val) {
       this.visible = true;
+      this.filterText = ''
       this.reciveForm = val
       this.$nextTick(() => {
         this.refreshList();
@@ -81,8 +82,6 @@ export default {
       this.choosePoint = data;
     },
     filterNode(value, data) {
-      console.log("value", value);
-      console.log("data", data);
       if (!value) return true;
       return data.name.indexOf(value) !== -1;
     },

+ 62 - 0
src/components/input-dialog/index.js

@@ -0,0 +1,62 @@
+const arr2obj = (data, keyName, valueName) =>
+  Object.fromEntries(data.map((item) => [item[keyName], item[valueName]]));
+
+export const initColumns = (
+  arr,
+  prop = { disabled: false, readonly: false, clearable: false }
+) => {
+  return arr.map((element) => {
+    element.config = element.config || {};
+    if (element.type === "Input") {
+    }
+    if (element.type === "InputDialog") {
+      prop.readonly = true;
+    }
+    if (element.type === "InputNumber") {
+      element.config = { controlsPosition: "right", ...element.config };
+    }
+    if (element.type === "Select") {
+    }
+    if (element.type === "DatePicker") {
+      element.config = { type: "date", ...element.config };
+    }
+    if (element.type === "Upload") {
+      element.value = [];
+    }
+    return { ...element, ...prop };
+  });
+};
+
+// 初始化参数
+export const initParams = (prop, key = "key", value = "value") =>
+  arr2obj(prop, key, value);
+// 初始化字典
+export const initDicts = (prop) =>
+  prop
+    .filter((column) => column.type === "Select")
+    .map((column) => column.config.optionsName);
+// 初始化校验
+export const initRules = (prop) => {
+  const rules = {};
+  prop
+    .filter((column) => column.require)
+    .forEach((column) => {
+      const message = `${column.title}不能为空`;
+      rules[column.key] = [
+        { required: true, message: message, trigger: "change" },
+      ];
+    });
+  return rules;
+};
+
+const pageSizes = [25, 50, 100];
+
+const layout = "total, prev, pager, next, sizes, jumper";
+
+const page = { pageNum: 1, pageSize: 25, total: 0 };
+
+export const initPageSizes = () => pageSizes;
+
+export const initLayout = () => layout;
+
+export const initPage = () => page;

+ 3 - 0
src/main.js

@@ -14,6 +14,9 @@ import directive from './directive' // directive
 import plugins from './plugins' // plugins
 import { download } from '@/utils/request'
 
+// 时间格式化方法挂载
+import '@/views/marketing/utils/date';
+
 import './assets/icons' // icon
 import './permission' // permission control
 import { getDicts } from "@/api/system/dict/data";

+ 1 - 1
src/views/business/spd/bo/authority/index.vue

@@ -50,7 +50,7 @@
         </template>
       </el-table-column>
 
-      <el-table-column label="项目成员-新增" align="center" prop="taskAdd" >
+      <el-table-column label="任务-新增" align="center" prop="taskAdd" >
         <template slot-scope="scope">
           {{scope.row.taskAdd ? '√' : '×'}}
         </template>

+ 147 - 10
src/views/business/spd/bo/basic/details.vue

@@ -5,7 +5,14 @@
     <el-row type="flex" class="row-bg" justify="space-around">
       <el-col :span="4">
         <div class="grid-content bg-purple">
-          <el-button size="small" @click="handleBack">返回</el-button>
+          <el-button
+            type="info"
+            plain
+            icon="el-icon-back"
+            size="small"
+            @click="handleBack"
+            >返回</el-button
+          >
         </div>
       </el-col>
       <el-col :span="16">
@@ -57,6 +64,15 @@
           v-if="(showWin && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boWin"
           >赢单</el-button
         >
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-user"
+          size="small"
+          @click="allocation()"
+          v-if="this.boAuthority.post == 0 && this.form.basic.winningState == 0"
+          >分配</el-button
+        >
       </el-col>
     </el-row>
     <!-- 主多页签 -->
@@ -91,12 +107,12 @@
             </dev>
             <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton"/>
           </el-descriptions-item>
-          <el-descriptions-item label="医院营收总额">
+          <el-descriptions-item :label="totalRevenue">
             <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.basic.totalHosRevenue == dict.value">
               {{dict.label}}
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估值(万元)">
+          <el-descriptions-item :label="estimate">
             {{form.basic.hosDiscreetValue}}
           </el-descriptions-item>
           <el-descriptions-item label="赢单率">
@@ -120,7 +136,7 @@
           <el-descriptions-item label="部门">
             {{form.basic.deptName}}
           </el-descriptions-item>
-          <el-descriptions-item label="负责人">
+          <el-descriptions-item label="商机负责人">
             {{form.basic.principalName}}
           </el-descriptions-item>
           <el-descriptions-item label="创建人">
@@ -166,6 +182,7 @@
         />
       </el-tab-pane>
     </el-tabs>
+
     <!-- 赢单状态弹窗 -->
     <el-dialog :title="winningStateTitle" :visible.sync="winningStateOpen" width="500px" append-to-body>
       <el-form ref="wsform" :model="winningStateData" :rules="winningStateDataRules" label-width="140px">
@@ -236,29 +253,67 @@
         <el-button @click="cancelWinningStateData">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 分配商机负责人对话框 -->
+    <el-dialog
+      title="分配商机负责人"
+      :visible.sync="allocationPopover"
+      width="500px"
+      append-to-body
+    >
+      <el-form ref="afform" :model="allocationForm" :rules="allocationFormRules" label-width="140px">
+        <el-form-item label="新负责人" prop="allocationStaff">
+          <dr-input-dialog
+            v-model="allocationForm.allocationStaffName"
+            title="员工"
+            type="CONTACTS_PARAM"
+            :dataMapping="{
+              allocationStaff: 'id',
+              allocationStaffName: 'name',
+            }"
+            :source.sync="allocationForm"
+          ></dr-input-dialog>
+        </el-form-item>
+        <el-form-item label="是否将您作为参与人" prop="isParticipant">
+          <el-radio v-model="allocationForm.isParticipant" :label='true'
+            >是</el-radio
+          >
+          <el-radio v-model="allocationForm.isParticipant" :label='false'
+            >否</el-radio
+          >
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAllocationForm"
+          >确 定</el-button
+        >
+        <el-button @click="cancelAllocation">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import {
   getBasic,
-  delAccessory,
   updateWinningState,
+  allocationParticipant,
 } from "@/api/business/spd/bo/basic";
-import { getBoNodeList } from "@/api/business/spd/bo/boNode";
+import { getBoNodeListByType } from "@/api/business/spd/bo/boNode";
 import { getPsnPost } from "@/api/business/spd/bo/authority";
 import TaskList from "../task/taskList.vue";
 import ContactList from "../contact/contactList.vue";
 import AccessoryList from "../basic/accessoryList.vue";
 import FileTemplate from "../filetemplate/botabs.vue";
 import Process from '../basic/process.vue';
+import DrInputDialog from "@/components/input-dialog/index.vue";
 
 
 export default {
   //名称
   name: "BoDetails",
   //注册引入的组件
-  components: { TaskList, ContactList,AccessoryList,FileTemplate, Process},
+  components: { TaskList, ContactList,AccessoryList,FileTemplate, Process,DrInputDialog,},
   //平台枚举
   dicts: [
     "mk_bo_type",
@@ -283,7 +338,7 @@ export default {
       //赢单状态数据
       winningStateData:{},
       //赢单状态表单校验
-      // 表单校验
+      // 赢单表单校验
       winningStateDataRules: {
         winningStateCause: [
           { required: true, message: "原因不能为空", trigger: "blur" }
@@ -316,8 +371,64 @@ export default {
       timer: "",
       //是否显示客户
       showCustomer: false,
+      //分配参数
+      allocationForm: {
+        boId: null,
+        allocationStaff: null,
+        allocationStaffName: null,
+        isParticipant: true,
+      },
+      //分配表单校验
+      allocationFormRules: {
+        allocationStaff: [
+          { required: true, message: "新负责人不能为空", trigger: "blur" }
+        ],
+      },
+      //分配弹窗
+      allocationPopover: false,
+      //营收总额
+      totalRevenue:"***营收总额",
+      //预估额
+      estimate:"***预估额(万元)",
     };
   },
+  watch: {
+    'form.basic.boType': {
+      handler(newVal, oldVal) {
+        console.log('newVal',newVal);
+        switch(newVal) {
+          case '0':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '1':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材采集预估额(万元)"
+            break;
+          case '2':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '3':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院设备预估额(万元)"
+            break;
+          case '4':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '5':
+            this.totalRevenue = "项目总额";
+            this.estimate = "工程预估额(万元)"
+            break;
+          default:
+              break;
+        }
+      },
+      immediate: true,
+      deep: true // 可以深度检测到 person 对象的属性值的变化
+    }
+  },
   //方法
   methods: {
     // 返回
@@ -377,6 +488,31 @@ export default {
       this.winningStateOpen = false;
       this.resetWinningStateData();
     },
+    //打开分配弹窗
+    allocation() {
+      this.allocationPopover = true;
+    },
+    //提交分配表单
+    submitAllocationForm() {
+      // this.allocationForm.boId = parseInt(this.form.basic.id);
+      // this.allocationForm.allocationStaff = parseInt(this.allocationForm.allocationStaff);
+      this.allocationForm.boId = this.form.basic.id;
+      console.log('this.allocationForm',this.allocationForm);
+      this.$refs["afform"].validate(valid => {
+        if (valid) {
+          allocationParticipant(this.allocationForm).then(response => {
+            console.log('response',response);
+            this.$modal.msgSuccess("分配成功");
+            this.allocationPopover = false;
+            this.reload();
+          });
+        }
+      });
+    },
+    //取消分配
+    cancelAllocation() {
+      this.allocationPopover = false;
+    },
     //重新加载数据
     reload(){
       //加载基础数据
@@ -387,7 +523,7 @@ export default {
           this.boAuthority = response.data;
         });
         //加载流程节点数据
-        getBoNodeList(this.form.basic.boType).then(response => {
+        getBoNodeListByType(this.form.basic.boType).then(response => {
           this.boStage = response.rows;
           //赢丢单按钮显示逻辑
           var auditNode = 999;
@@ -436,8 +572,9 @@ export default {
         this.boAuthority = response.data;
       });
       //加载流程节点数据
-      getBoNodeList(this.form.basic.boType).then(response => {
+      getBoNodeListByType(this.form.basic.boType).then(response => {
         this.boStage = response.rows;
+        console.log('this.boStage',this.boStage);
         //赢丢单按钮显示逻辑
         var auditNode = 999;
         var curNode = 0;

+ 152 - 0
src/views/business/spd/bo/basic/filemanager copy.vue

@@ -0,0 +1,152 @@
+<template>
+  <div>
+    <el-form :model="form">
+      <el-form-item :label="name">
+        <el-row>
+          <el-col :span="1.5">
+            <el-input v-model="fileName" placeholder="待上传" readonly />
+          </el-col>
+          <el-col :span="1.5" v-show="!fileUrlid">
+            <el-button type="info" plain icon="el-icon-upload2" size="small" @click="uploadAccessory(field)">
+              上传
+            </el-button>
+          </el-col>
+          <el-col :span="1.5" v-show="fileUrlid" >
+            <el-button type="success" plain icon="el-icon-download" size="small" @click="exportAccessory">
+              下载
+            </el-button>
+          </el-col>
+          <el-col :span="1.5" v-show="fileUrlid">
+            <el-button size="small" type="danger" plain icon="el-icon-delete" @click="deleteAccessory(field)">
+              删除
+            </el-button>
+          </el-col>
+        </el-row>
+      </el-form-item>
+    </el-form>
+    <!-- 上传对话框 -->
+    <el-dialog
+      :title="upload.title"
+      :visible.sync="upload.open"
+      width="400px"
+      append-to-body
+    >
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls, .doc, .docx, .word, .wordx, .png, .jpg, .gif, .txt"
+        :headers="upload.headers"
+        :action="upload.url + '?boId=' + form.id + '&flag=' + upload.flag + '&boType=' + form.boType"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {delAccessory} from "@/api/business/spd/bo/basic";
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+
+export default {
+  name: "filemanager",
+  props: ["form","name","fileName","fileUrlid","field"],
+  data() {
+    return {
+      // 上传参数
+      upload: {
+        // 是否显示弹出层
+        open: false,
+        // 弹出层标题
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 上传类型
+        flag: "",
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/mk/bo/basic/upload",
+      },
+    };
+  },
+  created() {
+  },
+  methods: {
+    //上传附件公共方法
+    uploadAccessory(f) {
+      // this.upload.title = "上传附件";
+      this.upload.open = true;
+      this.upload.flag = f;
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+          response.msg +
+          "</div>",
+        "上传结果",
+        { dangerouslyUseHTMLString: true }
+      );
+      this.$emit('reload');
+    },
+    //下载附件
+    exportAccessory() {
+      let resUrl = "https://sy.derom.com/document-center/fastdfs/download?id=" + this.fileUrlid;
+      axios
+        .create({
+          timeout: 3000,
+          responseType: "blob", // 响应类型, 将响应数据转换为二进制数据
+          headers: {},
+        })
+        .get(resUrl)
+        .then((res) => {
+          console.log(res);
+          // 地址转换
+          let url = window.URL.createObjectURL(res.data);
+          const a = document.createElement("a");
+          a.setAttribute("href", url);
+          a.setAttribute("download", this.fileName);
+          document.body.append(a);
+          a.click();
+          document.body.removeChild(a);
+        });
+    },
+    //删除附件
+    deleteAccessory(f) {
+      this.$modal
+        .confirm("是否确认删除?")
+        .then(function () {})
+        .then(() => {
+          delAccessory(this.form.id, f, this.form.boType,this.fileUrlid).then((res) => {
+            console.log('删除返回',res);
+            this.$emit('reload');
+          });
+        })
+        .catch(() => {});
+    },
+  },
+};
+</script>

+ 49 - 78
src/views/business/spd/bo/basic/filemanager.vue

@@ -6,17 +6,28 @@
           <el-col :span="1.5">
             <el-input v-model="fileName" placeholder="待上传" readonly />
           </el-col>
-          <el-col :span="1.5" v-show="!fileUrlid">
-            <el-button type="info" plain icon="el-icon-upload2" size="small" @click="uploadAccessory(field)">
-              上传
-            </el-button>
+          <el-col :span="1.5" v-show="!fileUrlid && form.winningState == 0">
+            <el-upload
+              class="upload-demo"
+              ref="upload"
+              action="123"
+              :show-file-list="false"
+              :on-change="fileChange"
+              :file-list="fileList"
+              accept=".xlsx, .xls, .doc, .docx, .word, .wordx, .png, .jpg, .gif, .txt"
+              :auto-upload="false"
+              >
+              <el-button type="info" plain icon="el-icon-upload2" size="small">
+                上传
+              </el-button>
+            </el-upload>
           </el-col>
-          <el-col :span="1.5" v-show="fileUrlid" >
+          <el-col :span="1.5" v-show="fileUrlid && (this.$store.state.user.name == fileCreateBy || this.$store.state.user.id == form.principal)" >
             <el-button type="success" plain icon="el-icon-download" size="small" @click="exportAccessory">
               下载
             </el-button>
           </el-col>
-          <el-col :span="1.5" v-show="fileUrlid">
+          <el-col :span="1.5" v-show="fileUrlid  && form.winningState == 0 && this.$store.state.user.name == fileCreateBy" >
             <el-button size="small" type="danger" plain icon="el-icon-delete" @click="deleteAccessory(field)">
               删除
             </el-button>
@@ -24,93 +35,53 @@
         </el-row>
       </el-form-item>
     </el-form>
-    <!-- 上传对话框 -->
-    <el-dialog
-      :title="upload.title"
-      :visible.sync="upload.open"
-      width="400px"
-      append-to-body
-    >
-      <el-upload
-        ref="upload"
-        :limit="1"
-        accept=".xlsx, .xls, .doc, .docx, .word, .wordx, .png, .jpg, .gif, .txt"
-        :headers="upload.headers"
-        :action="upload.url + '?boId=' + form.id + '&flag=' + upload.flag + '&boType=' + form.boType"
-        :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
-        :auto-upload="false"
-        drag
-      >
-        <i class="el-icon-upload"></i>
-        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-      </el-upload>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitFileForm">确 定</el-button>
-        <el-button @click="upload.open = false">取 消</el-button>
-      </div>
-    </el-dialog>
   </div>
 </template>
 
 <script>
-import {delAccessory} from "@/api/business/spd/bo/basic";
+import {insertAccessory,delAccessory} from "@/api/business/spd/bo/basic";
 import axios from "axios";
-import { getToken } from "@/utils/auth";
 
 export default {
   name: "filemanager",
-  props: ["form","name","fileName","fileUrlid","field"],
+  props: ["form","name","fileName","fileUrlid","fileCreateBy","field"],
   data() {
     return {
-      // 上传参数
-      upload: {
-        // 是否显示弹出层
-        open: false,
-        // 弹出层标题
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 上传类型
-        flag: "",
-        // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/mk/bo/basic/upload",
-      },
+      //文件
+      fileList: [],
     };
   },
   created() {
+    console.log('this.name',this.form);
+    console.log('this.name',this.name);
+    console.log('this.$store.state.user',this.$store.state.user);
+    console.log('this.fileCreateBy',this.fileCreateBy);
   },
   methods: {
-    //上传附件公共方法
-    uploadAccessory(f) {
-      // this.upload.title = "上传附件";
-      this.upload.open = true;
-      this.upload.flag = f;
-    },
-    // 提交上传文件
-    submitFileForm() {
-      this.$refs.upload.submit();
-    },
-    // 文件上传中处理
-    handleFileUploadProgress(event, file, fileList) {
-      this.upload.isUploading = true;
-    },
-    // 文件上传成功处理
-    handleFileSuccess(response, file, fileList) {
-      this.upload.open = false;
-      this.upload.isUploading = false;
-      this.$refs.upload.clearFiles();
-      this.$alert(
-        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
-          response.msg +
-          "</div>",
-        "上传结果",
-        { dangerouslyUseHTMLString: true }
-      );
-      this.$emit('reload');
+    fileChange (file, fileList) {
+      if (fileList.length > 0) {
+        this.fileList = [fileList[fileList.length - 1]]
+        console.log('this.fileList',this.fileList);
+        let formData = new FormData();
+        if(this.fileList.length < 1){
+          formData.append('file', null);
+        }else{
+          this.fileList.forEach(el => {
+            formData.append('file', el.raw);
+          })
+        }
+        formData.append("boId",this.form.id);
+        formData.append("flag",this.field);
+        formData.append("boType",this.form.boType);
+        insertAccessory(formData).then(response => {
+          console.log('response',response);
+          if(response.code == 200){
+            this.$emit('reload');
+          }else{
+
+          }
+        });
+      }
     },
     //下载附件
     exportAccessory() {

+ 407 - 169
src/views/business/spd/bo/basic/index.vue

@@ -1,17 +1,41 @@
 <!-- 商机-列表 -->
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
       <el-form-item label="商机名称" prop="boName">
         <el-input
           v-model="queryParams.boName"
-          placeholder="请输入商机名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户名称" prop="customerName">
+        <el-input
+          v-model="queryParams.customerName"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商机负责人" prop="principalName">
+        <el-input
+          v-model="queryParams.principalName"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
       <el-form-item label="商机类型" prop="boType">
-        <el-select v-model="queryParams.boType" placeholder="请输入商机类型" clearable>
+        <el-select
+          v-model="queryParams.boType"
+          @change="boTypeChange"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.mk_bo_type"
             :key="dict.value"
@@ -20,30 +44,30 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="商机状态" prop="boState" clearable>
-        <el-select v-model="queryParams.boState" placeholder="请输入商机状态" clearable>
+      <el-form-item label="商机阶段" prop="boStage">
+        <el-select v-model="queryParams.boStage" clearable>
           <el-option
-            v-for="dict in dict.type.mk_bo_state"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
+            v-for="item in mk_bo_stage"
+            :key="item.code"
+            :label="item.name"
+            :value="item.code"
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="商机来源" prop="boSource">
-        <el-select v-model="queryParams.boSource" placeholder="请输入商机来源" clearable>
+      <el-form-item label="商机状态" prop="boState" clearable>
+        <el-select v-model="queryParams.boState" clearable>
           <el-option
-            v-for="dict in dict.type.mk_bo_source"
+            v-for="dict in dict.type.mk_bo_state"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="商机阶段" prop="boStage">
-        <el-select v-model="queryParams.boStage" placeholder="请输入商机阶段" clearable>
+      <el-form-item label="商机来源" prop="boSource">
+        <el-select v-model="queryParams.boSource" clearable>
           <el-option
-            v-for="dict in dict.type.mk_bo_stage"
+            v-for="dict in dict.type.mk_bo_source"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -60,25 +84,28 @@
           ></el-option>
         </el-select>
       </el-form-item> -->
-      <el-form-item label="客户名称" prop="customerName">
-        <el-input
-          v-model="queryParams.customerName"
-          placeholder="请输入客户名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="商机负责人" prop="principalName">
-        <el-input
-          v-model="queryParams.principalName"
-          placeholder="请输入负责人"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="创建时间">
+        <el-date-picker
+          v-model="dateRange"
+          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -90,7 +117,8 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <!-- <el-col :span="1.5">
         <el-button
@@ -112,75 +140,118 @@
           @click="handleDelete"
         >删除</el-button>
       </el-col> -->
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="basicList" @selection-change="handleSelectionChange" @cell-dblclick="enterDetails" >
+    <el-table
+      v-loading="loading"
+      :data="basicList"
+      @selection-change="handleSelectionChange"
+      @cell-dblclick="enterDetails"
+    >
       <el-table-column type="selection" align="center" />
-      <el-table-column label="编号" align="center" prop="boCode" />
+      <el-table-column
+        label="编号"
+        align="center"
+        prop="boCode"
+      />
       <el-table-column label="商机名称" align="center" prop="boName" />
-      <el-table-column label="商机类型" align="center" prop="boType" >
+      <el-table-column label="商机类型" align="center" prop="boType">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.mk_bo_type" :value="scope.row.boType"/>
+          <dict-tag :options="dict.type.mk_bo_type" :value="scope.row.boType" />
         </template>
       </el-table-column>
-      <el-table-column label="商机状态" align="center" prop="boState" >
+      <el-table-column label="商机状态" align="center" prop="boState">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.mk_bo_state" :value="scope.row.boState"/>
+          <dict-tag
+            :options="dict.type.mk_bo_state"
+            :value="scope.row.boState"
+          />
         </template>
       </el-table-column>
-      <el-table-column label="商机来源" align="center" prop="boSource" >
+      <el-table-column label="商机来源" align="center" prop="boSource">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.mk_bo_source" :value="scope.row.boSource"/>
+          <dict-tag
+            :options="dict.type.mk_bo_source"
+            :value="scope.row.boSource"
+          />
         </template>
       </el-table-column>
-      <el-table-column label="商机阶段" align="center" prop="boStageName"/>
+      <el-table-column label="商机阶段" align="center" prop="boStageName" />
       <el-table-column label="客户名称" align="center" prop="customerName" />
-      <el-table-column label="医院耗材预估值(万元)" align="center" prop="hosDiscreetValue" />
+      <el-table-column
+        label="预估值(万元)"
+        align="center"
+        prop="hosDiscreetValue"
+      />
       <el-table-column label="赢单率" align="center" prop="winningRate" />
-      <el-table-column label="赢单率状态" align="center" prop="winningState" >
+      <el-table-column label="赢单率状态" align="center" prop="winningState">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.mk_bo_winstate" :value="scope.row.winningState"/>
+          <dict-tag
+            :options="dict.type.mk_bo_winstate"
+            :value="scope.row.winningState"
+          />
         </template>
       </el-table-column>
-      <el-table-column label="销售区域" align="center" prop="marketingAreaName" />
-      <el-table-column label="销售组织" align="center" prop="marketingOrganizingName" />
+      <el-table-column
+        label="销售区域"
+        align="center"
+        prop="marketingAreaName"
+      />
+      <el-table-column
+        label="销售组织"
+        align="center"
+        prop="marketingOrganizingName"
+      />
       <el-table-column label="部门" align="center" prop="deptName" />
       <el-table-column label="商机负责人" align="center" prop="principalName" />
       <el-table-column label="创建人" align="center" prop="createBy" />
       <el-table-column label="创建时间" align="center" prop="createTime" />
-      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        fixed="right"
+        align="center"
+        class-name="small-padding fixed-width"
+        width="250"
+      >
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-search"
             @click="enterDetails(scope.row)"
-          >进入详情</el-button>
+            >进入详情</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-view"
             @click="handleBrowse(scope.row)"
-          >查看</el-button>
+            >查看</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
 
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -188,20 +259,37 @@
     />
 
     <!-- 添加或修改商机基础信息对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.form.winningState > 0 || this.operatingState == 'Browse'">
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="1000px"
+      append-to-body
+    >
+      <el-form
+        ref="form"
+        :model="form"
+        :rules="rules"
+        label-width="80px"
+        :disabled="
+          this.form.winningState > 0 || this.operatingState == 'Browse'
+        "
+      >
         <el-divider content-position="left">
           <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
         </el-divider>
         <el-row>
           <el-col :span="8">
             <el-form-item label="商机名称" prop="boName">
-              <el-input v-model="form.boName" placeholder="商机名称自动生成" :disabled="true"/>
+              <el-input
+                v-model="form.boName"
+                placeholder="商机名称自动生成"
+                :disabled="true"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="商机来源" prop="boSource">
-              <el-select v-model="form.boSource" placeholder="商机来源">
+              <el-select v-model="form.boSource">
                 <el-option
                   v-for="dict in dict.type.mk_bo_source"
                   :key="dict.value"
@@ -212,9 +300,20 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="推荐人" prop="referrerName" v-show="form.boSource == 2" :rules="form.boSource == 2 ? rules.referrer : [{require: false}]">
-              <el-input v-model="form.referrerName" placeholder="请输入推荐人" >
-                <el-button slot="append" icon="el-icon-more" @click="refereStaff"></el-button>
+            <el-form-item
+              label="推荐人"
+              prop="referrerName"
+              v-show="form.boSource == '2'"
+              :rules="
+                form.boSource == '2' ? rules.referrer : [{ require: false }]
+              "
+            >
+              <el-input v-model="form.referrerName">
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereStaff"
+                ></el-button>
               </el-input>
             </el-form-item>
           </el-col>
@@ -222,7 +321,10 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="商机类型" prop="boType">
-              <el-select v-model="form.boType" placeholder="商机类型" :disabled = "this.operatingState == 'Update'">
+              <el-select
+                v-model="form.boType"
+                :disabled="this.operatingState == 'Update'"
+              >
                 <el-option
                   v-for="dict in dict.type.mk_bo_type"
                   :key="dict.value"
@@ -234,14 +336,25 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="客户名称" prop="customerName">
-              <el-input v-model="form.customerName" placeholder="请输入客户" :disabled = "this.operatingState == 'Update'">
-                <el-button slot="append" icon="el-icon-more" @click="refereCustomer" :disabled = "this.operatingState == 'Update'"></el-button>
+              <el-input
+                v-model="form.customerName"
+                :disabled="this.operatingState == 'Update'"
+              >
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereCustomer"
+                  :disabled="this.operatingState == 'Update'"
+                ></el-button>
               </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="医院营收总额" prop="totalHosRevenue">
-              <el-select v-model="form.totalHosRevenue" placeholder="请输入医院营收总额">
+            <el-form-item :label="totalRevenue" prop="totalHosRevenue">
+              <el-select
+                v-model="form.totalHosRevenue"
+                @change="totalHosRevenueChange"
+              >
                 <el-option
                   v-for="dict in dict.type.mk_bo_total_revenue"
                   :key="dict.value"
@@ -254,22 +367,29 @@
         </el-row>
         <el-row>
           <el-col :span="8">
-            <el-form-item label="医院耗材预估值(万元)" prop="hosDiscreetValue">
-              <el-input type="number" v-model="form.hosDiscreetValue" placeholder="请输入医院耗材预估值" />
+            <el-form-item
+              :label="estimate"
+              prop="hosDiscreetValue"
+            >
+              <el-input-number
+                type="number"
+                :controls="false"
+                v-model="form.hosDiscreetValue"
+                :precision="2"
+              ></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
-            <el-form-item label="商机内容"  prop="boContent">
+            <el-form-item label="商机内容" prop="boContent">
               <el-input
                 type="textarea"
-                maxlength=900
+                maxlength="900"
                 rows="2"
-                placeholder="请输入商机内容"
                 autosize
                 v-model="form.boContent"
-                >
+              >
               </el-input>
             </el-form-item>
           </el-col>
@@ -280,8 +400,15 @@
         <el-row>
           <el-col :span="6">
             <el-form-item label="销售区域" prop="marketingAreaName">
-              <el-input v-model="form.marketingAreaName" placeholder="请输入销售区域">
-                <el-button slot="append" icon="el-icon-more" @click="refereSaleaea"></el-button>
+              <el-input
+                v-model="form.marketingAreaName"
+                placeholder="请输入销售区域"
+              >
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereSaleaea"
+                ></el-button>
               </el-input>
             </el-form-item>
           </el-col>
@@ -309,10 +436,17 @@
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'">确 定</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm"
+          v-if="this.operatingState != 'Browse'"
+          :disabled="submitButtonEditStatus"
+          >确 定</el-button
+        >
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
     <!-- 客户参照 -->
     <CustomerRef
       ref="customerSelect"
@@ -326,11 +460,7 @@
       :single="true"
     />
     <!-- 组织参照 -->
-    <OrgRef
-      ref="orgSelect"
-      @doSubmit="orgSelectionsToInput"
-      :single="true"
-    />
+    <OrgRef ref="orgSelect" @doSubmit="orgSelectionsToInput" :single="true" />
     <!-- 部门参照 -->
     <DeptRef
       ref="deptSelect"
@@ -347,17 +477,36 @@
 </template>
 
 <script>
-import { listBasic, getBasic, addBasic, updateBasic, delBasic } from "@/api/business/spd/bo/basic";
-import CustomerRef from '@/views/business/spd/bo/refer/customer/index.vue';
-import SaleaeaRef from '@/views/business/spd/bo/refer/saleaea/index.vue';
-import OrgRef from '@/views/business/spd/bo/refer/org/index.vue';
-import DeptRef from '@/views/business/spd/bo/refer/dept/index.vue';
-import StaffRef from '@/views/business/spd/bo/refer/staff/index.vue';
+import {
+  listBasic,
+  getBasic,
+  addBasic,
+  updateBasic,
+  delBasic,
+} from "@/api/business/spd/bo/basic";
+import CustomerRef from "@/views/business/spd/bo/refer/customer/index.vue";
+import SaleaeaRef from "@/views/business/spd/bo/refer/saleaea/index.vue";
+import OrgRef from "@/views/business/spd/bo/refer/org/index.vue";
+import DeptRef from "@/views/business/spd/bo/refer/dept/index.vue";
+import StaffRef from "@/views/business/spd/bo/refer/staff/index.vue";
+import { getBoNodeListByType } from "@/api/business/spd/bo/boNode";
 
 export default {
   name: "Basic",
-  dicts: ['mk_bo_type','mk_bo_state','mk_bo_stage','mk_bo_source','mk_bo_total_revenue','mk_bo_winstate'],
-  components: {CustomerRef,SaleaeaRef,OrgRef,DeptRef,StaffRef},
+  dicts: [
+    "mk_bo_type",
+    "mk_bo_state",
+    "mk_bo_source",
+    "mk_bo_total_revenue",
+    "mk_bo_winstate",
+  ],
+  components: {
+    CustomerRef,
+    SaleaeaRef,
+    OrgRef,
+    DeptRef,
+    StaffRef,
+  },
   data() {
     return {
       // 遮罩层
@@ -379,7 +528,7 @@ export default {
       // 是否显示弹出层
       open: false,
       //当前操作状态
-      operatingState: '',
+      operatingState: "",
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -412,70 +561,89 @@ export default {
         createBy: null,
         createTime: null,
         updateBy: null,
-        updateTime: null
+        updateTime: null,
       },
       // 表单参数
-      form: {},
+      form: {
+        referrer: null,
+        referrerName: null,
+      },
       //表单校验
       rules: {
         boSource: [
-          { required: true, message: "商机来源不能为空", trigger: "blur" }
+          { required: true, message: "商机来源不能为空", trigger: "blur" },
         ],
         referrerName: [
-          { required: true, message: "推荐人不能为空", trigger: "blur" }
+          { required: true, message: "推荐人不能为空", trigger: "blur" },
         ],
         boType: [
-          { required: true, message: "商机类型不能为空", trigger: "blur" }
+          { required: true, message: "商机类型不能为空", trigger: "blur" },
         ],
         customerName: [
-          { required: true, message: "客户名称不能为空", trigger: "blur" }
+          { required: true, message: "客户名称不能为空", trigger: "blur" },
         ],
         totalHosRevenue: [
-          { required: true, message: "医院营收总额不能为空", trigger: "blur" }
+          { required: true, message: "医院营收总额不能为空", trigger: "blur" },
         ],
         hosDiscreetValue: [
-          { required: true, message: "医院耗材预估值不能为空", trigger: "blur" }
+          {
+            required: true,
+            message: "医院耗材预估值不能为空",
+            trigger: "blur",
+          },
         ],
         boContent: [
-          { required: true, message: "商机内容不能为空", trigger: "blur" }
+          { required: true, message: "商机内容不能为空", trigger: "blur" },
         ],
       },
+      //阶段列表
+      mk_bo_stage: [],
+      // 查询日期范围
+      dateRange: [],
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
+      //营收总额
+      totalRevenue:"***营收总额",
+      //预估额
+      estimate:"***预估额(万元)",
     };
   },
-  //监听属性
-  watch:{
-    //阶段
-    'form.totalHosRevenue':{
-      handler(newName, oldName) {
-        switch(newName) {
-          //5000万以下
+  watch: {
+    'form.boType': {
+      handler(newVal, oldVal) {
+        console.log('newVal',newVal);
+        switch(newVal) {
           case '0':
-            this.form.hosDiscreetValue = 5000 * 0.2;
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
             break;
-          //5000万-1亿
           case '1':
-            this.form.hosDiscreetValue = 10000 * 0.2;
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材采集预估额(万元)"
             break;
-          //1亿-2亿
           case '2':
-            this.form.hosDiscreetValue = 20000 * 0.2;
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
             break;
-          //2亿-5亿
           case '3':
-            this.form.hosDiscreetValue = 50000 * 0.2;
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院设备预估额(万元)"
             break;
-          //5亿-10亿
           case '4':
-            this.form.hosDiscreetValue = 100000 * 0.2;
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
             break;
-          //10亿以上
           case '5':
-            this.form.hosDiscreetValue = 100000 * 0.2;
+            this.totalRevenue = "项目总额";
+            this.estimate = "工程预估额(万元)"
             break;
+          default:
+              break;
         }
       },
       immediate: true,
-    },
+      deep: true // 可以深度检测到 person 对象的属性值的变化
+    }
   },
   created() {
     this.getList();
@@ -484,20 +652,35 @@ export default {
     /** 查询商机基础信息列表 */
     getList() {
       this.loading = true;
-      listBasic(this.queryParams).then(response => {
-        this.basicList = response.rows;
-        //对商机名称进行加*
-        console.log(this.basicList);
-        for (var i = 0; i < this.basicList.length; i++) {
-          var arr = this.basicList[i].boName.split('-');
-          this.basicList[i].boName = arr[0] + '-' + arr[1].substring(0,2) + '******' + arr[1].substring(arr[1].length - 2,arr[1].length) + '-' + arr[2];
+      listBasic(this.addDateRange(this.queryParams, this.dateRange)).then(
+        (response) => {
+          this.basicList = response.rows;
+          //对商机名称进行加*
+          console.log(this.basicList);
+          for (var i = 0; i < this.basicList.length; i++) {
+            var arr = this.basicList[i].boName.split("-");
+            this.basicList[i].boName =
+              arr[0] +
+              "-" +
+              arr[1].substring(0, 2) +
+              "******" +
+              arr[1].substring(arr[1].length - 2, arr[1].length) +
+              "-" +
+              arr[2];
 
-          var customerName = this.basicList[i].customerName;
-          this.basicList[i].customerName = customerName.substring(0,2) + '******' + customerName.substring(customerName.length - 2,customerName.length);
+            var customerName = this.basicList[i].customerName;
+            this.basicList[i].customerName =
+              customerName.substring(0, 2) +
+              "******" +
+              customerName.substring(
+                customerName.length - 2,
+                customerName.length
+              );
+          }
+          this.total = response.total;
+          this.loading = false;
         }
-        this.total = response.total;
-        this.loading = false;
-      });
+      );
     },
     // 取消按钮
     cancel() {
@@ -535,7 +718,7 @@ export default {
         createBy: null,
         createTime: null,
         updateBy: null,
-        updateTime: null
+        updateTime: null,
       };
       this.resetForm("form");
     },
@@ -546,39 +729,42 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.dateRange = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
       this.open = true;
       this.operatingState = "Insert";
-      this.form.principal = this.$store.state.user.id;
-      this.form.principalName = this.$store.state.user.nickName;
-      this.form.dept = this.$store.state.user.deptId;
-      this.form.deptName = this.$store.state.user.deptName;
-      this.form.marketingOrganizing = this.$store.state.user.orgId;
-      this.form.marketingOrganizingName = this.$store.state.user.orgName;
+      const { id, orgId, deptId, nickName, deptName, orgName } =
+        this.$store.state.user;
+      this.form.principal = id;
+      this.form.principalName = nickName;
+      this.form.dept = deptId;
+      this.form.deptName = deptName;
+      this.form.marketingOrganizing = orgId;
+      this.form.marketingOrganizingName = orgName;
       this.title = "添加商机基础信息";
     },
     /** 进入详情按钮操作 */
     enterDetails(row) {
-      console.log('列数据:',row);
+      console.log("列数据:", row);
       this.$router.push(`/basic/spd/bo/basic/details/${row.id}`);
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
-      getBasic(id).then(response => {
-        this.form = response.data;
+      const id = row.id || this.ids;
+      getBasic(id).then((response) => {
+        this.form = { ...this.form, ...response.data };
         this.open = true;
         this.operatingState = "Update";
         this.title = "修改商机基础信息";
@@ -587,8 +773,8 @@ export default {
     /** 查看按钮操作 */
     handleBrowse(row) {
       this.reset();
-      const id = row.id || this.ids
-      getBasic(id).then(response => {
+      const id = row.id || this.ids;
+      getBasic(id).then((response) => {
         this.form = response.data;
         this.open = true;
         this.operatingState = "Browse";
@@ -597,85 +783,137 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.submitButtonEditStatus = true;
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
-            updateBasic(this.form).then(response => {
+            updateBasic(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
-            addBasic(this.form).then(response => {
+            addBasic(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
         }
+        this.submitButtonEditStatus = false;
       });
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除商机基础信息编号为"' + ids + '"的数据项?').then(function() {
-        return delBasic(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除商机基础信息编号为"' + ids + '"的数据项?')
+        .then(function () {
+          return delBasic(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('system/basic/export', {
-        ...this.queryParams
-      }, `basic_${new Date().getTime()}.xlsx`)
+      this.download(
+        "system/basic/export",
+        {
+          ...this.queryParams,
+        },
+        `basic_${new Date().getTime()}.xlsx`
+      );
+    },
+    //选择医院营收总额后
+    totalHosRevenueChange(value) {
+      switch (value) {
+        //5000万以下
+        case "0":
+          this.form.hosDiscreetValue = 5000 * 0.2;
+          break;
+        //5000万-1亿
+        case "1":
+          this.form.hosDiscreetValue = 10000 * 0.2;
+          break;
+        //1亿-2亿
+        case "2":
+          this.form.hosDiscreetValue = 20000 * 0.2;
+          break;
+        //2亿-5亿
+        case "3":
+          this.form.hosDiscreetValue = 50000 * 0.2;
+          break;
+        //5亿-10亿
+        case "4":
+          this.form.hosDiscreetValue = 100000 * 0.2;
+          break;
+        //10亿以上
+        case "5":
+          this.form.hosDiscreetValue = 100000 * 0.2;
+          break;
+      }
+    },
+    //查询参数商机类型改变后
+    boTypeChange(boType) {
+      if (boType) {
+        getBoNodeListByType(boType).then((response) => {
+          this.mk_bo_stage = response.rows;
+        });
+      } else {
+        this.mk_bo_stage = [];
+      }
     },
     // 触发客户参照列表
     refereCustomer() {
-      this.$refs.customerSelect.init()
+      this.$refs.customerSelect.init();
     },
     //客户参照列表选择后
-    customerSelectionsToInput (selections) {
+    customerSelectionsToInput(selections) {
       this.form.customer = selections[0].id;
       this.form.customerName = selections[0].name;
     },
     // 触发销售区域参照列表
     refereSaleaea() {
-      this.$refs.saleaeaSelect.init()
+      this.$refs.saleaeaSelect.init();
     },
     //销售区域参照列表选择后
-    saleaeaSelectionsToInput (selections) {
+    saleaeaSelectionsToInput(selections) {
       this.form.marketingArea = selections[0].id;
       this.form.marketingAreaName = selections[0].name;
     },
     // 触发组织参照列表
     refereOrg() {
-      this.$refs.orgSelect.init()
+      this.$refs.orgSelect.init();
     },
     //组织参照列表选择后
-    orgSelectionsToInput (selections) {
+    orgSelectionsToInput(selections) {
       this.form.marketingOrganizing = selections[0].deptId;
       this.form.marketingOrganizingName = selections[0].deptName;
     },
     // 触发部门参照列表
     refereDept() {
-      this.$refs.deptSelect.init()
+      this.$refs.deptSelect.init();
     },
     //部门参照列表选择后
-    deptSelectionsToInput (selections) {
+    deptSelectionsToInput(selections) {
       this.form.dept = selections[0].deptId;
       this.form.deptName = selections[0].deptName;
     },
     // 触发员工参照列表
     refereStaff() {
-      this.$refs.staffSelect.init()
+      this.$refs.staffSelect.init();
     },
     //员工参照列表选择后
-    staffSelectionsToInput (selections) {
+    staffSelectionsToInput(selections) {
       this.form.referrer = selections[0].userId;
       this.form.referrerName = selections[0].nickName;
-    }
-  }
+      console.log("this.form", this.form);
+    },
+  },
 };
 </script>

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 329 - 96
src/views/business/spd/bo/basic/process.vue


+ 0 - 231
src/views/business/spd/bo/behavior/AA copy.vue

@@ -1,231 +0,0 @@
-<template>
-  <div class="component-upload-image">
-    <el-upload
-      multiple
-      :action="uploadImgUrl"
-      :auto-upload="false"
-      list-type="picture-card"
-      :on-success="handleUploadSuccess"
-      :before-upload="handleBeforeUpload"
-      :limit="limit"
-      :on-error="handleUploadError"
-      :on-exceed="handleExceed"
-      ref="imageUpload"
-      :on-remove="handleDelete"
-      :show-file-list="true"
-      :headers="headers"
-      :file-list="fileList"
-      :on-preview="handlePictureCardPreview"
-      :class="{hide: this.fileList.length >= this.limit}"
-    >
-      <i class="el-icon-plus"></i>
-    </el-upload>
-    
-    <!-- 上传提示 -->
-    <div class="el-upload__tip" slot="tip" v-if="showTip">
-      请上传
-      <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
-      <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
-      的文件
-    </div>
-
-    <el-dialog
-      :visible.sync="dialogVisible"
-      title="预览"
-      width="800"
-      append-to-body
-    >
-      <img
-        :src="dialogImageUrl"
-        style="display: block; max-width: 100%; margin: 0 auto"
-      />
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { getToken } from "@/utils/auth";
-
-export default {
-  props: {
-    value: [String, Object, Array],
-    // 图片数量限制
-    limit: {
-      type: Number,
-      default: 5,
-    },
-    // 大小限制(MB)
-    fileSize: {
-       type: Number,
-      default: 5,
-    },
-    // 文件类型, 例如['png', 'jpg', 'jpeg']
-    fileType: {
-      type: Array,
-      default: () => ["png", "jpg", "jpeg"],
-    },
-    // 是否显示提示
-    isShowTip: {
-      type: Boolean,
-      default: true
-    }
-  },
-  model: {
-    prop: 'fileList',
-    event: 'editFileList'
-  },
-  data() {
-    return {
-      number: 0,
-      uploadList: [],
-      dialogImageUrl: "",
-      dialogVisible: false,
-      hideUpload: false,
-      baseUrl: process.env.VUE_APP_BASE_API,
-      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
-      headers: {
-        Authorization: "Bearer " + getToken(),
-      },
-      // fileList: []
-    };
-  },
-  watch: {
-    value: {
-      handler(val) {
-        if (val) {
-          // 首先将值转为数组
-          const list = Array.isArray(val) ? val : this.value.split(',');
-          // 然后将数组转为对象数组
-          this.fileList = list.map(item => {
-            if (typeof item === "string") {
-              if (item.indexOf(this.baseUrl) === -1) {
-                  item = { name: this.baseUrl + item, url: this.baseUrl + item };
-              } else {
-                  item = { name: item, url: item };
-              }
-            }
-            return item;
-          });
-        } else {
-          this.fileList = [];
-          return [];
-        }
-      },
-      deep: true,
-      immediate: true
-    }
-  },
-  computed: {
-    // 是否显示提示
-    showTip() {
-      return this.isShowTip && (this.fileType || this.fileSize);
-    },
-  },
-  methods: {
-    // 上传前loading加载
-    handleBeforeUpload(file) {
-      let isImg = false;
-      if (this.fileType.length) {
-        let fileExtension = "";
-        if (file.name.lastIndexOf(".") > -1) {
-          fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
-        }
-        isImg = this.fileType.some(type => {
-          if (file.type.indexOf(type) > -1) return true;
-          if (fileExtension && fileExtension.indexOf(type) > -1) return true;
-          return false;
-        });
-      } else {
-        isImg = file.type.indexOf("image") > -1;
-      }
-
-      if (!isImg) {
-        this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
-        return false;
-      }
-      if (this.fileSize) {
-        const isLt = file.size / 1024 / 1024 < this.fileSize;
-        if (!isLt) {
-          this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
-          return false;
-        }
-      }
-      this.$modal.loading("正在上传图片,请稍候...");
-      this.number++;
-    },
-    // 文件个数超出
-    handleExceed() {
-      this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
-    },
-    // 上传成功回调
-    handleUploadSuccess(res, file) {
-      if (res.code === 200) {
-        this.uploadList.push({ name: res.fileName, url: res.fileName });
-        this.uploadedSuccessfully();
-      } else {
-        this.number--;
-        this.$modal.closeLoading();
-        this.$modal.msgError(res.msg);
-        this.$refs.imageUpload.handleRemove(file);
-        this.uploadedSuccessfully();
-      }
-    },
-    // 删除图片
-    handleDelete(file) {
-      const findex = this.fileList.map(f => f.name).indexOf(file.name);
-      if(findex > -1) {
-        this.fileList.splice(findex, 1);
-        this.$emit("input", this.listToString(this.fileList));
-      }
-    },
-    // 上传失败
-    handleUploadError() {
-      this.$modal.msgError("上传图片失败,请重试");
-      this.$modal.closeLoading();
-    },
-    // 上传结束处理
-    uploadedSuccessfully() {
-      if (this.number > 0 && this.uploadList.length === this.number) {
-        this.fileList = this.fileList.concat(this.uploadList);
-        this.uploadList = [];
-        this.number = 0;
-        this.$emit("input", this.listToString(this.fileList));
-        this.$modal.closeLoading();
-      }
-    },
-    // 预览
-    handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url;
-      this.dialogVisible = true;
-    },
-    // 对象转成指定字符串分隔
-    listToString(list, separator) {
-      let strs = "";
-      separator = separator || ",";
-      for (let i in list) {
-        if (list[i].url) {
-          strs += list[i].url.replace(this.baseUrl, "") + separator;
-        }
-      }
-      return strs != '' ? strs.substr(0, strs.length - 1) : '';
-    }
-  }
-};
-</script>
-<style scoped lang="scss">
-// .el-upload--picture-card 控制加号部分
-::v-deep.hide .el-upload--picture-card {
-    display: none;
-}
-// 去掉动画效果
-::v-deep .el-list-enter-active,
-::v-deep .el-list-leave-active {
-    transition: all 0s;
-}
-
-::v-deep .el-list-enter, .el-list-leave-active {
-    opacity: 0;
-    transform: translateY(0);
-}
-</style>
-

+ 0 - 230
src/views/business/spd/bo/behavior/AA.vue

@@ -1,230 +0,0 @@
-<template>
-  <div class="component-upload-image">
-    <el-upload
-      multiple
-      :action="uploadImgUrl"
-      list-type="picture-card"
-      :on-success="handleUploadSuccess"
-      :before-upload="handleBeforeUpload"
-      :limit="limit"
-      :on-error="handleUploadError"
-      :on-exceed="handleExceed"
-      ref="imageUpload"
-      :on-remove="handleDelete"
-      :show-file-list="true"
-      :headers="headers"
-      :file-list="fileList"
-      :on-preview="handlePictureCardPreview"
-      :class="{hide: this.fileList.length >= this.limit}"
-    >
-      <i class="el-icon-plus"></i>
-    </el-upload>
-    
-    <!-- 上传提示 -->
-    <div class="el-upload__tip" slot="tip" v-if="showTip">
-      请上传
-      <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
-      <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
-      的文件
-    </div>
-
-    <el-dialog
-      :visible.sync="dialogVisible"
-      title="预览"
-      width="800"
-      append-to-body
-    >
-      <img
-        :src="dialogImageUrl"
-        style="display: block; max-width: 100%; margin: 0 auto"
-      />
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { getToken } from "@/utils/auth";
-
-export default {
-  model: {
-    prop: 'fileList',
-    event: 'editFileList'
-  },
-  props: {
-    value: [String, Object, Array],
-    // 图片数量限制
-    limit: {
-      type: Number,
-      default: 5,
-    },
-    // 大小限制(MB)
-    fileSize: {
-       type: Number,
-      default: 5,
-    },
-    // 文件类型, 例如['png', 'jpg', 'jpeg']
-    fileType: {
-      type: Array,
-      default: () => ["png", "jpg", "jpeg"],
-    },
-    // 是否显示提示
-    isShowTip: {
-      type: Boolean,
-      default: true
-    }
-  },
-  data() {
-    return {
-      number: 0,
-      uploadList: [],
-      dialogImageUrl: "",
-      dialogVisible: false,
-      hideUpload: false,
-      baseUrl: process.env.VUE_APP_BASE_API,
-      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
-      headers: {
-        Authorization: "Bearer " + getToken(),
-      },
-      fileList: []
-    };
-  },
-  watch: {
-    value: {
-      handler(val) {
-        if (val) {
-          // 首先将值转为数组
-          const list = Array.isArray(val) ? val : this.value.split(',');
-          // 然后将数组转为对象数组
-          this.fileList = list.map(item => {
-            if (typeof item === "string") {
-              if (item.indexOf(this.baseUrl) === -1) {
-                  item = { name: this.baseUrl + item, url: this.baseUrl + item };
-              } else {
-                  item = { name: item, url: item };
-              }
-            }
-            return item;
-          });
-        } else {
-          this.fileList = [];
-          return [];
-        }
-      },
-      deep: true,
-      immediate: true
-    }
-  },
-  computed: {
-    // 是否显示提示
-    showTip() {
-      return this.isShowTip && (this.fileType || this.fileSize);
-    },
-  },
-  methods: {
-    // 上传前loading加载
-    handleBeforeUpload(file) {
-      let isImg = false;
-      if (this.fileType.length) {
-        let fileExtension = "";
-        if (file.name.lastIndexOf(".") > -1) {
-          fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
-        }
-        isImg = this.fileType.some(type => {
-          if (file.type.indexOf(type) > -1) return true;
-          if (fileExtension && fileExtension.indexOf(type) > -1) return true;
-          return false;
-        });
-      } else {
-        isImg = file.type.indexOf("image") > -1;
-      }
-
-      if (!isImg) {
-        this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
-        return false;
-      }
-      if (this.fileSize) {
-        const isLt = file.size / 1024 / 1024 < this.fileSize;
-        if (!isLt) {
-          this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
-          return false;
-        }
-      }
-      this.$modal.loading("正在上传图片,请稍候...");
-      this.number++;
-    },
-    // 文件个数超出
-    handleExceed() {
-      this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
-    },
-    // 上传成功回调
-    handleUploadSuccess(res, file) {
-      if (res.code === 200) {
-        this.uploadList.push({ name: res.fileName, url: res.fileName });
-        this.uploadedSuccessfully();
-      } else {
-        this.number--;
-        this.$modal.closeLoading();
-        this.$modal.msgError(res.msg);
-        this.$refs.imageUpload.handleRemove(file);
-        this.uploadedSuccessfully();
-      }
-    },
-    // 删除图片
-    handleDelete(file) {
-      const findex = this.fileList.map(f => f.name).indexOf(file.name);
-      if(findex > -1) {
-        this.fileList.splice(findex, 1);
-        this.$emit("input", this.listToString(this.fileList));
-      }
-    },
-    // 上传失败
-    handleUploadError() {
-      this.$modal.msgError("上传图片失败,请重试");
-      this.$modal.closeLoading();
-    },
-    // 上传结束处理
-    uploadedSuccessfully() {
-      if (this.number > 0 && this.uploadList.length === this.number) {
-        this.fileList = this.fileList.concat(this.uploadList);
-        this.uploadList = [];
-        this.number = 0;
-        this.$emit("input", this.listToString(this.fileList));
-        this.$modal.closeLoading();
-      }
-    },
-    // 预览
-    handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url;
-      this.dialogVisible = true;
-    },
-    // 对象转成指定字符串分隔
-    listToString(list, separator) {
-      let strs = "";
-      separator = separator || ",";
-      for (let i in list) {
-        if (list[i].url) {
-          strs += list[i].url.replace(this.baseUrl, "") + separator;
-        }
-      }
-      return strs != '' ? strs.substr(0, strs.length - 1) : '';
-    }
-  }
-};
-</script>
-<style scoped lang="scss">
-// .el-upload--picture-card 控制加号部分
-::v-deep.hide .el-upload--picture-card {
-    display: none;
-}
-// 去掉动画效果
-::v-deep .el-list-enter-active,
-::v-deep .el-list-leave-active {
-    transition: all 0s;
-}
-
-::v-deep .el-list-enter, .el-list-leave-active {
-    opacity: 0;
-    transform: translateY(0);
-}
-</style>
-

+ 20 - 65
src/views/business/spd/bo/behavior/behaviorList.vue

@@ -31,11 +31,11 @@
           @click="handleDelete"
         >删除</el-button>
       </el-col> -->
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
     </el-row>
 
     <el-table v-loading="loading" :data="behaviorList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column type="index" label="序号" width="55" align="center"/>
       <el-table-column label="负责人" align="center" prop="staffName" />
       <el-table-column label="行动日期" align="center" prop="time" />
       <el-form-item label="行动日期" prop="time">
@@ -75,7 +75,8 @@
       <el-table-column label="销售组织" align="center" prop="salesOrgName" v-if="source == 'Behavior'"/>
       <el-table-column label="部门" align="center" prop="deptName" v-if="source == 'Behavior'"/>
 
-      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true">
+      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
+      <!-- <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true"> -->
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -244,54 +245,22 @@
         <el-divider content-position="left">
           <dev style="width: 50px; height: 40px; font-size: 18px">照片信息</dev>
         </el-divider>
-        <!-- <AA :limit="2" v-model="fileList"></AA> -->
 
         <el-upload
-          :action="actionUrl"
+          action="actionUrl"
           list-type="picture-card"
           :on-change="uploadPic"
+          :on-preview="handlePictureCardPreview"
+          :on-remove="handleRemove"
+          :auto-upload="false"
           :file-list="fileList"
-          :auto-upload="false">
-            <i slot="default" class="el-icon-plus"></i>
-            <div slot="file" slot-scope="{file}">
-              <img
-                class="el-upload-list__item-thumbnail"
-                :src="file.url" alt=""
-              >
-              <span class="el-upload-list__item-actions">
-                <span
-                  class="el-upload-list__item-preview"
-                  @click="handlePictureCardPreview(file)"
-                >
-                  <i class="el-icon-zoom-in"></i>
-                </span>
-                <span
-                  v-if="!disabled"
-                  class="el-upload-list__item-delete"
-                  @click="handleDownload(file)"
-                >
-                  <i class="el-icon-download"></i>
-                </span>
-                <span
-                  v-if="!disabled"
-                  class="el-upload-list__item-delete"
-                  @click="handleRemove(file)"
-                >
-                  <i class="el-icon-delete"></i>
-                </span>
-              </span>
-            </div>
+          >
+          <i class="el-icon-plus"></i>
         </el-upload>
-        <!-- <el-dialog :visible.sync="dialogVisible">
+        <el-dialog :visible.sync="dialogVisible">
           <img width="100%" :src="dialogImageUrl" alt="">
         </el-dialog>
-        <div class="demo-image__preview">
-          <el-image
-            style="width: 100px; height: 100px"
-            :src="url"
-            :preview-src-list="srcList">
-          </el-image>
-        </div> -->
+        
         <div class="md-auditInfo">
           <el-divider content-position="left">
             <dev style="width: 50px; height: 40px; font-size: 18px">其它信息</dev>
@@ -347,22 +316,14 @@
 import { listBehavior, getBehavior, delBehavior, addBehavior, updateBehavior,addPicture } from "@/api/business/spd/bo/behavior";
 import ContactRef from '@/views/business/spd/bo/refer/contact/index.vue';
 import SaleaeaRef from '@/views/business/spd/bo/refer/saleaea/index.vue';
-import AA from '@/views/business/spd/bo/behavior/AA.vue';
 
 export default {
   name: "BehaviorList",
   props:["source","bo","boAuthority"],
   dicts: ['mk_bo_behavior_res','mk_bo_behavior_type','sys_yes_no','mk_bo_behavior_goal'],
-  components: {ContactRef,SaleaeaRef,AA},
+  components: {ContactRef,SaleaeaRef},
   data() {
     return {
-url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
-        srcList: [
-          'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-          'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg',
-          'https://test-sy.derom.com/document-center/fastdfs/upload/433',
-        ],
-
       dialogImageUrl: '',
       dialogVisible: false,
       disabled: false,
@@ -436,6 +397,7 @@ url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
     };
   },
   created() {
+    console.log('this.boAuthority',this.boAuthority);
     if(this.source == 'Behavior'){
       this.queryParams = this.bo;
     }
@@ -447,30 +409,21 @@ url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
     }
     if(this.source == 'TaskList'){
       this.queryParams.taskCode = this.bo.code;
+      console.log("this.bo", this.bo);
     }
-    console.log("this.queryParams", this.queryParams);
     this.getList();
   },
   methods: {
     uploadPic(file, fileList) {
-      console.log('文件',file)
-      console.log('文件列表',fileList)
       this.fileList = fileList
+      console.log('this.fileList',this.fileList);
     },
     handleRemove(file) {
-      console.log('单击图片移除',file);
-      console.log('此时文件列表里面', this.fileList)
       this.fileList = this.fileList.filter(item => item.uid !== file.uid)
-      console.log('过滤后的', this.fileList)
     },
     handlePictureCardPreview(file) {
-      console.log(file)
       this.dialogImageUrl = file.url;
       this.dialogVisible = true;
-      console.log('图片列表',this.dialogImageUrl)
-    },
-    handleDownload(file) {
-      console.log(file);
     },
     /** 提交按钮 */
     submitForm() {
@@ -547,6 +500,7 @@ url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
     },
     /** 新增按钮操作 */
     handleAdd() {
+      this.fileList = [];
       this.reset();
       this.operatingState = "Insert";
       //新增行动设置默认值
@@ -585,8 +539,7 @@ url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
       const id = row.id || this.ids
       getBehavior(id).then(response => {
         this.form = response.data;
-        this.fileList = this.form.behaviorPs;
-        console.log('this.fileList',this.fileList);
+        
         this.open = true;
         this.title = "修改行动";
       });
@@ -597,6 +550,8 @@ url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
       const id = row.id || this.ids
       getBehavior(id).then(response => {
         this.form = response.data;
+        this.fileList = this.form.behaviorPs;
+        console.log('this.fileList',this.fileList);
         this.open = true;
         this.operatingState = "Browse";
         this.title = "基础信息";

+ 10 - 1
src/views/business/spd/bo/behavior/index.vue

@@ -15,7 +15,7 @@
       </el-form-item>
     </el-form>
 
-    <BehaviorList :key="timer" :source = "'Behavior'" :bo="queryParams" />
+    <BehaviorList :key="timer" :source = "'Behavior'" :bo="queryParams" :boAuthority="boAuthority" />
   </div>
 </template>
 
@@ -78,6 +78,15 @@ export default {
       },
       //重新加载子组件参数
       timer: '',
+      //行动权限写死
+      boAuthority:{
+        boAuthority:{
+          behaviorAdd:true,
+          behaviorEdit:true,
+          behaviorView:true,
+          behaviorDel:true,
+        }
+      },
     };
   },
   created() {

+ 5 - 61
src/views/business/spd/bo/contact/contactList.vue

@@ -11,38 +11,8 @@
           v-if="this.boAuthority.boAuthority.contactAdd"
         >新增</el-button>
       </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-        >删除</el-button>
-      </el-col> -->
-      <!-- <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-        >导出</el-button>
-      </el-col> -->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
-
     <el-table v-loading="loading" :data="contactList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="code" />
@@ -72,37 +42,6 @@
           <dict-tag :options="dict.type.mk_bo_contact_state" :value="scope.row.state"/>
         </template>
       </el-table-column>
-      <!-- <el-table-column label="商机id" align="center" prop="boId" /> -->
-      <!-- <el-table-column label="创建日期" align="center" prop="createDate" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="部门编码" align="center" prop="departmentCode" />
-      <el-table-column label="销售区域" align="center" prop="area" />
-      <el-table-column label="销售组织" align="center" prop="organization" />
-      <el-table-column label="最佳拜访地点" align="center" prop="visitPlace" />
-      <el-table-column label="最佳拜访时间" align="center" prop="visitTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.visitTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="邮件" align="center" prop="mail" />
-      <el-table-column label="关键决策人" align="center" prop="decisionMaker" />
-      <el-table-column label="擅长领域" align="center" prop="fieldExpertise" />
-      <el-table-column label="支持度" align="center" prop="support" />
-      <el-table-column label="职称" align="center" prop="jobTitle" />
-      <el-table-column label="任职科室" align="center" prop="section" />
-      <el-table-column label="上级联系人" align="center" prop="superiorContact" />
-      <el-table-column label="籍贯" align="center" prop="birthplace" />
-      <el-table-column label="生日" align="center" prop="birthday" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="联系人分类" align="center" prop="contactClassification" />
-
-      <el-table-column label="所属客户编码" align="center" prop="customerCode" /> -->
       <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true">
         <template slot-scope="scope">
           <el-button
@@ -510,10 +449,13 @@ export default {
   created() {
     if(this.source == 'BoDetails'){
       this.queryParams.customer = this.bo.customer;
+      let params = {"post":this.boAuthority.post};
+      this.queryParams.params = params;
     }
     if(this.source == 'Contact'){
       this.queryParams = this.bo;
     }
+    console.log('this.boAuthority',this.boAuthority);
     this.getList();
   },
   methods: {
@@ -527,6 +469,8 @@ export default {
           for (var i = 0; i < this.contactList.length; i++) {
             this.contactList[i].telephone = this.contactList[i].telephone.substring(0,3) + '******' + this.contactList[i].telephone.substring(this.contactList[i].telephone.length - 4,this.contactList[i].telephone.length);
             this.contactList[i].customerName = this.contactList[i].customerName.substring(0,2) + '******' + this.contactList[i].customerName.substring(this.contactList[i].customerName.length - 2,this.contactList[i].customerName.length);
+            const start = new Array(this.contactList[i].name.length).join('*');
+            this.contactList[i].name = start + this.contactList[i].name.slice(-1);
           }
         }
         this.total = response.total;

+ 10 - 1
src/views/business/spd/bo/contact/index.vue

@@ -222,7 +222,7 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <ContactList :key="timer" :source = "'Contact'" :bo="this.queryParams" />
+    <ContactList :key="timer" :source = "'Contact'" :bo="this.queryParams" :boAuthority="boAuthority" />
   </div>
 </template>
 
@@ -333,6 +333,15 @@ export default {
       },
       //重新加载子组件参数
       timer: '',
+      //列表权限写死
+      boAuthority:{
+        boAuthority:{
+          contactAdd:true,
+          contactEdit:true,
+          contactView:true,
+          contactDel:true,
+        }
+      },
     };
   },
   created() {

+ 26 - 5
src/views/business/spd/bo/education/educationList.vue

@@ -89,7 +89,9 @@
             v-model="form.enrollDate"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="请选择入学日期">
+            placeholder="请选择入学日期"
+            :picker-options="editStartOptions"
+            >
           </el-date-picker>
         </el-form-item>
         <el-form-item label="毕业日期" prop="graduationDate">
@@ -97,7 +99,9 @@
             v-model="form.graduationDate"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="请选择毕业日期">
+            placeholder="请选择毕业日期"
+            :picker-options="editStopOptions"
+            >
           </el-date-picker>
         </el-form-item>
         <el-form-item label="学校名称" prop="school">
@@ -170,10 +174,10 @@ export default {
       // 表单校验
       rules: {
         enrollDate: [
-          { required: true, message: "入学日期不能为空", trigger: "blur" }
+          { required: true, message: "入学日期不能为空", trigger: ["blur", "change"] }
         ],
         graduationDate: [
-          { required: true, message: "毕业日期不能为空", trigger: "blur" }
+          { required: true, message: "毕业日期不能为空", trigger: ["blur", "change"] }
         ],
         school: [
           { required: true, message: "学校名称不能为空", trigger: "blur" }
@@ -181,7 +185,24 @@ export default {
         education: [
           { required: true, message: "学历不能为空", trigger: "blur" }
         ],
-      }
+      },
+      editStartOptions: {
+        disabledDate: time => {
+          if (!this.form.graduationDate) {
+            return time.getTime() < new Date(1970 - 1 - 1).getTime();   //禁止选择1970年以前的日期
+          } else {
+            return time.getTime() > new Date(this.form.graduationDate);
+          }
+        }
+      },
+      editStopOptions: {
+        disabledDate: time => {
+          return (
+            time.getTime() < new Date(this.form.enrollDate) ||
+            time.getTime() < new Date(1970 - 1 - 1).getTime()    //禁止选择1970年以前的日期
+          );
+        }
+      },
     };
   },
   created() {

+ 1 - 6
src/views/business/spd/bo/filetemplate/botabs.vue

@@ -1,12 +1,7 @@
 <template>
   <div class="app-container">
     <el-table v-loading="loading" :data="filetemplateList" @selection-change="handleSelectionChange">
-      <el-table-column
-            type="index"
-            label="序号"
-            width="55"
-            align="center"
-          />
+      <el-table-column type="index" label="序号" width="55" align="center"/>
       <el-table-column label="模板名称" align="center" prop="name" />
       <el-table-column label="上传者" align="center" prop="createByName" />
       <el-table-column label="上传时间" align="center" prop="createTime" />

+ 28 - 7
src/views/business/spd/bo/filetemplate/index.vue

@@ -2,11 +2,18 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="商机类型" prop="boType">
-        <el-input
-          v-model="queryParams.url"
+        <el-select
+          v-model="queryParams.boType"
+          @change="boTypeChange"
           clearable
-          @keyup.enter.native="handleQuery"
-        />
+        >
+          <el-option
+            v-for="dict in dict.type.mk_bo_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          ></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="模板名称" prop="name">
         <el-input
@@ -47,6 +54,8 @@
         </template>
       </el-table-column>
       <el-table-column label="模板名称" align="center" prop="name" />
+      <el-table-column label="上传者" align="center" prop="createByName" />
+      <el-table-column label="上传时间" align="center" prop="createTime" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -81,8 +90,8 @@
       width="400px"
       append-to-body
     >
-      <el-form ref="form" :model="form" label-width="80px">
-        <el-form-item label="商机类型">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="商机类型" prop="boType">
           <el-select v-model="form.boType">
             <el-option
               v-for="dict in dict.type.mk_bo_type"
@@ -167,12 +176,20 @@ export default {
         // 上传的地址
         url: process.env.VUE_APP_BASE_API + "/mk/bo/filetemplate/upload",
       },
+      rules:{
+        boType :[{required: true, message: '请选择商机类型', trigger: 'blur'}],
+      },
     };
   },
   created() {
     this.getList();
   },
   methods: {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
     /** 查询文件模板列表 */
     getList() {
       this.loading = true;
@@ -188,7 +205,11 @@ export default {
     },
     // 提交上传文件
     submitFileForm() {
-      this.$refs.upload.submit();
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          this.$refs.upload.submit();
+        }
+      });
     },
     // 文件上传中处理
     handleFileUploadProgress(event, file, fileList) {

+ 23 - 16
src/views/business/spd/bo/pojpsn/pojpsnList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-row :gutter="10" class="mb8">
+    <el-row :gutter="10" class="mb8" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true">
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -34,10 +34,10 @@
           >删除</el-button
         >
       </el-col> -->
-      <right-toolbar
+      <!-- <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
-      ></right-toolbar>
+      ></right-toolbar> -->
     </el-row>
 
     <el-table
@@ -45,8 +45,7 @@
       :data="pojpsnList"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" align="center" />
-      <!-- <el-table-column label="主键" align="center" prop="id" /> -->
+      <el-table-column type="index" label="序号" width="55" align="center"/>
       <el-table-column
         label="商机名称"
         align="center"
@@ -66,10 +65,10 @@
         <template slot-scope="scope">
           <el-select v-model="scope.row.jobs" multiple disabled size="medium">
             <el-option
-              v-for="dict in dict.type.mk_bo_pojpsn_job"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
+              v-for="item in mk_bo_pojpsn_job"
+              :key="item.code"
+              :label="item.name"
+              :value="item.code"
             >
             </el-option>
           </el-select>
@@ -80,6 +79,7 @@
         fixed="right"
         align="center"
         class-name="small-padding fixed-width"
+        v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true"
       >
         <template slot-scope="scope">
           <el-button
@@ -130,7 +130,7 @@
           </el-input>
         </el-form-item>
         <el-form-item label="项目岗位" prop="post">
-          <el-select v-model="form.post" placeholder="请选择项目岗位">
+          <el-select v-model="form.post" placeholder="请选择项目岗位" disabled>
             <el-option
               v-for="dict in dict.type.mk_bo_pojpsn_post"
               :key="dict.value"
@@ -142,10 +142,10 @@
         <el-form-item label="职责" prop="jobs">
           <el-select v-model="form.jobs" multiple placeholder="请选择职责">
             <el-option
-              v-for="dict in dict.type.mk_bo_pojpsn_job"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
+              v-for="item in mk_bo_pojpsn_job"
+              :key="item.code"
+              :label="item.name"
+              :value="item.code"
             >
             </el-option>
           </el-select>
@@ -174,11 +174,12 @@ import {
   updatePojpsn,
 } from "@/api/business/spd/bo/pojpsn";
 import StaffRef from "@/views/business/spd/bo/refer/staff/index.vue";
+import { getBoJobListByType } from "@/api/business/spd/bo/boJob";
 
 export default {
   name: "pojpsnList",
   props: ["source", "bo","boAuthority"],
-  dicts: ["mk_bo_pojpsn_post", "mk_bo_pojpsn_job"],
+  dicts: ["mk_bo_pojpsn_post",],
   components: { StaffRef },
   data() {
     return {
@@ -228,6 +229,8 @@ export default {
         pojpsnEdit:true,
         pojpsnView:true,
       },
+      //职责列表
+      mk_bo_pojpsn_job:[],
     };
   },
   created() {
@@ -238,7 +241,10 @@ export default {
       this.queryParams.bo = this.bo.id;
       this.pojpsnAuthority = this.boAuthority.boAuthority;
     }
-    this.getList();
+    getBoJobListByType(this.bo.boType).then((response) => {
+      this.mk_bo_pojpsn_job = response.rows;
+      this.getList();
+    });
   },
   methods: {
     /** 查询项目成员列表 */
@@ -299,6 +305,7 @@ export default {
       if (this.source == "BoDetails") {
         this.form.bo = this.bo.id;
         this.form.boName = this.bo.boName;
+        this.form.post = "1";
       }
       this.open = true;
       this.title = "添加项目成员";

+ 4 - 10
src/views/business/spd/bo/refer/contact/index.vue

@@ -15,8 +15,7 @@
             <el-form
               size="small"
               :inline="true"
-              ref="searchForm"
-              :model="searchForm"
+              :model="queryParams"
               @keyup.enter.native="getList()"
               @submit.native.prevent
             >
@@ -74,7 +73,6 @@
                 prop="customerName"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="客户名称"
               >
@@ -83,7 +81,6 @@
                 prop="name"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="联系人"
               >
@@ -134,10 +131,6 @@ export default {
         customerName: undefined,
         state: null,
       },
-      searchForm: {
-        name: '',
-        customerName: ''
-      },
       dataListAllSelections: [], // 所有选中的数据包含跨页数据
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
       dataList: [],
@@ -198,9 +191,10 @@ export default {
       this.queryParams.pageNum = val;
       this.getList();
     },
-    // 排序
+    // 重置
     resetSearch() {
-      this.$refs.searchForm.resetFields();
+      this.queryParams.name = '';
+      this.queryParams.customerName = '';
       this.getList();
     },
     // 选中数据

+ 4 - 12
src/views/business/spd/bo/refer/customer/index.vue

@@ -15,7 +15,6 @@
             <el-form
               size="small"
               :inline="true"
-              ref="searchForm"
               :model="searchForm"
               @keyup.enter.native="getList()"
               @submit.native.prevent
@@ -74,7 +73,6 @@
                 prop="code"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="客户编码"
               >
@@ -83,7 +81,6 @@
                 prop="name"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="客户名称"
               >
@@ -130,12 +127,8 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        code: undefined,
-        name: undefined,
-      },
-      searchForm: {
         code: '',
-        name: ''
+        name: '',
       },
       dataListAllSelections: [], // 所有选中的数据包含跨页数据
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
@@ -143,7 +136,6 @@ export default {
       pageNo: 1,
       pageSize: 10,
       total: 0,
-      orders: [],
       loading: false,
       visible: false,
     };
@@ -190,10 +182,10 @@ export default {
       this.queryParams.pageNum = val;
       this.getList();
     },
-    // 排序
+    // 重置
     resetSearch() {
-      // this.$refs.searchForm.resetFields();
-      this.resetForm("searchForm");
+      this.queryParams.code = '';
+      this.queryParams.name = '';
       this.getList();
     },
     // 选中数据

+ 0 - 242
src/views/business/spd/bo/refer/dept/index copy.vue

@@ -1,242 +0,0 @@
-<template>
-  <div>
-    <el-dialog
-      title="部门选择"
-      width="1000px"
-      :close-on-click-modal="false"
-      :append-to-body="true"
-      v-dialogDrag
-      class="userDialog"
-      :visible.sync="visible"
-    >
-      <el-container style="height: 500px">
-        <el-container>
-          <el-header style="text-align: left; font-size: 12px; height: 30px">
-            <el-form
-              size="small"
-              :inline="true"
-              ref="searchForm"
-              :model="searchForm"
-              @keyup.enter.native="getList()"
-              @submit.native.prevent
-            >
-              <el-form-item prop="code">
-                <el-input
-                  size="small"
-                  v-model="queryParams.deptId"
-                  placeholder="部门编码"
-                  clearable
-                ></el-input>
-              </el-form-item>
-              <el-form-item prop="name">
-                <el-input
-                  size="small"
-                  v-model="queryParams.deptName"
-                  placeholder="部门名称"
-                  clearable
-                ></el-input>
-              </el-form-item>
-              <el-form-item>
-                <el-button
-                  type="primary"
-                  @click="getList()"
-                  size="small"
-                  icon="el-icon-search"
-                  >查询</el-button
-                >
-                <el-button
-                  @click="resetSearch()"
-                  size="small"
-                  icon="el-icon-refresh-right"
-                >重置</el-button>
-              </el-form-item>
-            </el-form>
-          </el-header>
-          <el-main>
-            <el-table
-              :data="dataList"
-              v-loading="loading"
-              size="small"
-              border
-              ref="contractTable"
-              @select="handleSelectionChange"
-              height="calc(100% - 40px)"
-              style="width: 100%"
-            >
-              <el-table-column
-                type="selection"
-                header-align="center"
-                align="center"
-                width="50"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="deptId"
-                header-align="center"
-                align="left"
-                sortable="custom"
-                min-width="90"
-                label="部门编码"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="deptName"
-                header-align="center"
-                align="left"
-                sortable="custom"
-                min-width="90"
-                label="部门名称"
-              >
-              </el-table-column>
-            </el-table>
-            <el-pagination
-              @size-change="sizeChangeHandle"
-              @current-change="currentChangeHandle"
-              :current-page="queryParams.pageNum"
-              :page-sizes="[5, 10, 15, 20]"
-              :page-size="queryParams.pageSize"
-              :total="total"
-              layout="total, sizes, prev, pager, next, jumper"
-            >
-            </el-pagination>
-          </el-main>
-        </el-container>
-      </el-container>
-      <span slot="footer" class="dialog-footer">
-        <el-button
-          size="small"
-          @click="visible = false"
-          icon="el-icon-circle-close"
-          >关闭</el-button
-        >
-        <el-button
-          size="small"
-          type="primary"
-          icon="el-icon-circle-check"
-          @click="doSubmit()"
-          >确定</el-button
-        >
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { queryDeptList } from "@/api/system/dept";
-export default {
-  data() {
-    return {
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        deptId: undefined,
-        deptName: undefined,
-      },
-      searchForm: {
-        code: '',
-        name: ''
-      },
-      dataListAllSelections: [], // 所有选中的数据包含跨页数据
-      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
-      dataList: [],
-      pageNo: 1,
-      pageSize: 10,
-      total: 0,
-      orders: [],
-      loading: false,
-      visible: false,
-    };
-  },
-  props: {
-    selectData: {
-      type: Array,
-      default: () => {
-        return [];
-      },
-    },
-    // 是否启用单选
-    single: {
-      type: Boolean,
-      default: false
-    }
-  },
-  methods: {
-    init() {
-      this.visible = true;
-      this.$nextTick(() => {
-        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
-        this.resetSearch();
-      });
-    },
-    // 获取数据列表
-    getList() {
-      this.loading = true;
-      queryDeptList(this.addDateRange(this.queryParams)).then(response => {
-          this.dataList = response.data;
-          this.total = response.total;
-          this.loading = false;
-        }
-      );
-    },
-    // 每页数
-    sizeChangeHandle(val) {
-      this.queryParams.pageSize = val;
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    // 当前页
-    currentChangeHandle(val) {
-      this.queryParams.pageNum = val;
-      this.getList();
-    },
-    // 排序
-    resetSearch() {
-      this.$refs.searchForm.resetFields();
-      this.getList();
-    },
-    // 选中数据
-    handleSelectionChange(selection, row) {
-      if (this.single && selection.length > 1) {
-        this.$refs.contractTable.clearSelection();
-        this.$refs.contractTable.toggleRowSelection(row);
-      }
-      this.dataListAllSelections = this.single ? [row] : selection
-    },
-    // 设置选中的方法
-    setSelectRow() {
-      this.$refs.contractTable.clearSelection();
-      if (!this.dataListAllSelections || this.dataListAllSelections.length <= 0) {
-        return;
-      }
-      for (let i = 0; i < this.dataList.length; i++) {
-        if (this.dataListAllSelections.some(item => item[this.idKey] == this.dataList[i][this.idKey])) {
-          // 设置选中,记住table组件需要使用ref="table"
-          this.$refs.contractTable.toggleRowSelection(this.dataList[i], true);
-        }
-      }
-    },
-    doSubmit() {
-      this.visible = false;
-      console.log('选择的数据?',this.dataListAllSelections)
-      this.$emit("doSubmit", this.dataListAllSelections);
-    },
-  },
-};
-</script>
-<style lang="scss">
-.userDialog {
-  .el-dialog__body {
-    padding: 10px 0px 0px 10px;
-    color: #606266;
-    font-size: 14px;
-    word-break: break-all;
-  }
-  .el-main {
-    padding: 20px 20px 5px 20px;
-    .el-pagination {
-      margin-top: 5px;
-    }
-  }
-}
-</style>

+ 4 - 10
src/views/business/spd/bo/refer/dept/index.vue

@@ -15,8 +15,7 @@
             <el-form
               size="small"
               :inline="true"
-              ref="searchForm"
-              :model="searchForm"
+              :model="queryParams"
               @keyup.enter.native="getList()"
               @submit.native.prevent
             >
@@ -74,7 +73,6 @@
                 prop="deptId"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="部门编码"
               >
@@ -83,7 +81,6 @@
                 prop="deptName"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="部门名称"
               >
@@ -133,10 +130,6 @@ export default {
         deptId: undefined,
         deptName: undefined,
       },
-      searchForm: {
-        code: '',
-        name: ''
-      },
       dataListAllSelections: [], // 所有选中的数据包含跨页数据
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
       dataList: [],
@@ -190,9 +183,10 @@ export default {
       this.queryParams.pageNum = val;
       this.getList();
     },
-    // 排序
+    // 重置
     resetSearch() {
-      this.$refs.searchForm.resetFields();
+      this.queryParams.deptId = '';
+      this.queryParams.deptName = '';
       this.getList();
     },
     // 选中数据

+ 4 - 10
src/views/business/spd/bo/refer/org/index.vue

@@ -15,8 +15,7 @@
             <el-form
               size="small"
               :inline="true"
-              ref="searchForm"
-              :model="searchForm"
+              :model="queryParams"
               @keyup.enter.native="getList()"
               @submit.native.prevent
             >
@@ -74,7 +73,6 @@
                 prop="deptId"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="组织编码"
               >
@@ -83,7 +81,6 @@
                 prop="deptName"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="组织名称"
               >
@@ -133,10 +130,6 @@ export default {
         deptId: undefined,
         deptName: undefined,
       },
-      searchForm: {
-        code: '',
-        name: ''
-      },
       dataListAllSelections: [], // 所有选中的数据包含跨页数据
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
       dataList: [],
@@ -190,9 +183,10 @@ export default {
       this.queryParams.pageNum = val;
       this.getList();
     },
-    // 排序
+    // 重置
     resetSearch() {
-      this.$refs.searchForm.resetFields();
+      this.queryParams.deptId = '';
+      this.queryParams.deptName = '';
       this.getList();
     },
     // 选中数据

+ 4 - 10
src/views/business/spd/bo/refer/saleaea/index.vue

@@ -15,8 +15,7 @@
             <el-form
               size="small"
               :inline="true"
-              ref="searchForm"
-              :model="searchForm"
+              :model="queryParams"
               @keyup.enter.native="getList()"
               @submit.native.prevent
             >
@@ -74,7 +73,6 @@
                 prop="code"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="区域编码"
               >
@@ -83,7 +81,6 @@
                 prop="name"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="区域名称"
               >
@@ -133,10 +130,6 @@ export default {
         code: undefined,
         name: undefined,
       },
-      searchForm: {
-        code: '',
-        name: ''
-      },
       dataListAllSelections: [], // 所有选中的数据包含跨页数据
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
       dataList: [],
@@ -190,9 +183,10 @@ export default {
       this.queryParams.pageNum = val;
       this.getList();
     },
-    // 排序
+    // 重置
     resetSearch() {
-      this.$refs.searchForm.resetFields();
+      this.queryParams.code = '';
+      this.queryParams.name = '';
       this.getList();
     },
     // 选中数据

+ 4 - 10
src/views/business/spd/bo/refer/staff/index.vue

@@ -15,8 +15,7 @@
             <el-form
               size="small"
               :inline="true"
-              ref="searchForm"
-              :model="searchForm"
+              :model="queryParams"
               @keyup.enter.native="getList()"
               @submit.native.prevent
             >
@@ -74,7 +73,6 @@
                 prop="userName"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="员工编码"
               >
@@ -83,7 +81,6 @@
                 prop="nickName"
                 header-align="center"
                 align="left"
-                sortable="custom"
                 min-width="90"
                 label="员工名称"
               >
@@ -133,10 +130,6 @@ export default {
         userName: undefined,
         nickName: undefined,
       },
-      searchForm: {
-        code: '',
-        name: ''
-      },
       dataListAllSelections: [], // 所有选中的数据包含跨页数据
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
       dataList: [],
@@ -190,9 +183,10 @@ export default {
       this.queryParams.pageNum = val;
       this.getList();
     },
-    // 排序
+    // 重置
     resetSearch() {
-      this.$refs.searchForm.resetFields();
+      this.queryParams.userName = '';
+      this.queryParams.nickName = '';
       this.getList();
     },
     // 选中数据

+ 552 - 133
src/views/business/spd/bo/statement/index.vue

@@ -1,62 +1,378 @@
 <template>
   <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="商机名称" prop="boName">
+        <el-input
+          v-model="queryParams.boName"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户" prop="customerName">
+        <el-input
+          v-model="queryParams.customerName"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="负责人" prop="principalName">
+        <el-input
+          v-model="queryParams.principalName"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商机来源" prop="boSource">
+        <el-input
+          v-model="queryParams.boSource"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="SPD商机" name="0">
-        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-          <el-form-item label="商机名称" prop="boName">
-            <el-input
-              v-model="queryParams.boName"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item label="客户" prop="customerName">
-            <el-input
-              v-model="queryParams.customerName"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item label="负责人" prop="principalName">
-            <el-input
-              v-model="queryParams.principalName"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item label="商机来源" prop="boSource">
-            <el-input
-              v-model="queryParams.boSource"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-          </el-form-item>
-        </el-form>
         <el-table :data="boList" >
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
           <el-table-column label="商机名称" align="center" prop="boName" />
-          <el-table-column label="商机名称" align="center" prop="boCode" />
+          <el-table-column label="商机编码" align="center" prop="boCode" />
           <el-table-column label="创建日期" align="center" prop="createTime" />
-          <el-table-column label="商机审核" align="center" prop="a71" />
-          <el-table-column label="项目立项" align="center" prop="a72" />
-          <el-table-column label="售前提案/邀请考察" align="center" prop="a73" />
-          <el-table-column label="开院务会" align="center" prop="a74" />
-          <el-table-column label="院内立项" align="center" prop="a75" />
-          <el-table-column label="进场调研" align="center" prop="a76" />
-          <el-table-column label="解决方案" align="center" prop="a78" />
-          <el-table-column label="投标与签合同" align="center" prop="a79" />
+          <el-table-column label="商机挖掘" align="center" prop="b000">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b000">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b000}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="商机审核" align="center" prop="b001" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b001">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b001}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="项目立项" align="center" prop="b002" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b002">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b002}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="解决方案" align="center" prop="b007" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b007">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b007}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="投标与签合同" align="center" prop="b008" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b008">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b008}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="完成" align="center" prop="b099" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b099">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b099}}
+              </dev>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+      <el-tab-pane label="耗材集采商机" name="1">
+        <el-table :data="boList" >
+          <el-table-column label="客户" align="center" prop="customerName" />
+          <el-table-column label="部门" align="center" prop="deptName" />
+          <el-table-column label="负责人" align="center" prop="principalName" />
+          <el-table-column label="商机名称" align="center" prop="boName" />
+          <el-table-column label="商机编码" align="center" prop="boCode" />
+          <el-table-column label="创建日期" align="center" prop="createTime" />
+          <el-table-column label="商机挖掘" align="center" prop="b100">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b100">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b100}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="商机审核" align="center" prop="b101" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b101">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b101}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="项目立项" align="center" prop="b102" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b102">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b102}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="解决方案" align="center" prop="b104" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b104">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b104}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="院内决策" align="center" prop="b105" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b105">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b105}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="投标与签合同" align="center" prop="b106" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b106">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b106}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="完成" align="center" prop="b199" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b199">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b199}}
+              </dev>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+      <el-tab-pane label="医疗耗材商机" name="2">
+        <el-table :data="boList" >
+          <el-table-column label="客户" align="center" prop="customerName" />
+          <el-table-column label="部门" align="center" prop="deptName" />
+          <el-table-column label="负责人" align="center" prop="principalName" />
+          <el-table-column label="商机名称" align="center" prop="boName" />
+          <el-table-column label="商机编码" align="center" prop="boCode" />
+          <el-table-column label="创建日期" align="center" prop="createTime" />
+          <el-table-column label="商机挖掘" align="center" prop="b200">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b200">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b200}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="需求信息收集" align="center" prop="b201">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b201">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b201}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="商机审核" align="center" prop="b202" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b202">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b202}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="项目立项" align="center" prop="b203" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b203">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b203}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="解决方案" align="center" prop="b205" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b205">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b205}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="临床申请" align="center" prop="b206" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b206">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b206}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="院内决策" align="center" prop="b207" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b207">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b207}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="投标与签合同" align="center" prop="b208" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b208">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b208}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="完成" align="center" prop="b299" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b299">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b299}}
+              </dev>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+      <el-tab-pane label="医疗设备商机" name="3">
+        <el-table :data="boList" >
+          <el-table-column label="客户" align="center" prop="customerName" />
+          <el-table-column label="部门" align="center" prop="deptName" />
+          <el-table-column label="负责人" align="center" prop="principalName" />
+          <el-table-column label="商机名称" align="center" prop="boName" />
+          <el-table-column label="商机编码" align="center" prop="boCode" />
+          <el-table-column label="创建日期" align="center" prop="createTime" />
+          <el-table-column label="商机挖掘" align="center" prop="b300">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b300">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b300}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="需求信息收集" align="center" prop="b301">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b301">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b301}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="商机审核" align="center" prop="b302" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b302">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b302}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="项目立项" align="center" prop="b303" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b303">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b303}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="解决方案" align="center" prop="b306" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b306">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b306}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="投标与签合同" align="center" prop="b307" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b307">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b307}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="完成" align="center" prop="b399" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b399">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b399}}
+              </dev>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+      <el-tab-pane label="军队医疗设备商机" name="4">
+        <el-table :data="boList" >
+          <el-table-column label="客户" align="center" prop="customerName" />
+          <el-table-column label="部门" align="center" prop="deptName" />
+          <el-table-column label="负责人" align="center" prop="principalName" />
+          <el-table-column label="商机名称" align="center" prop="boName" />
+          <el-table-column label="商机编码" align="center" prop="boCode" />
+          <el-table-column label="创建日期" align="center" prop="createTime" />
+          <el-table-column label="商机挖掘" align="center" prop="b400">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b400">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b400}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="需求信息收集" align="center" prop="b401">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b401">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b401}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="商机审核" align="center" prop="b402" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b402">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b402}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="项目立项" align="center" prop="b403" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b403">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b403}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="解决方案" align="center" prop="b406" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b406">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b406}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="投标与签合同" align="center" prop="b407" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b407">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b407}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="完成" align="center" prop="b499" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b499">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b499}}
+              </dev>
+            </template>
+          </el-table-column>
         </el-table>
       </el-tab-pane>
-      <el-tab-pane label="耗材集采商机" name="1">功能开发中</el-tab-pane>
-      <el-tab-pane label="耗材集采商机" name="2">功能开发中</el-tab-pane>
-      <el-tab-pane label="医疗设备商机" name="3">功能开发中</el-tab-pane>
-      <el-tab-pane label="军队医疗设备商机" name="4">功能开发中</el-tab-pane>
     </el-tabs>
 
     <pagination
@@ -76,6 +392,8 @@ import { listBasic } from "@/api/business/spd/bo/statement";
 export default {
   data() {
     return {
+      // 遮罩层
+      loading: true,
       //查询参数
       queryParams: {
         pageNum: 1,
@@ -90,8 +408,6 @@ export default {
       showSearch: true,
       //列表数据
       boList:[],
-      //spdBoList
-      spdBoList:[],
       //当前页签
       activeName: '0',
       //分页参数
@@ -99,7 +415,6 @@ export default {
     };
   },
   created() {
-    // this.getList();
     var e = {
       name: '0',
     }
@@ -108,102 +423,206 @@ export default {
   methods: {
     /** 查询任务列表 */
     getList() {
-      this.queryParams.boType = this.activeName;
-      listBasic(this.queryParams).then(response => {
-        this.boList = response.rows;
-        this.total = response.total;
-      });
+      var e = {
+        name: this.activeName,
+      }
+      this.handleClick(e);
     },
     handleClick(e) {
       console.log('e',e);
-      // this.queryParams.boType = e.name;
-      // listBasic(this.queryParams).then(response => {
-      //   this.boList = response.rows;
-      //   this.total = response.total;
-      // });
+      this.queryParams.boType = e.name;
       switch (e.name) {
         case "0":
-          // console.log('this.boList[i].boNodeFlowList',this.boList[0].boNodeFlowList);
-          // for (var i = 0; i < this.boList.length; i++) {
-          //   var nodes = this.boList[i].boNodeFlowList;
-          //   console.log('nodes',nodes);
-          //   // this.boList[i].a71 = nodes.filter(ele => ele. == '71').day;
-          // }
-          // console.log('转换后',this.boList);
-          this.boList = [
-            {
-              "id": 180,
-              "boCode": "BO20230428000024",
-              "boName": "李卓-测试客户1-SPD商机",
-              "boType": "0",
-              "boState": "0",
-              "boSource": "0",
-              "boStage": "0-01",
-              "boStageName": "商机审核",
-              "principal": "9273",
-              "principalName": "李卓",
-              "winningRate": "30%",
-              "winningState": "0",
-              "marketingOrganizing": "441675649082705",
-              "marketingOrganizingName": "湖南德荣医疗健康产业有限公司",
-              "marketingArea": "2318344533693184",
-              "marketingAreaName": "湘南区",
-              "deptName": "数字科技中心",
-              "dept": "426339510156234",
-              "createBy": "李卓",
-              "userCode": "002637",
-              "createTime": "2023-04-28 10:37:26",
-              "customerName": "测试客户1",
-              "hosDiscreetValue": 2002,
-              a71:'1天',
-              a72:'2天',
-              a73:'1天',
-              a74:'5天',
-              a75:'1天',
-            },
-            {
-              "id": 180,
-              "boCode": "BO20230428000024",
-              "boName": "李卓-测试客户1-SPD商机",
-              "boType": "0",
-              "boState": "0",
-              "boSource": "0",
-              "boStage": "0-01",
-              "boStageName": "商机审核",
-              "principal": "9273",
-              "principalName": "李卓",
-              "winningRate": "30%",
-              "winningState": "0",
-              "marketingOrganizing": "441675649082705",
-              "marketingOrganizingName": "湖南德荣医疗健康产业有限公司",
-              "marketingArea": "2318344533693184",
-              "marketingAreaName": "湘南区",
-              "deptName": "数字科技中心",
-              "dept": "426339510156234",
-              "createBy": "李卓",
-              "userCode": "002637",
-              "createTime": "2023-04-28 10:37:26",
-              "customerName": "测试客户1",
-              "hosDiscreetValue": 2002,
-              a71:'1天',
-              a72:'2天',
-              a73:'9天',
-              a74:'5天',
-              a75:'1天',
-              a76:'1天',
-              a77:'1天',
-              a78:'1天',
-              a79:'60天',
-            },
-          ]
+          listBasic(this.queryParams).then(response => {
+            this.boList = response.rows;
+            console.log('this.boList',this.boList);
+            for(var i = 0;i < this.boList.length;i++){
+              var nodes = this.boList[i].boNodeFlowList;
+              console.log('nodes',nodes);
+              var nodesfilter = nodes.filter(n => n.code == '0-00');
+              if(nodesfilter.length > 0){
+                this.boList[i].b000 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '0-01');
+              if(nodesfilter.length > 0){
+                this.boList[i].b001 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '0-02');
+              if(nodesfilter.length > 0){
+                this.boList[i].b002 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '0-07');
+              if(nodesfilter.length > 0){
+                this.boList[i].b007 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '0-08');
+              if(nodesfilter.length > 0){
+                this.boList[i].b008 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '0-99');
+              if(nodesfilter.length > 0){
+                this.boList[i].b099 = nodesfilter[0].day;
+              }
+            }
+            this.total = response.total;
+            this.loading = false;
+          });
           break;
         case "1":
+          listBasic(this.queryParams).then(response => {
+            this.boList = response.rows;
+            for(var i = 0;i < this.boList.length;i++){
+              var nodes = this.boList[i].boNodeFlowList;
+              var nodesfilter = nodes.filter(n => n.code == '1-00');
+              if(nodesfilter.length > 0){
+                this.boList[i].b100 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '1-01');
+              if(nodesfilter.length > 0){
+                this.boList[i].b101 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '1-02');
+              if(nodesfilter.length > 0){
+                this.boList[i].b102 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '1-04');
+              if(nodesfilter.length > 0){
+                this.boList[i].b104 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '1-05');
+              if(nodesfilter.length > 0){
+                this.boList[i].b105 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '1-06');
+              if(nodesfilter.length > 0){
+                this.boList[i].b106 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '1-99');
+              if(nodesfilter.length > 0){
+                this.boList[i].b199 = nodesfilter[0].day;
+              }
+            }
+            this.total = response.total;
+            this.loading = false;
+          });
           break;
         case "2":
+          listBasic(this.queryParams).then(response => {
+            this.boList = response.rows;
+            for(var i = 0;i < this.boList.length;i++){
+              var nodes = this.boList[i].boNodeFlowList;
+              var nodesfilter = nodes.filter(n => n.code == '2-00');
+              if(nodesfilter.length > 0){
+                this.boList[i].b200 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '2-01');
+              if(nodesfilter.length > 0){
+                this.boList[i].b201 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '2-02');
+              if(nodesfilter.length > 0){
+                this.boList[i].b202 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '2-03');
+              if(nodesfilter.length > 0){
+                this.boList[i].b203 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '2-05');
+              if(nodesfilter.length > 0){
+                this.boList[i].b205 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '2-06');
+              if(nodesfilter.length > 0){
+                this.boList[i].b206 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '2-07');
+              if(nodesfilter.length > 0){
+                this.boList[i].b207 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '2-99');
+              if(nodesfilter.length > 0){
+                this.boList[i].b299 = nodesfilter[0].day;
+              }
+            }
+            this.total = response.total;
+            this.loading = false;
+          });
           break;
         case "3":
+          listBasic(this.queryParams).then(response => {
+            this.boList = response.rows;
+            for(var i = 0;i < this.boList.length;i++){
+              var nodes = this.boList[i].boNodeFlowList;
+              var nodesfilter = nodes.filter(n => n.code == '3-00');
+              if(nodesfilter.length > 0){
+                this.boList[i].b300 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '3-01');
+              if(nodesfilter.length > 0){
+                this.boList[i].b301 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '3-02');
+              if(nodesfilter.length > 0){
+                this.boList[i].b302 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '3-03');
+              if(nodesfilter.length > 0){
+                this.boList[i].b303 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '3-06');
+              if(nodesfilter.length > 0){
+                this.boList[i].b306 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '3-07');
+              if(nodesfilter.length > 0){
+                this.boList[i].b307 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '3-99');
+              if(nodesfilter.length > 0){
+                this.boList[i].b399 = nodesfilter[0].day;
+              }
+            }
+            this.total = response.total;
+            this.loading = false;
+          });
           break;
         case "4":
+          listBasic(this.queryParams).then(response => {
+            this.boList = response.rows;
+            for(var i = 0;i < this.boList.length;i++){
+              var nodes = this.boList[i].boNodeFlowList;
+              var nodesfilter = nodes.filter(n => n.code == '4-00');
+              if(nodesfilter.length > 0){
+                this.boList[i].b400 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '4-01');
+              if(nodesfilter.length > 0){
+                this.boList[i].b401 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '4-02');
+              if(nodesfilter.length > 0){
+                this.boList[i].b402 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '4-03');
+              if(nodesfilter.length > 0){
+                this.boList[i].b403 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '4-06');
+              if(nodesfilter.length > 0){
+                this.boList[i].b406 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '4-07');
+              if(nodesfilter.length > 0){
+                this.boList[i].b407 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '4-99');
+              if(nodesfilter.length > 0){
+                this.boList[i].b499 = nodesfilter[0].day;
+              }
+            }
+            this.total = response.total;
+            this.loading = false;
+          });
           break;
         default:
           break;

+ 232 - 0
src/views/business/spd/bo/statement/proportion/index.vue

@@ -0,0 +1,232 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="商机日期" prop="code">
+        <el-date-picker
+          type="month"
+          v-model="queryParams.yearMonth"
+          placeholder="选择月份"
+          >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="商机类型" prop="boType">
+        <el-select
+          v-model="queryParams.boType"
+          @change="boTypeChange"
+          clearable
+        >
+          <el-option
+            v-for="dict in dict.type.mk_bo_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="商机来源" prop="boSource">
+        <el-select
+          v-model="queryParams.boSource"
+          clearable
+        >
+          <el-option
+            v-for="dict in dict.type.mk_bo_source"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="商机部门" prop="deptName">
+        <el-input
+          v-model="queryParams.deptName"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
+      <el-table-column label="中心部门" align="center" prop="deptName" />
+      <el-table-column label="当月新增商机数(个)" align="center" prop="sumTotal" />
+      <el-table-column label="当月审核通过数(个)" align="center" prop="passAudit" />
+      <el-table-column label="当月审核通过率%" align="center" prop="passAuditRate" />
+      <el-table-column label="当月立项成功数(个)" align="center" prop="approveInitiateProject" />
+      <el-table-column label="当月立项成功率%" align="center" prop="approveInitiateProjectRate" />
+      <el-table-column label="当月挂网数(个)" align="center" prop="hanging" />
+      <el-table-column label="当月挂网率%" align="center" prop="hangingRate" />
+      <el-table-column label="当月合同签订数(个)" align="center" prop="contractSigning" />
+      <el-table-column label="当月合同签订率%" align="center" prop="contractSigningRate" />
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listProportion } from "@/api/business/spd/bo/statement";
+
+export default {
+  name: "proportion",
+  dicts: [
+    "mk_bo_type",
+    "mk_bo_source",
+  ],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 职责表格数据
+      list: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        yearMonth: null,
+        boType: null,
+        boSource: null,
+        deptName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询职责列表 */
+    getList() {
+      this.loading = true;
+      listProportion(this.queryParams).then(response => {
+        this.list = response.rows;
+        for(let item of this.list) {
+          if(item.passAuditRate){item.passAuditRate = (item.passAuditRate * 100) + '%';}
+          if(item.approveInitiateProjectRate){item.approveInitiateProjectRate = (item.approveInitiateProjectRate * 100) + '%';}
+          if(item.hangingRate){item.hangingRate = (item.hangingRate * 100) + '%';}
+          if(item.contractSigningRate){item.contractSigningRate = (item.contractSigningRate * 100) + '%';}
+        }
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        code: null,
+        name: null,
+        boType: null,
+        tenantId: null,
+        revision: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        delFlag: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      console.log('this.queryParams',this.queryParams);
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加职责";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getJob(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改职责";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateJob(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addJob(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除职责编号为"' + ids + '"的数据项?').then(function() {
+        return delJob(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('pu/job/export', {
+        ...this.queryParams
+      }, `job_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 487 - 35
src/views/business/spd/bo/task/index.vue

@@ -1,18 +1,9 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="商机名称" prop="boName">
-        <el-input
-          v-model="queryParams.boName"
-          placeholder="请输入商机名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="任务编码" prop="code">
         <el-input
           v-model="queryParams.code"
-          placeholder="请输入任务编码"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -20,23 +11,13 @@
       <el-form-item label="任务名称" prop="name">
         <el-input
           v-model="queryParams.name"
-          placeholder="请输入任务名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="商机阶段" prop="boStage">
-        <el-input
-          v-model="queryParams.boStage"
-          placeholder="请输入商机阶段"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="任务状态" prop="state">
+      <el-form-item label="商机名称" prop="boName">
         <el-input
-          v-model="queryParams.state"
-          placeholder="请输入任务状态"
+          v-model="queryParams.boName"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -44,17 +25,410 @@
       <el-form-item label="客户名称" prop="customerName">
         <el-input
           v-model="queryParams.customerName"
-          placeholder="请输入客户名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="任务状态" prop="state">
+        <el-select
+          v-model="queryParams.state"
+          clearable
+        >
+          <el-option
+            v-for="dict in dict.type.mk_bo_taskstate"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <TaskList :key="timer" :source = "'Task'" :bo="queryParams" />
+    <el-row :gutter="10" class="mb8">
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          >新增</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleUpdate"
+          >修改</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          @click="handleDelete"
+          >删除</el-button
+        >
+      </el-col> -->
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="taskList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="任务编码" align="center" prop="code" />
+      <el-table-column label="任务名称" align="center" prop="name" />
+      <el-table-column
+        label="商机名称"
+        align="center"
+        prop="boName"
+      />
+      <el-table-column label="商机阶段" align="center" prop="boStageName"/>
+      <el-table-column
+        label="客户名称"
+        align="center"
+        prop="customerName"
+      />
+      <el-table-column label="任务类型" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.mk_bo_tasktype"
+            :value="scope.row.type"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="任务状态" align="center" prop="state">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.mk_bo_taskstate"
+            :value="scope.row.state"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="联系人" align="center" prop="linkmanName" />
+      <el-table-column
+        label="销售组织名称"
+        align="center"
+        prop="salesOrgName"
+      />
+      <el-table-column label="部门名称" align="center" prop="deptName" />
+      <el-table-column label="负责人名称" align="center" prop="staffName" />
+      <el-table-column
+        label="截止时间"
+        align="center"
+        prop="deadlineTime"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.deadlineTime, "{y}-{m}-{d}") }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="任务内容" align="center" prop="content" />
+      <el-table-column
+        label="操作"
+        fixed="right"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-s-promotion"
+            @click="handleBrowse(scope.row)"
+            >跟进</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改任务对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="1000px"
+      append-to-body
+    >
+      <el-form
+        ref="form"
+        :model="form"
+        :rules="rules"
+        label-width="80px"
+        :disabled="this.operatingState == 'Browse'"
+      >
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="商机名称" prop="boName">
+              <el-input
+                v-model="form.boName"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item
+              label="商机阶段"
+              prop="boStage"
+            >
+              <el-select v-model="form.boStage">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_stage"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="客户" prop="customerName">
+              <el-input
+                v-model="form.customerName"
+              >
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereCustomer"
+                ></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="任务编码" prop="code">
+              <el-input
+                v-model="form.code"
+                :disabled="true"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="任务名称" prop="name">
+              <el-input v-model="form.name" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="任务状态" prop="state">
+              <el-select v-model="form.state" >
+                <el-option
+                  v-for="dict in dict.type.mk_bo_taskstate"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="开始时间" prop="startTime">
+              <el-date-picker
+                clearable
+                v-model="form.startTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="截止时间" prop="deadlineTime">
+              <el-date-picker
+                clearable
+                v-model="form.deadlineTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="任务类型" prop="type">
+              <el-select v-model="form.type" >
+                <el-option
+                  v-for="dict in dict.type.mk_bo_tasktype"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="联系人" prop="linkmanName">
+              <el-input v-model="form.linkmanName">
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereContact"
+                ></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="销售组织" prop="salesOrgName">
+              <el-input v-model="form.salesOrgName" :disabled="true">
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereOrg"
+                  :disabled="true"
+                ></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="部门" prop="deptName">
+              <el-input v-model="form.deptName" :disabled="true">
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereDept"
+                  :disabled="true"
+                ></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="负责人" prop="staffName">
+              <el-input v-model="form.staffName">
+                <el-button
+                  slot="append"
+                  icon="el-icon-more"
+                  @click="refereStaff"
+                ></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="任务内容" prop="content">
+          <el-input
+            type="textarea"
+            :rows="2"
+            autosize
+            v-model="form.content"
+          >
+          </el-input>
+        </el-form-item>
+        
+        <div class="md-auditInfo">
+          <el-divider content-position="left">其它信息</el-divider>
+          <el-form :inline="true" label-position="right" :model="form">
+            <el-row>
+              <el-col :span="6">
+                <el-form-item label="创建人">
+                  <el-input
+                    v-model="form.createByName"
+                    size="small"
+                    readonly
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="创建时间">
+                  <el-input
+                    v-model="form.createTime"
+                    size="small"
+                    readonly
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="修改人">
+                  <el-input
+                    v-model="form.updateByName"
+                    size="small"
+                    readonly
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="修改时间">
+                  <el-input
+                    v-model="form.updateTime"
+                    size="small"
+                    readonly
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </div>
+      </el-form>
+
+      <BehaviorList
+          :key="timer"
+          :source="'TaskList'"
+          :bo="this.form"
+          :boAuthority="boAuthority"
+          v-if="this.operatingState != 'Insert'"
+        />
+        
+      <div slot="footer" class="dialog-footer">
+        <el-button
+          type="primary"
+          @click="submitForm"
+          v-if="this.operatingState != 'Browse'"
+          >确 定</el-button
+        >
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 客户参照 -->
+    <CustomerRef
+      ref="customerSelect"
+      @doSubmit="customerSelectionsToInput"
+      :single="true"
+    />
+    <!-- 联系人参照 -->
+    <ContactRef
+      ref="contactSelect"
+      @doSubmit="contactSelectionsToInput"
+      :single="true"
+      :outerQueryParams="this.bo"
+    />
+    <!-- 组织参照 -->
+    <OrgRef ref="orgSelect" @doSubmit="orgSelectionsToInput" :single="true" />
+    <!-- 部门参照 -->
+    <DeptRef
+      ref="deptSelect"
+      @doSubmit="deptSelectionsToInput"
+      :single="true"
+    />
+    <!-- 员工参照 -->
+    <StaffRef
+      ref="staffSelect"
+      @doSubmit="staffSelectionsToInput"
+      :single="true"
+    />
   </div>
 </template>
 
@@ -62,12 +436,25 @@
 <script>
 import { listTask, getTask, delTask, addTask, updateTask } from "@/api/business/spd/bo/task";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import TaskList from '../task/taskList.vue'
+import CustomerRef from "@/views/business/spd/bo/refer/customer/index.vue";
+import ContactRef from "@/views/business/spd/bo/refer/contact/index.vue";
+import OrgRef from "@/views/business/spd/bo/refer/org/index.vue";
+import DeptRef from "@/views/business/spd/bo/refer/dept/index.vue";
+import StaffRef from "@/views/business/spd/bo/refer/staff/index.vue";
+import BehaviorList from "../behavior/behaviorList.vue";
+import { getPsnPost } from "@/api/business/spd/bo/authority";
 
 export default {
   name: "Task",
-  dicts: ['mk_bo_taskstate','mk_bo_tasktype'],
-  components: {TaskList},
+    dicts: ["mk_bo_taskstate", "mk_bo_tasktype", "mk_bo_stage"],
+    components: {
+      CustomerRef,
+      ContactRef,
+      OrgRef,
+      DeptRef,
+      StaffRef,
+      BehaviorList,
+    },
   data() {
     return {
       // 遮罩层
@@ -124,6 +511,12 @@ export default {
       },
       //重新加载子组件参数
       timer: '',
+      // 操作撞他
+      operatingState:'',
+      // 所选商机
+      curBo:{},
+      // 权限
+      boAuthority:{},
     };
   },
   created() {
@@ -133,6 +526,7 @@ export default {
     /** 查询任务列表 */
     getList() {
       this.loading = true;
+      this.queryParams.staff = this.$store.state.user.id;
       listTask(this.queryParams).then(response => {
         this.taskList = response.rows;
         this.total = response.total;
@@ -179,8 +573,7 @@ export default {
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
-      this.timer = new Date().getTime();
-      // this.getList();
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
@@ -193,6 +586,22 @@ export default {
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
+    /** 查看按钮操作 */
+    handleBrowse(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getTask(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.operatingState = "Browse";
+        this.title = "基础信息";
+        //加载权限数据
+        getPsnPost(this.form.bo).then((response) => {
+          this.boAuthority = response.data;
+          this.timer = new Date().getTime();
+        });
+      });
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
@@ -241,7 +650,7 @@ export default {
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
-	/** 行动序号 */
+	  /** 行动序号 */
     rowMkBoBehaviorIndex({ row, rowIndex }) {
       row.index = rowIndex + 1;
     },
@@ -285,12 +694,55 @@ export default {
     handleMkBoBehaviorSelectionChange(selection) {
       this.checkedMkBoBehavior = selection.map(item => item.index)
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('drp-business/task/export', {
-        ...this.queryParams
-      }, `task_${new Date().getTime()}.xlsx`)
-    }
+    // 触发客户参照列表
+    refereCustomer() {
+      this.$refs.customerSelect.init();
+    },
+    //客户参照列表选择后
+    customerSelectionsToInput(selections) {
+      this.form.customer = selections[0].id;
+      this.form.customerName = selections[0].name;
+    },
+    // 触发联系人参照列表
+    refereContact() {
+      this.$refs.contactSelect.init();
+    },
+    //联系人参照列表选择后
+    contactSelectionsToInput(selections) {
+      this.form.linkman = selections[0].id;
+      this.form.linkmanName = selections[0].name;
+    },
+    // 触发组织参照列表
+    refereOrg() {
+      this.$refs.orgSelect.init();
+    },
+    //组织参照列表选择后
+    orgSelectionsToInput(selections) {
+      this.form.salesOrg = selections[0].deptId;
+      this.form.salesOrgName = selections[0].deptName;
+    },
+    // 触发部门参照列表
+    refereDept() {
+      this.$refs.deptSelect.init();
+    },
+    //部门参照列表选择后
+    deptSelectionsToInput(selections) {
+      this.form.dept = selections[0].deptId;
+      this.form.deptName = selections[0].deptName;
+    },
+    // 触发员工参照列表
+    refereStaff() {
+      this.$refs.staffSelect.init();
+    },
+    //员工参照列表选择后
+    staffSelectionsToInput(selections) {
+      this.form.staff = selections[0].userId;
+      this.form.staffName = selections[0].nickName;
+      this.form.dept = selections[0].deptId;
+      this.form.deptName = selections[0].deptName;
+      this.form.salesOrg = selections[0].orgId;
+      this.form.salesOrgName = selections[0].orgName;
+    },
   }
 };
 </script>

+ 31 - 9
src/views/business/spd/bo/task/taskList.vue

@@ -252,6 +252,7 @@
                 type="date"
                 value-format="yyyy-MM-dd"
                 placeholder="请选开始时间"
+                :picker-options="editStartOptions"
               >
               </el-date-picker>
             </el-form-item>
@@ -264,6 +265,7 @@
                 type="date"
                 value-format="yyyy-MM-dd"
                 placeholder="请选择截止时间"
+                :picker-options="editStopOptions"
               >
               </el-date-picker>
             </el-form-item>
@@ -341,13 +343,7 @@
           >
           </el-input>
         </el-form-item>
-        <BehaviorList
-          :key="timer"
-          :source="'TaskList'"
-          :bo="this.form"
-          :boAuthority="boAuthority"
-          v-if="this.operatingState != 'Insert'"
-        />
+        
         <div class="md-auditInfo">
           <el-divider content-position="left">其它信息</el-divider>
           <el-form :inline="true" label-position="right" :model="form">
@@ -392,6 +388,15 @@
           </el-form>
         </div>
       </el-form>
+
+      <BehaviorList
+          :key="timer"
+          :source="'TaskList'"
+          :bo="this.form"
+          :boAuthority="boAuthority"
+          v-if="this.operatingState != 'Insert'"
+        />
+        
       <div slot="footer" class="dialog-footer">
         <el-button
           type="primary"
@@ -529,10 +534,10 @@ export default {
           { required: true, message: "负责人不能为空", trigger: "blur" },
         ],
         startTime: [
-          { required: true, message: "开始时间不能为空", trigger: "blur" },
+          { required: true, message: "开始时间不能为空", trigger: ["blur", "change"] },
         ],
         deadlineTime: [
-          { required: true, message: "截止时间不能为空", trigger: "blur" },
+          { required: true, message: "截止时间不能为空", trigger: ["blur", "change"] },
         ],
         content: [
           { required: true, message: "任务内容不能为空", trigger: "blur" },
@@ -542,6 +547,23 @@ export default {
       timer: "",
       //当前操作状态
       operatingState: "",
+      editStartOptions: {
+        disabledDate: time => {
+          if (!this.form.deadlineTime) {
+            return time.getTime() < new Date(1970 - 1 - 1).getTime();   //禁止选择1970年以前的日期
+          } else {
+            return time.getTime() > new Date(this.form.deadlineTime);
+          }
+        }
+      },
+      editStopOptions: {
+        disabledDate: time => {
+          return (
+            time.getTime() < new Date(this.form.startTime) ||
+            time.getTime() < new Date(1970 - 1 - 1).getTime()    //禁止选择1970年以前的日期
+          );
+        }
+      },
     };
   },
   created() {

+ 169 - 0
src/views/marketing/dealer-authorization/authprivAdd.vue

@@ -0,0 +1,169 @@
+<!-- 经销商授权信息 编辑新增-->
+<template>
+  <el-dialog :title="isAdd ? '新增' : '编辑'" :visible.sync="visible" :close-on-click-modal="false"
+    :close-on-press-escape="false" :before-close="beforeClose" @close="$emit('close')">
+    <el-form :model="formData" ref="authprivAdd" label-position="left" label-width="120px" v-loading="loading">
+
+      <el-form-item v-for="column in formColumns" :label="column.title" :prop="column.key"
+        :rules="{ required: true, message: `请输入${column.title}`, trigger: column.type == 'Input' ? 'blur' : 'change' }">
+
+        <el-input v-if="column.type == 'Input'" :clearable="column.clearable" v-model="formData[column.key]"
+          autocomplete="off"></el-input>
+
+        <el-date-picker v-if="column.type == 'DateRange'" :clearable="column.clearable" v-model="formData[column.key]"
+          format="yyyy-MM-dd " value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期"
+          end-placeholder="结束日期"></el-date-picker>
+
+        <el-date-picker v-if="column.type == 'Date'" :clearable="column.clearable" v-model="formData[column.key]"
+          format="yyyy-MM-dd " value-format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
+
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="handleCancel">取 消</el-button>
+      <el-button type="primary" @click="handleConfirm('authprivAdd')">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import dealerApi from '@/api/marketing/dealer-authorization';
+import { FormColumns } from './column';
+import { initParams } from '../utils/init'
+
+const initFormColumns = () =>
+  FormColumns.map((column) => {
+    const clearable = column.clearable || true;
+    return {
+      ...column,
+      clearable,
+    };
+  });
+
+export default {
+
+  name: 'authprivAdd',
+
+  data() {
+
+    return {
+      visible: false,
+      isAdd: true,
+      loading: false,
+      formData: { ...initParams(initFormColumns()) },
+      formColumns: initFormColumns(),
+
+    }
+  },
+  methods: {
+    // 控制弹窗展示
+    setVisible(val) {
+      this.visible = val;
+    },
+    setFormData(data) {
+
+      if (data.id) {
+
+        this.loading = true;
+
+        this.isAdd = false;
+
+        this.formData = {
+
+          ...data,
+
+          time: [data.startTime, data.endTime]
+
+        };
+
+        setTimeout(() => {
+          this.loading = false;
+        }, 250);
+
+        return
+      }
+
+      this.isAdd = true;
+    },
+    // 重置表单数据
+    handleResetData() {
+      this.formData = {
+        ...initParams(initFormColumns())
+      }
+      this.$refs['authprivAdd'].clearValidate();
+    },
+    // 取消
+    handleCancel() {
+      this.handleResetData();
+      this.setVisible(false);
+    },
+    // 确定
+    handleConfirm(formName) {
+
+      this.$refs[formName].validate(async (valid) => {
+
+        if (valid) {
+          // 校验通过
+          let isTime = this.formData.time && this.formData.time != '' && this.formData.time.length;
+
+          const { name, id, } = this.$store.state.user;
+
+          let params = {
+            ...this.formData,
+            startTime: isTime ? this.formData.time[0] : '',
+            endTime: isTime ? this.formData.time[1] : '',
+            updatePerson: name,
+            updateTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+            ...(
+              this.isAdd ? {
+                status: '0',
+                createPerson: name,
+                createTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+              } : {}
+            )
+
+          }
+          delete params['time']
+          console.log(params, 'params--------');
+
+          try {
+            this.loading = true;
+            let { code, msg } = await (this.isAdd ?
+              dealerApi.insert(params) :
+              dealerApi.update(params))
+
+            if (code === 200) {
+              this.handleCancel();
+            }
+
+          } catch (error) {
+            console.log(error, 'error');
+          } finally {
+            this.loading = false;
+          }
+
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    beforeClose(done) {
+      this.handleResetData();
+      done();
+    },
+  },
+  created() {
+  }
+
+}
+</script>
+
+
+<style lang="scss" scoped>
+.authpriv {
+  width: calc(100% - 24px);
+  height: 100%;
+  margin: 10px
+}
+</style>

+ 74 - 0
src/views/marketing/dealer-authorization/authprivSee.vue

@@ -0,0 +1,74 @@
+<!-- 经销商授权信息-查看 -->
+<template>
+  <el-dialog title="查看" :visible.sync="visible" :close-on-click-modal="false" :close-on-press-escape="false">
+    <el-form :model="formData" label-position="left" label-width="120px">
+      <el-form-item v-for="column in formColumns" :label="column.title" :prop="column.key">
+        <el-input v-if="column.type == 'Input'" readonly v-model="formData[column.key]" autocomplete="off"></el-input>
+
+        <el-date-picker v-if="column.type == 'DateRange'" readonly v-model="formData[column.key]" type="daterange"
+          format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
+          end-placeholder="结束日期"></el-date-picker>
+
+        <el-date-picker v-if="column.type == 'Date'" readonly v-model="formData[column.key]" type="date"
+          format="yyyy-MM-dd " value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
+
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="setVisible(false)">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { FormColumns } from './column';
+import { initParams } from '../utils/init'
+export default {
+
+  name: 'authprivSee',
+  data() {
+
+    return {
+      visible: false,
+      formData: { ...initParams(FormColumns) },
+      formColumns: FormColumns,
+
+    }
+  },
+  methods: {
+    // 控制弹窗展示
+    setVisible(val) {
+
+      this.visible = val;
+
+    },
+    setFormData(data) {
+
+      if (data.id) {
+
+        let objData = { ...data };
+
+        objData['time'] = [objData.startTime, objData.endTime];
+
+        // delete data.startTime
+        // delete data.endTime
+        this.formData = objData;
+
+      }
+
+    },
+  },
+  created() {
+  }
+
+}
+</script>
+
+
+<style lang="scss" scoped>
+.authpriv {
+  width: calc(100% - 24px);
+  height: 100%;
+  margin: 10px
+}
+</style>

+ 56 - 0
src/views/marketing/dealer-authorization/column.js

@@ -0,0 +1,56 @@
+export const TableColumns = [
+  { key: "authorizedProductsCode", title: "授权产品 编码", show: true, width: 160 },
+  { key: "dealerName", title: "经销商名称", show: true, width: 200 },
+  { key: "authorizedAreaCode", title: "授权区域/医院 编码", show: false, },
+  { key: "authorizedAreaName", title: "授权区域/医院 名称", show: true, width: 200 },
+  { key: "authorizedProductsName", title: "授权产品 名称", show: true, width: 200 },
+  { key: "status", title: "状态", show: true },
+  { key: "createPerson", title: "创建人", show: true },
+  { key: "createTime", title: "创建时间", show: true, width: 160 },
+  { key: "updatePerson", title: "最后修改人", show: true },
+  { key: "updateTime", title: "最后修改时间", show: true, width: 160 },
+  { key: "id", title: "主键id----该值不显示", show: false },
+  { key: "startTime", title: "开始时间", show: false },
+  { key: "endTime", title: "结束时间", show: false },
+  { key: "issueTime", title: "授权书开具时间", show: false },
+]
+
+export const SearchColumns = [
+  { key: "dealerName", title: "经销商名称", type: "Input" },
+  { key: "authorizedAreaName", title: "授权区域/医院", type: "Input" },
+  { key: "authorizedProductsName", title: "授权产品", type: "Input" },
+  // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
+  {
+    key: "status", title: "状态", type: "Select", options: [
+      { value: 0, label: '自由态' },
+      { value: 1, label: '审批中' },
+      { value: 2, label: '已审核' },
+      { value: 3, label: '已驳回' },
+    ]
+  },
+  // { title: "授权时间", key: "time", type: "DateRange" },
+  {
+    title: "授权时间",
+    key: "startTime",
+    type: "Date",
+    config: {
+      placeholder: '开始时间'
+    }
+  },
+  {
+    title: "至",
+    key: "endTime",
+    type: "Date",
+    config: {
+      placeholder: '结束时间'
+    }
+  },
+]
+
+export const FormColumns = [
+  { title: '经销商名称', key: 'dealerName', type: 'Input' },
+  { title: '授权区/医院', key: 'authorizedAreaName', type: 'Input' },
+  { title: '授权产品', key: 'authorizedProductsName', type: 'Input' },
+  { title: '授权期限', key: 'time', type: 'DateRange' },
+  { title: '授权书开具时间', key: 'issueTime', type: 'Date' },
+]

+ 290 - 0
src/views/marketing/dealer-authorization/index.vue

@@ -0,0 +1,290 @@
+<!-- 经销商授权信息管理--列表 -->
+<template>
+  <el-card class="dealerAuthorization" v-loading="loading" :body-style="{ padding: 0 }">
+
+    <authprivAdd ref="addDialogRef" @close="handleRefresh"></authprivAdd>
+    <authprivSee ref="seeDialogRef"></authprivSee>
+
+    <!-- 检索区 -->
+    <el-form :inline="true" size="mini" label-position="right" label-width="100px" :model="searchParams"
+      style="padding: 10px 0 0 0">
+
+      <el-form-item v-for="column in searchColumns " :label="column.title" :key="column.key">
+
+        <el-input v-if="column.type == 'Input'" v-model="searchParams[column.key]" clearable></el-input>
+
+        <el-select v-else-if="column.type == 'Select'" v-model="searchParams[column.key]" clearable>
+          <el-option v-for="op in column.options" :label="op.label" :value="op.value"></el-option>
+        </el-select>
+
+        <el-date-picker v-else-if="column.type == 'DateRange'" v-model="searchParams[column.key]" clearable
+          type="daterange" format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+
+        <el-date-picker v-else-if="column.type == 'Date'" v-model="searchParams[column.key]" format="yyyy-MM-dd "
+          clearable value-format="yyyy-MM-dd" type="date" :placeholder="column.config.placeholder" style="width: 192px;">
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handelSearch"
+          v-hasPermi="['pu:authorization:list']">查询</el-button>
+        <el-button icon="el-icon-refresh" @click="handelResetSearch">重置</el-button>
+      </el-form-item>
+
+    </el-form>
+
+    <!-- 操作区 -->
+    <el-row :gutter="24" style="padding: 0 10px">
+      <el-col :span="24" style="text-align: right">
+        <el-button size="mini" type="primary" @click="handleOpenAddDialog"
+          v-hasPermi="['pu:authorization:add']">新增</el-button>
+        <!-- <el-button size="mini" @click="handleSubmit">提交</el-button> -->
+        <el-button size="mini" @click="handleDownload">下载授权书</el-button>
+      </el-col>
+    </el-row>
+
+    <!-- 数据展示 -->
+    <el-table class="da-table" @row-dblclick="handleOpenSeeDialog" @select="handleSelect" :data="tableData"
+      highlight-current-row max-height="500">
+      <el-table-column type="selection" width="45"></el-table-column>
+      <el-table-column type="index" width="55" label="序号"></el-table-column>
+      <el-table-column v-for="column in tableColumns" :label="column.title" v-if="column.show"
+        :width="column.width || 120" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ column.key == 'status' ? judgeStatus(scope.row[column.key]) : scope.row[column.key] }}
+        </template>
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" width="120">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="handleOpenAddDialog(scope.row)"
+            v-hasPermi="['pu:authorization:edit']">编辑</el-button>
+          <el-button type="text" size="mini" @click="handleDelDialog(scope.row)"
+            v-if="scope.row.status == '0' || scope.row.status == '3'"
+            v-hasPermi="['pu:authorization:remove']">删除</el-button>
+          <!-- <el-button @click="handleOpenSeeDialog(scope.row)" type="text" size="small">查看</el-button> -->
+          <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'"
+            @click="handleSubmit(scope.row)">提交</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
+      :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
+      :layout="layout">
+    </el-pagination>
+
+  </el-card>
+</template>
+
+<script>
+import dealerApi from '@/api/marketing/dealer-authorization';
+import { TableColumns, SearchColumns } from './column';
+import { initParams } from '../utils/init';
+
+export default {
+
+  name: 'dealerAuthorization',
+  components: {
+    authprivAdd: () => import('./authprivAdd.vue'),
+    authprivSee: () => import('./authprivSee.vue'),
+  },
+
+  data() {
+
+    return {
+      loading: false,
+      searchColumns: SearchColumns,
+      searchParams: {
+        ...initParams(SearchColumns),
+      },
+      tableColumns: TableColumns,
+      tableData: [],
+      checkedList: [],
+      page: {
+        pageNum: 1,
+        pageSize: 25,
+        total: 0
+      },
+      pageSizes: [10, 20, 50, 100],
+      layout: 'total, prev, pager, next, sizes, jumper',
+    }
+  },
+  methods: {
+    // 查询---列表查询
+    async handelSearch() {
+      this.loading = true;
+      console.log(this.searchParams, '查询');
+      // let isTime = this.searchParams.time && this.searchParams.time != '' && this.searchParams.time.length;
+      let { pageNum, pageSize } = this.page;
+      let params = {
+        ...this.searchParams,
+        // startTime: isTime ? this.searchParams.time[0] : '',
+        // endTime: isTime ? this.searchParams.time[1] : '',
+        pageNum: pageNum,
+        pageSize: pageSize,
+      }
+      delete params['time']
+      console.log(params, 'params--------');
+
+      await dealerApi.list(params).then(res => {
+        console.log(res, '获取列表');
+        let { code, rows, total } = res;
+        this.loading = false;
+        if (code == 200) {
+          this.tableData = rows;
+          this.page.total = total;
+        }
+      }).catch(error => {
+        this.loading = false;
+      })
+    },
+    // 重置
+    handelResetSearch() {
+
+      console.log('重置');
+      this.searchParams = {
+        ...initParams(SearchColumns),
+      }
+    },
+    // 判断状态
+    judgeStatus(status) {
+      // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
+      let statusName = '';
+      switch (status) {
+        case '0':
+          statusName = '自由态';
+          break;
+        case '1':
+          statusName = '审批中';
+          break;
+        case '2':
+          statusName = '已审核';
+          break;
+        case '3':
+          statusName = '已驳回';
+          break;
+        default:
+          break;
+      }
+
+      return statusName;
+    },
+    // 刷新
+    handleRefresh() {
+      this.handelSearch();
+    },
+    handleSizeChange(e) {
+      this.page.pageSize = e;
+      this.handelSearch();
+    },
+    handleCurrentChange(e) {
+      this.page.pageNum = e;
+      this.handelSearch();
+    },
+
+    // 选择列表
+    handleSelect(selection, row) {
+      console.log('selection/////////', selection, 'row/////////', row);
+      this.checkedList = [...selection];
+    },
+    // 新增、编辑授权信息
+    handleOpenAddDialog(rows) {
+      const { setVisible, setFormData } = this.$refs.addDialogRef;
+      setFormData(rows);
+      setVisible(true);
+
+    },
+    // 查看
+    handleOpenSeeDialog(rows) {
+      const { setVisible, setFormData } = this.$refs.seeDialogRef;
+      setFormData(rows);
+      setVisible(true);
+    },
+    // 删除
+    handleDelDialog(rows) {
+      let { id } = rows;
+
+      this.$confirm('此操作将删除该条数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          this.loading = true;
+          let { code, msg } = await dealerApi.remove({ id });
+          if (code == 200) {
+            this.handleRefresh();
+          }
+        } catch (error) {
+          console.log(error);
+        } finally {
+          this.loading = false;
+        }
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+
+    },
+    // 提交
+    handleSubmit(row) {
+
+      console.log(row, '提交');
+      let params = {
+        id: '',
+        status: ''
+      }
+      // try {
+      //   this.loading = true;
+      //   let { code, msg } = await dealerApi.submitOA();
+      //   if (code == 200) {
+      //     this.handleRefresh();
+      //   }
+      // } catch (error) {
+      //   console.log(error);
+      // } finally {
+      //   this.loading = false;
+
+      // }
+
+
+
+    },
+    // 下载
+    handleDownload() {
+      console.log('下载');
+      // try {
+      //   let { code, msg } = await dealerApi.download();
+      //   if (code == 200) {
+      //   }
+      // } catch (error) {
+      //   console.log(error);
+      // } finally {}
+    },
+
+  },
+  created() {
+    this.handelSearch();
+  }
+
+}
+</script>
+
+<style lang="scss" scoped>
+.dealerAuthorization {
+  width: calc(100% - 24px);
+  height: 100%;
+  margin: 10px;
+  padding: 10px;
+  box-sizing: border-box;
+
+  .da-table {
+    width: 100%;
+    margin: 20px 0 0 0;
+  }
+}
+</style>

+ 22 - 0
src/views/marketing/utils/date.js

@@ -0,0 +1,22 @@
+// 对Date的扩展,将 Date 转化为指定格式的String
+// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, 
+// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) 
+// 例子: 
+// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 
+// (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18 
+
+Date.prototype.Format = function (fmt) {
+  var o = {
+      "M+": this.getMonth() + 1, //月份 
+      "d+": this.getDate(), //日 
+      "H+": this.getHours(), //小时 
+      "m+": this.getMinutes(), //分 
+      "s+": this.getSeconds(), //秒 
+      "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
+      "S": this.getMilliseconds() //毫秒 
+  };
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+  for (var k in o)
+  if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+  return fmt;
+}

+ 11 - 0
src/views/marketing/utils/init.js

@@ -0,0 +1,11 @@
+export  const arr2Obj = function (data, keyName, valueName) {
+  return Object.fromEntries(
+    data.map((item) => [item[keyName], item[valueName]])
+  );
+};
+
+export const initParams = (params) =>{
+
+  return arr2Obj(params, "key", "value")
+
+}

+ 70 - 36
src/views/material/basicFile/details.vue

@@ -71,7 +71,7 @@
       <el-col :span="1.5">
         <el-button-group>
           <el-button size="small" @click="handleOtherEdit">修改</el-button>
-          <el-button size="small" @click="handleOtherDel">删除</el-button>
+          <el-button size="small" v-show="activeMainTab != 'material_finance'" @click="handleOtherDel">删除</el-button>
         </el-button-group>
         <el-button-group>
           <el-button size="small" @click="handleOtherListRefresh">刷新</el-button>
@@ -88,8 +88,7 @@
         </el-col>
         <el-col :span="6" style="text-align: right;">
           <!-- 附件管理 -->
-          <!-- <el-button-group>
-                                                                                                                                                      <el-button size="small" icon="el-icon-paperclip" @click="handleFile"></el-button></el-button-group> -->
+          <!-- <el-button-group> <el-button size="small" icon="el-icon-paperclip" @click="handleFile"></el-button></el-button-group> -->
 
           <!-- 切换 -->
           <!-- <el-button-group>
@@ -100,7 +99,7 @@
             <el-button size="small" icon="el-icon-arrow-right" :disabled="!handleBasicEdit"
               @click="handleChangePage('next')" />
             <el-button size="small" icon="el-icon-d-arrow-right" :disabled="!handleBasicEdit"
-                                                                                                                                                    @click="handleChangePage('end')" /></el-button-group> -->
+            @click="handleChangePage('end')" /></el-button-group> -->
         </el-col>
       </el-row>
 
@@ -213,7 +212,7 @@
                 <el-table v-else :data="mainMsg.value" @cell-dblclick="handleMaindbClick"
                   @selection-change="handleMainChange">
                   <el-table-column type="selection" width="55" />
-                  <el-table-column type="index" label="序号" width="55" align="center" />
+                  <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center" />
                   <el-table-column v-for="m in  mainMsg.form" v-if="m.show" :label="m.name" align="center"
                     :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop" show-overflow-tooltip>
                     <template slot-scope="scope">
@@ -303,7 +302,7 @@
                     <!-- 辅计量 -->
                     <el-table v-else-if="activeViceTab == 'material_unit'" :data="unitDetails.value"
                       class="material-table">
-                      <el-table-column type="index" label="序号" width="55" align="center" />
+                      <el-table-column type="index" v-if="unitDetails.form.length" label="序号" width="55" align="center" />
                       <el-table-column v-for="v in  unitDetails.form" v-if="v.show" :label="v.name" align="center"
                         :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
                         <template slot-scope="scope">
@@ -319,7 +318,8 @@
                     <!-- 辅助属性 -->
                     <el-table v-else-if="activeViceTab == 'material_property'" :data="propertyDetail.value"
                       class="material-table">
-                      <el-table-column type="index" label="序号" width="55" align="center" />
+                      <el-table-column type="index" v-if="propertyDetail.form.length" label="序号" width="55"
+                        align="center" />
                       <el-table-column v-for="v in  propertyDetail.form" v-if="v.show" :label="v.name" align="center"
                         :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
                         <template slot-scope="scope">
@@ -388,7 +388,7 @@
       </el-row>
       <!-- 表格数据 -->
       <el-table :data="materialType.value" stripe style="width: 100%" max-height="350" v-loading="materialType.loading"
-        :key="count" @selection-change="handleSelectionType">
+        :key="refer" @selection-change="handleSelectionType">
         <el-table-column type="selection" width="30" />
         <el-table-column type="index" width="50" label="序号" />
         <el-table-column v-for="mt in materialType.form" v-if="mt.show" :label="mt.name" width="180">
@@ -409,8 +409,7 @@
             <!-- <el-select size="small" v-else-if="mt.attribute == 'select' && mt.dictId"  placeholder="请选择"
               :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]" :key="scope.row[mt.prop]">
               <el-option v-if="mt.dictId" v-for="d in mt.dictId" :key="d.dictValue" :label="d.dictLabel"
-                :value="d.dictValue">
-                                                                                                                                                                  </el-option></el-select> -->
+                :value="d.dictValue"></el-option></el-select> -->
 
             <!-- 其他类型 -->
             <el-input v-else size="small" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)" />
@@ -476,7 +475,8 @@
             <div class="od-msg">
 
               <!-- 展示表单 -->
-              <el-form :inline="true" label-position="right" :hide-required-asterisk="true" :model="otherDeatils.value">
+              <el-form :inline="true" label-position="right" :key="refer" :hide-required-asterisk="true"
+                :model="otherDeatils.value">
 
                 <el-row :gutter="10">
                   <el-col :span="8" v-for="f in otherDeatils.form" style="text-align: right;">
@@ -499,7 +499,7 @@
                         </el-select>
 
                         <!-- 字典-下拉 -->
-                        <el-select v-if="f.dictId" v-model="otherDeatils.value[`${f.prop}Name`]" placeholder="请选择"
+                        <el-select v-if="f.dictId" v-model="otherDeatils.value[f.prop]" placeholder="请选择"
                           :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)">
                           <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
                             :value="d.dictValue">
@@ -556,7 +556,7 @@
 
     <!-- 参照弹窗 -->
     <el-dialog :title="MoreDataDialog.msg.name" :visible.sync="MoreDataDialog.show" width="70%" class="MoreDataDialog"
-      :key="count" :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
+      :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
       <div>
         <el-row>
           <el-col :span="1.5">
@@ -565,7 +565,7 @@
         </el-row>
         <!-- 树形 -->
         <el-tree class="referTree" v-loading="MoreDataDialog.loading" v-if="MoreDataDialog.type == 'tree'"
-          :data="MoreDataDialog.list" @node-click="handleNodeClick"
+          :data="MoreDataDialog.list" @node-click="handleNodeClick" :key="refer"
           :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps" node-key="id">
         </el-tree>
         <!-- queryMedcineItemDrug -->
@@ -610,6 +610,7 @@ export default {
   data() {
     return {
       count: 1,
+      refer: 1,
       loading: false,
       // 维护新版本
       maintainNewVersion: false,
@@ -735,7 +736,7 @@ export default {
         pageNum: 1,
         total: 0,
         pageSize: 10,
-      }
+      },
     }
   },
 
@@ -761,13 +762,14 @@ export default {
 
         return !(this.updateButtonGroup && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
       }
+      // 效期管理(expiryDateManagerment):控制一下几个是否可编辑
+      // expiryUnitId 效期单位  usefulLife 有效期 usefulLifeUnitId 有效期至单位  "recentWarningPeriod" 近效期预警天数
+
       else if (attribute.prop == 'expiryUnitId'
         || attribute.prop == 'usefulLife'
         || attribute.prop == 'usefulLifeUnitId'
         || attribute.prop == 'recentWarningPeriod'
       ) {
-        // 效期管理(expiryDateManagerment):控制一下几个是否可编辑
-        // expiryUnitId 效期单位  usefulLife 有效期 usefulLifeUnitId 有效期至单位  "recentWarningPeriod" 近效期预警天数
         if (this.basicData.value['expiryDateManagerment'] == '2') {
 
           this.basicData.value['expiryUnitId'] = '';
@@ -777,7 +779,12 @@ export default {
         }
 
         return !(this.updateButtonGroup && attribute.edit && this.basicData.value['expiryDateManagerment'] == '0');
-      } else {
+      }
+      // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
+      else if (attribute.prop == 'businessDepartment') {
+        return !(this.updateButtonGroup && attribute.edit && this.basicData.value['purchasingOrganization']);
+      }
+      else {
         // 其他属性是否可编辑
         return !(this.updateButtonGroup && attribute.edit);
       }
@@ -916,7 +923,8 @@ export default {
           _this.MoreDataDialog.list = data.tableBody;
           _this.MoreDataDialog.form = data.tableHeader;
         }
-        this.count++;
+        this.refer++;
+        // this.count++;s
         console.log(_this.MoreDataDialog.list, 'this.MoreDataDialog.list');
         console.log(_this.MoreDataDialog.form, 'this.MoreDataDialog.form');
 
@@ -934,13 +942,21 @@ export default {
       this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
     },
     // 根据apiUrl获取对应参照的值
-    getExecuteMethods(methodName, params, cb) {
+    getExecuteMethods(methodName, param, cb) {
 
       let page = {
         pageSize: this.queryParams.pageSize,
         pageNum: this.queryParams.pageNum,
       }
 
+      let params = { ...param };
+      // 业务部门需要  依据默认采购组组织查询
+      if (methodName == "queryOperatingDepptTree") {
+
+        params['puOrgId'] = this.basicData.value['purchasingOrganization']
+
+      }
+
       materialApi.executeMethods(methodName, params, page).then(res => {
         this.MoreDataDialog.loading = false;
         if (res.code == 200) {
@@ -1784,24 +1800,25 @@ export default {
         //  基本信息
         this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        // this.basicData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
         this.basicData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
         console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
 
         console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}`], '值', this.basicData.value[`${this.MoreDataDialog.target.prop}Name`], '//////////基本信息///////////');
+        // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
+        if (this.MoreDataDialog.target.prop == 'purchasingOrganization') {
+
+          this.basicData.value['businessDepartment'] = '';
+          this.basicData.value['businessDepartmentName'] = '';
+
+        }
+
 
       } else if (this.MoreDataDialog.target.name == 'medcineData') {
-        // console.log('this.MoreDataDialog.value', this.MoreDataDialog.value, this.MoreDataDialog.target.prop, this.medcineData);
-        // if (this.MoreDataDialog.target.prop === 'dosageFrom')
-        //   this.medcineData.form = this.medcineData.form.map((item) => {
-        //     if (item.prop === "dosageFrom") item.dictValue = [{ dictLabel: this.MoreDataDialog.value.name, dictValue: this.MoreDataDialog.value.id }]
-        //     return item
-        //   })
+
         //  医药信息
         this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        // this.medcineData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
         this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
         console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
@@ -1813,7 +1830,6 @@ export default {
         //  其他页签
         this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        // this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
         this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
         console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`], '/////////其他页签///////');
@@ -1848,10 +1864,11 @@ export default {
       }
 
       if (confirm) {
-
-        this.count++;
+        // this.count++;
+        this.refer++;
         this.MoreDataDialog.show = false;
         this.MoreDataDialog.key = '';
+        this.MoreDataDialog.value = {};
       }
     },
     // 取消-关闭参照弹窗
@@ -1871,24 +1888,36 @@ export default {
     handledDelCenter(ids) {
       console.log('删除利润中心信息');
       materialApi.delCenter(ids).then(res => {
+        if (res.code == 200) {
+          this.handleOtherListRefresh();
+        }
       })
     },
     // 删除库存信息
     handleDelInventory(ids) {
       console.log('删除库存信息');
       materialApi.delInventory(ids).then(res => {
+        if (res.code == 200) {
+          this.handleOtherListRefresh();
+        }
       })
     },
     // 删除成本信息
     handleDelCost(ids) {
       console.log('删除成本信息');
       materialApi.delCost(ids).then(res => {
+        if (res.code == 200) {
+          this.handleOtherListRefresh();
+        }
       })
     },
     // 删除计划信息
     handleDelPlan(ids) {
       console.log('删除计划信息');
       materialApi.delPlan(ids).then(res => {
+        if (res.code == 200) {
+          this.handleOtherListRefresh();
+        }
 
       })
     },
@@ -1896,17 +1925,18 @@ export default {
     handleDelFinance(ids) {
       console.log('删除财物信息');
       materialApi.delFinance(ids).then(res => {
-
-        // if(res.code == 200){
-        //   this.handleOtherRefresh();
-        // }
+        if (res.code == 200) {
+          this.handleOtherListRefresh();
+        }
       })
     },
     // 删除采购信息
     handledelPurchase(ids) {
       console.log('删除采购信息');
       materialApi.delPurchase(ids).then(res => {
-
+        if (res.code == 200) {
+          this.handleOtherListRefresh();
+        }
       });
     },
 
@@ -2292,6 +2322,10 @@ export default {
   overflow-x: auto;
 }
 
+>>>.referTree {
+  margin-top: 10px;
+}
+
 /* .md-main>>>.el-table .el-table__body {
   height: calc(100vh - 300px);
 } */

+ 11 - 6
src/views/material/basicFile/index.vue

@@ -128,16 +128,14 @@
     </el-dialog>
 
     <!-- 导入弹窗 -->
-    <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center @before-close="handlefileDialogColse">
+    <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center :before-close="handlefileDialogColse">
       <div class="mb-import">
-
         <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
           :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
-          <el-button slot="trigger" type="primary">选取文件</el-button>
-          <!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="handleSubmitUpload">上传到服务器</el-button> -->
+          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          <el-button style="margin-left: 10px;" size="small" type="success" @click="handleDownTemplate">下载模板</el-button>
           <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
         </el-upload>
-        <el-button type="success" @click="handleDownTemplate">下载模板</el-button>
 
       </div>
       <span slot="footer">
@@ -342,7 +340,14 @@ export default {
 
             formData.append('file', this.importData.list[0].raw);
             materialApi.fileImport(formData).then(res => {
-              if (res.code == 200) this.importData.show = false;
+              if (res.code == 200) {
+                this.importData.show = false;
+                this.importData.list = [];
+              }
+              this.$message({
+                message: res.msg,
+                type: res.code == 200 ? 'success' : 'warning'
+              });
             })
           } else {
             this.$message({

+ 1 - 1
src/views/material/config/detailsTabs.js

@@ -6,7 +6,7 @@ const detailsTabs = [
     isShow: true,
   },
   {
-    label: '财信息',
+    label: '财信息',
     code: 'material_finance',
     isShow: true,
   },

+ 6 - 4
src/views/material/requisition/add.vue

@@ -1440,10 +1440,12 @@ export default {
     // 选择默认采购组织
     acceptOrgs(selections) {
       console.log('接收的采购组织', selections)
-      this.basicForm.purchasingOrganization = selections.id
+      this.basicForm.purchasingOrganization = selections.id;
       // 控制业务部门是否可以选择
       this.orgControl = false
       this.getOrgDetails(selections.id)
+      this.basicForm.businessDepartment = '';
+      this.departOptions = [];
     },
     // 默认采购组织显示列表
     chooseOrganizations() {
@@ -1509,10 +1511,10 @@ export default {
     //内包装单位回显
     getInnerPackingUnitDetails(id) {
       getUnit({ id: id }).then(res => {
-        console.log('计量单位回显', res)
+        console.log('内包装单位回显', res)
         if (res.code === 200) {
-          this.innerPackingUnit = res.data.tableBody
-          console.log('1111', this.innerPackingUnit)
+          this.innerPackingUnitOptions = res.data.tableBody
+          console.log('1111', this.innerPackingUnitOptions)
         }
       })
     },

+ 7 - 0
src/views/monitor/job/log.vue

@@ -145,6 +145,13 @@
         align="center"
         prop="nickName"
       />
+ <el-table-column
+        label="任务员工编号"
+        width="80"
+        align="center"
+        prop="enpno"
+      />
+
       <el-table-column
         label="任务大类"
         width="80"

+ 2 - 0
src/views/purchase/DemandSummary/index.vue

@@ -274,6 +274,8 @@
           <el-table-column label="单位" align="center" prop="unit"/>
           <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
           <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
+          <el-table-column label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
+          <el-table-column label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
           <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
           <el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
           <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>

+ 49 - 86
src/views/purchase/MaterialClassDivision/add.vue

@@ -124,12 +124,12 @@
                     style="width: 200px"
                     :disabled="disable"
                     clearable
-                    @focus="chooseOrganizations"
+                    @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
                   >
                     <el-option
                       v-for="item in organizationsOptions"
                       :key="item.id"
-                      :label="item.label"
+                      :label="item.name"
                       :value="item.id"
                     />
                 </el-select>
@@ -145,7 +145,7 @@
                   :disabled="disable"
                   v-model="basicForm.orderPersonal"
                   clearable
-                  @focus="chooseStaff"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
                 >
                   <el-option
                     v-for="item in staffOptions"
@@ -177,7 +177,7 @@
                   :disabled="disable"
                   v-model="basicForm.buyer"
                   clearable
-                  @focus="chooseStaff2"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
                 >
                   <el-option
                     v-for="item in staff2Options"
@@ -249,23 +249,8 @@
       :single="true"
     />
 
-    <orgs
-      ref="orgs"
-      @doSubmit="acceptOrgs"
-      :single="true"
-    />
-
-    <staff
-      ref="staff"
-      @doSubmit="acceptStaff"
-      :single="true"
-    />
+    <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
 
-    <staff2
-      ref="staff2"
-      @doSubmit="acceptStaff2"
-      :single="true"
-    />
   </div>
 </template>
 
@@ -278,19 +263,16 @@ import { getDetail } from '@/api/classify/basic';
 // 物料编码
 import popDialog from '@/components/PopDialog/index.vue'
 // 公用一个树形(组织部门传值不同)
-import orgs from '@/components/PopDialog/organization.vue'
-import staff from '@/components/PopDialog/staff.vue'
-import staff2 from '@/components/PopDialog/staff.vue'
-// 所属组织,订单员用于回显
-import { getOrgs, getStaff} from '@/api/requisition/basic'
+import Refers from '@/components/Refers/refers.vue'
+// 用于回显参照框数据
+import { getRefer } from '@/api/purchase/basic.js'
+
 export default {
   name: 'addDivision',
   components: {
     fourClass,
     popDialog,
-    orgs,
-    staff,
-    staff2
+    Refers,
   },
   props: ['pageStu','row', 'disable'],
   model: {
@@ -327,6 +309,11 @@ export default {
       options: [{
         value: 0, label: '仓库1'
       }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       organizationsOptions: [],
       staffOptions: [],
       staff2Options: [],
@@ -362,7 +349,7 @@ export default {
       this.$emit('jugislist', true)
       let queryParams = {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.$emit('refresh', queryParams)
     },
@@ -371,9 +358,9 @@ export default {
       getDivisions(row.id).then(res => {
         if (res.code === 200) {
           this.basicForm = res.data
-          this.getOrgDetails(res.data.org)
-          this.getStaffDetails(res.data.orderPersonal)
-          this.getStaffDetails2(res.data.buyer)
+          if (this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
+          if (this.basicForm.orderPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.orderPersonal, '订单员') }
+          if (this.basicForm.buyer) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.buyer, '采购员') }
         }
       })
     },
@@ -401,7 +388,6 @@ export default {
     },
     selectionsToInput (selections) {
       console.log('父组件拿到的:', selections)
-      this.selectData = selections
       this.basicForm.material = selections[0].id
       this.basicForm.materialCode = selections[0].code
       this.basicForm.materialName = selections[0].name
@@ -412,63 +398,40 @@ export default {
       this.$refs.contractSelect.init()
     },
     // 选择默认采购组织
-    acceptOrgs (selections) {
-      console.log('接收的采购组织', selections)
-      this.basicForm.org = selections.id
-      this.getOrgDetails(selections.id)
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
     },
-    // 默认采购组织显示列表
-    chooseOrganizations () {
-      this.$refs.organizations.blur()
-      this.$refs.orgs.init('1')
+    selectionsRefer(selection) {
+      if (this.referCondition.title == '选择所属组织') {
+        this.organizationsOptions = selection
+        this.basicForm.org = selection[0].id
+        this.basicForm.orgName = selection[0].name
+      }
+      if (this.referCondition.title == '订单员') {
+        this.staffOptions = selection
+        this.basicForm.orderPersonal = selection[0].code
+        this.basicForm.orderPersonalName = selection[0].name
+      }
+      if (this.referCondition.title == '采购员') {
+        this.staff2Options = selection
+        this.basicForm.buyer = selection[0].code
+        this.basicForm.buyerName = selection[0].name
+      }
     },
-    // 采购组织回显
-    getOrgDetails(id) {
-      getOrgs({deptId: id}).then(res => {
-        if (res.code === 200) {
-          this.organizationsOptions = res.data
+    // 回显参照框 加title解决判断重复提交问题
+    reBackRefer(type, id, title) {
+      getRefer({ type: type, id: id, title: title }).then(res => {
+        if (type == 'ORG_PARAM') {
+          this.organizationsOptions = res.rows
         }
-      })
-    },
-    // 选择订单员
-    acceptStaff (selections) {
-      this.staffOptions = selections
-      this.basicForm.orderPersonal = selections[0].code
-      this.basicForm.orderPersonalName = selections[0].name
-      this.getStaffDetails(selections[0].id)
-    },
-    // 订单员显示列表
-    chooseStaff () {
-      this.$refs.staffs.blur()
-      this.$refs.staff.init()
-    },
-    // 订单员回显
-    getStaffDetails(id) {
-      getStaff({id:id}).then(res => {
-        console.log('订单员', res)
-        if (res.code === 200 ) {
-          this.staffOptions = res.data.tableBody
+        if (type == 'CONTACTS_PARAM' && title == '订单员') {
+          this.staffOptions = res.rows
         }
-      })
-    },
-    // 选择采购员
-    acceptStaff2 (selections) {
-      this.staff2Options = selections
-      this.basicForm.buyer = selections[0].code
-      this.basicForm.buyerName = selections[0].name
-      this.getStaffDetails2(selections[0].id)
-    },
-    // 采购员显示列表
-    chooseStaff2 () {
-      this.$refs.staffs2.blur()
-      this.$refs.staff2.init()
-    },
-    // 采购员回显
-    getStaffDetails2(id) {
-      getStaff({id:id}).then(res => {
-        console.log('采购员', res)
-        if (res.code === 200 ) {
-          this.staff2Options = res.data.tableBody
+        if (type == 'CONTACTS_PARAM' && title == '采购员') {
+          this.staff2Options = res.rows
         }
       })
     },

+ 173 - 99
src/views/purchase/MaterialClassDivision/index.vue

@@ -5,56 +5,48 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料一级大类编码">
-              <el-select v-model="queryParams.materialClassifyOne" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyOne"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料一级大类名称">
-              <el-select v-model="queryParams.materialClassifyOneName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyOneName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料二级大类编码">
-              <el-select v-model="queryParams.materialClassifyTwo" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyTwo"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料二级大类名称">
-              <el-select v-model="queryParams.materialClassifyTwoName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyTwoName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain>搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+              <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+              <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -64,50 +56,39 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料三级大类编码">
-              <el-select v-model="queryParams.materialClassifyThree" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyThree"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料三级大类名称">
-              <el-select v-model="queryParams.materialClassifyThreeName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyThreeName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料四级大类编码">
-              <el-select v-model="queryParams.materialClassifyFour" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input size="small" style="width: 200px" readonly v-model="queryParams.materialClassifyFour">
+                <el-button slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料四级大类名称">
-              <el-select v-model="queryParams.materialClassifyFourName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyFourName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
         </el-row>
@@ -115,49 +96,56 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料编码">
-              <el-select v-model="queryParams.material" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input style="width: 200px" size="small" readonly v-model="queryParams.material">
+                  <el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料名称">
-              <el-select v-model="queryParams.materialName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="订单员">
-              <el-select v-model="queryParams.orderPersonal" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                  ref="staffs"
+                  size="small"
+                  style="width: 200px"
+                  v-model="queryParams.orderPersonal"
+                  clearable
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
+                >
+                  <el-option
+                    v-for="item in staffOptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="采购员">
-              <el-select v-model="queryParams.buyer" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                  ref="staffs2"
+                  size="small"
+                  style="width: 200px"
+                  v-model="queryParams.buyer"
+                  clearable
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
+                >
+                  <el-option
+                    v-for="item in staff2Options"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  />
               </el-select>
             </el-form-item>
           </el-col>
@@ -235,7 +223,7 @@
           <el-table-column label="物料编码" align="center" width="150" prop="material" />
           <el-table-column label="物料名称" align="center" prop="materialName" />
           <el-table-column label="生产厂商" align="center" width="150" prop="manufacturer" />
-          <el-table-column label="所属组织" align="center" width="120" prop="orgName" />
+          <el-table-column label="所属组织" align="center" width="120" prop="orgName"/>
           <el-table-column label="订单员" align="center" width="150" prop="orderPersonalName" />
           <el-table-column label="采购员" align="center" width="150" prop="buyerName" />
           <el-table-column label="订单部门" align="center" width="150" prop="orderDeptName" />
@@ -271,6 +259,20 @@
     </div>
 
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+  
+    <fourClass
+      ref="fourClass"
+      @doSubmit="acceptFourClass"
+      :single="true"
+    />
+
+    <popDialog
+      ref="contractSelect"
+      @doSubmit="selectionsToInput"
+      :single="true"
+    />
+
+    <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
   </div>
 </template>
 
@@ -278,11 +280,19 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getDivisionList, delDivision} from '@/api/purchase/basic.js'
+// 物料分类
+import fourClass from '@/components/PopDialog/fourClass.vue'
+// 物料编码
+import popDialog from '@/components/PopDialog/index.vue'
+import Refers from '@/components/Refers/refers.vue'
 export default {
   name: 'MaterialClassDivision',
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    fourClass,
+    popDialog,
+    Refers
   },
   data() {
     return {
@@ -307,11 +317,18 @@ export default {
         manufacturer: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
       options: [{
         value: 0, label: '仓库1'
       }],
+      staffOptions: [],
+      staff2Options: [],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -330,6 +347,30 @@ export default {
         }
       })
     },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        materialClassifyOne: '',
+        materialClassifyOneName: '',
+        materialClassifyTwo: '',
+        materialClassifyTwoName: '',
+        materialClassifyThree: '',
+        materialClassifyThreeName: '',
+        materialClassifyFour: '',
+        materialClassifyFourName: '',
+        material: '',
+        materialName: '',
+        orderPersonal: '',
+        buyer: '',
+        manufacturer: '',
+        remark: '',
+        pageNum: 1,
+        pageSize: 5
+      }
+      this.getList(this.queryParams)
+    },
     handleSelectionChange() {},
     handleCommand(command) {
       alert(command)
@@ -374,6 +415,39 @@ export default {
     },
     drop() {
       this.expanded = !this.expanded
+    },
+    // 物料分类显示列表
+    chooseFourClass() {
+      this.$refs.fourClass.init()
+    },
+    // 选择物料分类
+    acceptFourClass(selections) {
+      console.log('收到的四级分类', selections)
+      this.queryParams.materialClassifyFour = selections.code
+    },
+    // 显示物料编码列表
+    test01() {
+      this.$refs.contractSelect.init()
+    },
+    selectionsToInput(selections) {
+      this.queryParams.material = selections[0].code
+    },
+    // 选择默认采购组织
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsRefer(selection) {
+      if (this.referCondition.title == '订单员') {
+        this.staffOptions = selection
+        this.queryParams.orderPersonal = selection[0].code
+      }
+      if (this.referCondition.title == '采购员') {
+        this.staff2Options = selection
+        this.queryParams.buyer = selection[0].code
+      }
     }
   }
 }

+ 24 - 6
src/views/purchase/PurchaseDemandList/add.vue

@@ -191,7 +191,7 @@
         >
           <el-table-column type="selection"/>
           <el-table-column label="序号" type="index" align="center"/>
-          <el-table-column label="行状态" align="center" prop="status" />
+          <el-table-column label="行状态" align="center" prop="status" :formatter="hangStatus"/>
           <el-table-column label="行号" align="center" prop="rowNo" />
           <el-table-column label="业务部门名称" align="center" width="180px">
             <template slot-scope="scope">
@@ -453,10 +453,10 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierCode" width="200px">
+          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.additionalSupplierCode"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -630,6 +630,22 @@ export default {
     }
   },
   methods: {
+    hangStatus(row) {
+      switch (row.status) {
+        case '0':
+          return '需补货'
+        case '1':
+          return '待采购确认'
+        case '2':
+          return '采购已确认'
+        case '3':
+          return '采购已审核'
+        case '4':
+          return '行关闭'
+        case '5':
+          return '总供应可满足'
+      }
+    },
     copy() {
       this.$modal.msgSuccess("复制成功");
       this.sonPageStu = 'add'
@@ -704,6 +720,7 @@ export default {
         materialCode: null,
         material: null,
         materialName: null,
+        classifyId: null,
         specification: null,
         unit: null,
         unitName: null,
@@ -752,7 +769,7 @@ export default {
         availableQty: null,
         statusAllot: 'N',
         additionalSupplier: null,
-        additionalSupplierCode: null,
+        additionalSupplierName: null,
         periodUnit: null,
         demandCustomer: null,
         demandCustomerName: null,
@@ -911,8 +928,8 @@ export default {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referConditionMx.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierCode = selection[0].name
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referConditionMx.title == '选择收货地址') {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
@@ -942,6 +959,7 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
       this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
       this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
+      this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass

+ 92 - 29
src/views/purchase/deliveryAddress/add.vue

@@ -28,24 +28,16 @@
 
         <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-input
-                v-model="basicForm.warehouseCode"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select size="small" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="仓库属性">
-              <el-select v-model="basicForm.warehouseProperty" size="small" style="width: 200px" clearable :disabled="disable">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+          <el-form-item label="仓库属性">
+              <el-select :disabled="disable" v-model="basicForm.warehouseProperty" size="small" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -65,13 +57,9 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-              <el-input
-                v-model="basicForm.contactsName"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select size="small" v-model="basicForm.contacts" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+                <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.code" />
+              </el-select>
             </el-form-item>
          </el-col>
 
@@ -89,13 +77,16 @@
 
           <el-col :span="1.5">
             <el-form-item label="物料分类">
-              <el-input
+              <el-select
                 v-model="basicForm.materialClassify"
                 size="small"
                 :disabled="disable"
                 clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
                 style="width: 200px"
-              />
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
@@ -114,9 +105,9 @@
 
          <el-col :span="1.5">
             <el-form-item label="同步状态">
-              <el-select v-model="basicForm.sendStatus" size="small" style="width: 200px" clearable :disabled="disable">
+              <el-select disabled v-model="basicForm.sendStatus" size="small" style="width: 200px">
                 <el-option
-                  v-for="item in options"
+                  v-for="item in options2"
                   :key="item.value"
                   :label="item.label"
                   :value="item.value">
@@ -151,14 +142,27 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
 <script>
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
+// 用于回显参照框数据
+import { getRefer } from '@/api/purchase/basic.js'
 export default {
   name: 'addAddress',
+  dicts: ['sys_warehouse_attribute'],
   props: ['pageStu','row', 'disable'],
+  components: {
+    Refers,
+    TreeRefers
+  },
   model: {
     prop: 'isList',
     event: 'jugislist'
@@ -169,7 +173,7 @@ export default {
         code: '',
         name: '',
         warehouse: '',
-        warehouseCode: '',
+        warehouseName: '',
         warehouseProperty: '',
         address: '',
         contacts: '',
@@ -178,14 +182,27 @@ export default {
         materialClassify: '',
         materialClassifyName: '',
         status: '',
-        sendStatus: '',
+        sendStatus: '2',
         remark: '',
       },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       options: [{
-        value: '1', label: '是',
+        value: '0', label: '启用',
       }, {
-        value: '0', label: '否'
+        value: '2', label: '停用'
       }],
+      options2: [{
+        value: '0', label: '已同步',
+      }, {
+        value: '2', label: '未同步'
+      }],
+      houseOptions: [],
+      contactsOptions: [],
+      classOptions: [],
       basicRules: {}
     }
   },
@@ -229,6 +246,52 @@ export default {
       getAddressDetail(row.id).then(res => {
         if (res.code === 200) {
           this.basicForm = res.data
+          if (this.basicForm.warehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.warehouse) }
+          if (this.basicForm.contacts) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.contacts) }
+          if (this.basicForm.materialClassify) { this.reBackRefer('MATERIALCLASSIFY_PARAM', this.basicForm.materialClassify) }
+        }
+      })
+    },
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
+        this.houseOptions = selection
+        this.basicForm.warehouseName = selection[0].name
+        this.basicForm.warehouse = selection[0].id
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.contactsOptions = selection
+        this.basicForm.contactsName = selection[0].name
+        this.basicForm.contacts = selection[0].code
+      }
+    },
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.basicForm.materialClassify = selection.id
+      this.basicForm.materialClassifyName = selection.name
+    },
+    // 回显参照框 加title解决判断重复提交问题
+    reBackRefer(type, id, title) {
+      getRefer({ type: type, id: id, title: title }).then(res => {
+        if (type == 'WAREHOUSE_PARAM') {
+          this.houseOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM') {
+          this.contactsOptions = res.rows
+        }
+        if (type == 'MATERIALCLASSIFY_PARAM') {
+          this.classOptions = res.rows
         }
       })
     },

+ 108 - 44
src/views/purchase/deliveryAddress/index.vue

@@ -5,25 +5,16 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="仓库属性">
-              <el-select v-model="queryParams.warehouseProperty" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+              <el-select clearable v-model="queryParams.warehouseProperty" size="small" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-select v-model="queryParams.warehouseCode" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select clearable size="small" v-model="queryParams.warehouseName" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.name" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -49,8 +40,8 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain>搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+              <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+              <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -60,13 +51,14 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料分类">
-              <el-select v-model="queryParams.materialClassify" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                v-model="queryParams.materialClassifyName"
+                size="small"
+                clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
+                style="width: 200px"
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -85,13 +77,9 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-            <el-input
-              v-model="queryParams.contactsName"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+            <el-select clearable size="small" v-model="queryParams.contactsName" clearable @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+              <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
             </el-form-item>
           </el-col>
 
@@ -100,7 +88,6 @@
             <el-input
               v-model="queryParams.contactsPhone"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -114,7 +101,6 @@
             <el-input
               v-model="queryParams.remark"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -123,19 +109,20 @@
 
           <el-col :span="1.5">
             <el-form-item label="同步状态">
-            <el-input
-              v-model="queryParams.sendStatus"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+              <el-select v-model="queryParams.sendStatus" size="small" style="width: 200px" clearable>
+                <el-option
+                  v-for="item in options2"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
 
           <el-col :span="1.5">
             <el-form-item label="启用">
-              <el-select v-model="queryParams.status" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select v-model="queryParams.status" size="small" style="width: 200px" clearable>
                 <el-option
                   v-for="item in options"
                   :key="item.value"
@@ -229,6 +216,10 @@
       </el-card>
     </div>
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
@@ -236,11 +227,16 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getAddressList, delAddress} from '@/api/purchase/deliveryAddress.js'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 export default {
   name: 'deliveryAddress',
+  dicts: ['sys_warehouse_attribute'],
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers,
+    TreeRefers
   },
   data() {
     return {
@@ -254,6 +250,7 @@ export default {
         code: '',
         name: '',
         warehouse: '',
+        warehouseName: '',
         warehouseCode: '',
         warehouseProperty: '',
         address: '',
@@ -266,13 +263,26 @@ export default {
         sendStatus: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
       options: [{
-        value: '1', label: '是',
+        value: '0', label: '启用',
       }, {
-        value: '0', label: '否'
+        value: '2', label: '停用'
       }],
+      options2: [{
+        value: '0', label: '已同步',
+      }, {
+        value: '2', label: '未同步'
+      }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
+      houseOptions: [],
+      classOptions: [],
+      contactsOptions: [],
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -291,6 +301,31 @@ export default {
         }
       })
     },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        code: '',
+        name: '',
+        warehouse: '',
+        warehouseName: '',
+        warehouseCode: '',
+        warehouseProperty: '',
+        address: '',
+        contacts: '',
+        contactsName: '',
+        contactsPhone: '',
+        materialClassify: '',
+        materialClassifyName: '',
+        status: '',
+        sendStatus: '',
+        remark: '',
+        pageNum: 1,
+        pageSize: 5
+      }
+      this.getList(this.queryParams)
+    },
     handleSelectionChange() {},
     handleCommand(command) {
       alert(command)
@@ -335,7 +370,36 @@ export default {
     },
     drop() {
       this.expanded = !this.expanded
-    }
+    },
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
+        this.houseOptions = selection
+        // this.queryParams.warehouse = selection[0].id
+        this.queryParams.warehouseName = selection[0].name
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.contactsOptions = selection
+        // this.queryParams.contacts = selection[0].code
+        this.queryParams.contactsName = selection[0].name
+      }
+    },
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      // this.queryParams.materialClassify = selection.id
+      this.queryParams.materialClassifyName = selection.name
+    },
   }
 }
 </script>

+ 237 - 87
src/views/purchase/transferOrder/add.vue

@@ -3,9 +3,16 @@
     <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
       <el-row :gutter="10">
         <el-col :span="1.5">
+          <el-form-item label="调出库存组织">
+            <el-select clearable size="small" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
+              <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="1.5">
             <el-form-item label="订单类型">
               <el-select v-model="basicForm.billType" size="small" style="width: 200px" clearable>
-                <el-option v-for="dict in dict.type.sys_order_type" :key="dict.value" :label="dict.label" :value="dict.value">
+                <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -67,57 +74,43 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入库存组织">
-              <el-input
-                v-model="basicForm.storageInventoryOrg"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
+                <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出业务员">
-              <el-input
-                v-model="basicForm.businessPersonal"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.businessPersonal" :disabled="sonDisable" @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')" style="width: 200px">
+                <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code" />
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出部门">
-              <el-input
-                v-model="basicForm.deliveryDept"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门')" style="width: 200px">
+                <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="币种">
-              <el-input
-                v-model="basicForm.currency"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.currency" :disabled="sonDisable" @focus="chooseRefer('CURRENCY_PARAM', true, '币种')" style="width: 200px">
+                <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="折本汇率">
-              <el-input
+              <el-input-number
                 v-model="basicForm.rate"
                 size="small"
-                placeholder=""
-                clearable
+                disabled
+                :precision="2" 
+                :step="0.1" 
+                :max="10"
                 style="width: 200px"
-              />
+              ></el-input-number>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
@@ -125,7 +118,6 @@
               <el-input
                 v-model="basicForm.onRouteAffilliation"
                 size="small"
-                placeholder=""
                 clearable
                 style="width: 200px"
               />
@@ -187,36 +179,25 @@
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
-            <el-form-item label="物料项目组">
-              <el-input
-                v-model="basicForm.materialProject"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+            <el-form-item label="物流项目组">
+              <el-select v-model="basicForm.materialProject" size="small" style="width: 200px" clearable>
+                <el-option v-for="dict in dict.type.sys_project_group" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="利润中心">
-              <el-input
-                v-model="basicForm.code"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.liacenter" :disabled="sonDisable" @focus="chooseTreeRefer('LIACENTER_PARAM', false, '利润中心')" style="width: 200px">
+                <el-option v-for="item in liacenterOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
         </el-col>
         <el-col :span="1.5">
             <el-form-item label="是否已同步WMS">
-              <el-input
-                v-model="basicForm.isSendWms"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.isSendWms" :disabled="sonDisable" style="width: 200px">
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+              </el-select>
             </el-form-item>
         </el-col>
         <el-col :span="1.5">
@@ -232,13 +213,10 @@
         </el-col>
         <el-col :span="1.5">
             <el-form-item label="单据状态">
-              <el-input
-                v-model="basicForm.code"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select disabled v-model="basicForm.status" size="small" style="width: 200px" clearable>
+                <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
             </el-form-item>
         </el-col>
       </el-row>
@@ -254,20 +232,40 @@
           max-height="480"
           >
           <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="物料编码" align="center" prop="material"/>
+          <el-table-column label="物料编码" align="center" prop="material" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input readonly size="small" v-model="scope.row.material">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column label="物料名称" align="center" prop="materialName"/>
-          <el-table-column label="调拨出库单号" align="center" prop="code"/>
-          <el-table-column label="调拨入库单号" align="center" prop="code"/>
-          <el-table-column label="规格" align="center" prop="code"/>
+          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
+          <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
+          <el-table-column label="规格" align="center" prop="specification"/>
           <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-          <el-table-column label="产地" align="center" prop="originPlace"/>
+          <el-table-column label="产地" align="center" prop="originPlaceName"/>
           <el-table-column label="型号" align="center" prop="model"/>
-          <el-table-column label="单位" align="center" prop="unit"/>
+          <el-table-column label="单位" align="center" prop="unitName"/>
           <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/>
-          <el-table-column label="数量" align="center" prop="qty"/>
-          <el-table-column label="主单位" align="center" prop="mainUnit"/>
+          <el-table-column label="数量" align="center" prop="qty" width="150px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column label="主单位" align="center" prop="mainUnitName"/>
           <el-table-column label="换算率" align="center" prop="equation"/>
-          <el-table-column label="主数量" align="center" prop="mainQty"/>
+          <el-table-column label="主数量" align="center" prop="mainQty" width="150px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.mainQty"/>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column label="税率" align="center" prop="rate"/>
           <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/>
           <el-table-column label="批次号" align="center" prop="patchNo"/>
@@ -287,6 +285,15 @@
           <!-- <el-table-column label="备注" align="center" prop="code"/> -->
           <el-table-column label="客户物料码" align="center" prop="customerLogistic"/>
           <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
+          <el-table-column
+            fixed="right"
+            label="操作"
+            align="center"
+            >
+            <template slot-scope="scope">
+              <el-button type="text" size="small" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
           </el-table>
         </el-tab-pane>
 
@@ -504,31 +511,44 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
   </div>
 </template>
 
 <script>
 import {addOrder, getOrderDetail, editOrder} from '@/api/purchase/transferOrder.js'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
+// 明细行选择物料参照
+import popDialog from '@/components/PopDialog/index.vue'
+
 export default {
   name: 'addOder',
-  dicts: ['sys_order_type'],
+  dicts: ['sys_allot_billtype', 'sys_project_group', 'sys_status'],
   props: ['pageStu','row', 'disable'],
+  components: {
+    Refers,
+    TreeRefers,
+    popDialog
+  },
   model: {
     prop: 'isList',
     event: 'jugislist'
   },
   data() {
     return {
-      basicForm: {},
-      options: [{
-        value: '1', label: '是',
-      }, {
-        value: '0', label: '否'
-      }],
-      basicRules: {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
+      basicForm: {
+        deliveryInventoryOrg: '',
+        deliveryInventoryOrgName: '',
         billType: '',
         code: '',
-        billDate	: '',
+        billDate: '',
         allotType: '',
         deliveryCode: '',
         storageCode: '',
@@ -540,7 +560,7 @@ export default {
         deliveryDeptName: '',
         currency: '',
         currencyName: '',
-        rate: '',
+        rate: 1,
         onRouteAffilliation: '',
         qty: '',
         accountPath: '',
@@ -551,15 +571,35 @@ export default {
         storageWarehouse: '',
         storageWarehouseName: '',
         materialProject: '',
+        liacenter: '',
+        liacenterName: '',
         sourceIdentification: '',
         isSendWms: '',
-        status: '',
+        status: '0',
         tenantId: '',
         revision: '',
         createByName: '',
         updateByName: '',
         delFlag: '',
       },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: '',
+      },
+      options: [{
+        value: '0', label: '是',
+      }, {
+        value: '2', label: '否'
+      }],
+      tableIndex: null,
+      chuOrgOptions: [],
+      ruOrgOptions:[],
+      manOptions: [],
+      deptOptions: [],
+      currencyOptions: [],
+      liacenterOptions: [],
+      basicRules: {},
       materialInfo: [],
       receiveInfo: [],
       priceList: [],
@@ -620,10 +660,114 @@ export default {
         }
       })
     },
-    addLine() {},
+    addLine() {
+      const newLine = {
+        rowno: null,
+        material: null,
+        materialName: null,
+        deliveryCode: null,
+        storageCode: null,
+        specification: null,
+        manufacturer: null,
+        originPlace: null,
+        originPlaceName: null,
+        model: null,
+        unit: null,
+        unitName: null,
+        deliveryWarehouseName: null,
+        qty: null,
+        mainUnit: null,
+        mainUnitName: null,
+        equation: null,
+        mainQty: null,
+        rate: null,
+        storageWarehouseName: null,
+        patchNo: null,
+        producBatch: null,
+        manufactureDate: null,
+        periodEndDate: null,
+        ratifyCode: null,
+        registration: null,
+        productCode: null,
+        commonCode: null,
+        drug: null,
+        ruleDetail: null,
+        marketingApprovalPersonal: null,
+        production: null,
+        pi: null,
+        customerLogistic: null,
+        customerLogisticName: null
+      }
+      this.materialInfo.push(newLine)
+    },
     delLine(index) {
-      // console.log('删除行:', index)
-      // this.basicForm.puDemandItemList.splice(index, 1)
+      console.log('删除行:', index)
+      this.materialInfo.splice(index, 1)
+    },
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.title == '调出库存组织') {
+        this.chuOrgOptions = selection
+        this.basicForm.deliveryInventoryOrg = selection[0].id
+        this.basicForm.deliveryInventoryOrgName = selection[0].name
+      }
+      if (this.referCondition.title == '调入库存组织') {
+        this.ruOrgOptions = selection
+        this.basicForm.storageInventoryOrg = selection[0].id
+        this.basicForm.storageInventoryOrgName = selection[0].name
+        this.basicForm.onRouteAffilliation = selection[0].name
+      }
+      if (this.referCondition.title == '调出业务员') {
+        this.manOptions = selection
+        this.basicForm.businessPersonal = selection[0].code
+        this.basicForm.businessPersonalName = selection[0].name
+      }
+      if (this.referCondition.title == '调出部门') {
+        this.deptOptions = selection
+        this.basicForm.deliveryDept = selection[0].id
+        this.basicForm.deliveryDeptName = selection[0].name
+      }
+      if (this.referCondition.title == '币种') {
+        this.currencyOptions = selection
+        this.basicForm.currency = selection[0].id
+        this.basicForm.currencyName = selection[0].name
+      }
+    },
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.liacenterOptions.push(selection)
+      this.basicForm.liacenter = selection.id
+      this.basicForm.liacenterName = selection.name
+    },
+    // 明细行选择物料编码带出数据
+    chooseMaterial(index) {
+      console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
+      this.tableIndex = index
+      this.$refs.materialRefer.init()
+    },
+    selectMaterial(selection) {
+      console.log('选中的物料', selection)
+      this.materialInfo[this.tableIndex].material = selection[0].code
+      this.materialInfo[this.tableIndex].materialName = selection[0].name
+      this.materialInfo[this.tableIndex].specification = selection[0].specification
+      this.materialInfo[this.tableIndex].model = selection[0].model
+      this.materialInfo[this.tableIndex].originPlace = selection[0].originPlace
+      this.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName
+      this.materialInfo[this.tableIndex].unit = selection[0].unitId
+      this.materialInfo[this.tableIndex].mainUnit = selection[0].unitId
+      this.materialInfo[this.tableIndex].unitName = selection[0].unitIdName
+      this.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName
+      this.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName
     },
   }
 }
@@ -640,5 +784,11 @@ export default {
   margin-bottom: 10px;
   display: flex;
   justify-content: flex-end;
-}  
+}
+.hang {
+  margin: auto;
+}
+.hang ::v-deep .el-form-item__content{
+  margin-left: 0px !important;
+}
 </style>

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно