Browse Source

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

WuXiaohan 2 years ago
parent
commit
818a59598f
88 changed files with 2723 additions and 3881 deletions
  1. 12 2
      src/api/business/purchase/purchase-order.js
  2. 2 1
      src/api/business/purchase/task.js
  3. 1 0
      src/api/business/spd/bo/statement.js
  4. 4 2
      src/components/DictTag/index.vue
  5. 0 186
      src/components/input-dialog/components/index.vue
  6. 0 12
      src/components/input-dialog/components/init-column.js
  7. 0 62
      src/components/input-dialog/index.js
  8. 0 97
      src/components/input-dialog/index.vue
  9. 0 22
      src/components/popover-multiple-select/components/ALLOCATION_PARAM.js
  10. 0 21
      src/components/popover-multiple-select/components/BALATYPE_PARAM.js
  11. 0 15
      src/components/popover-multiple-select/components/CONTACTS_PARAM.js
  12. 0 30
      src/components/popover-multiple-select/components/CURRENCY_PARAM.js
  13. 0 21
      src/components/popover-multiple-select/components/CUSTOMER_PARAM.js
  14. 0 14
      src/components/popover-multiple-select/components/DEPT_PARAM.js
  15. 0 14
      src/components/popover-multiple-select/components/MATERIAL_PARAM.js
  16. 0 21
      src/components/popover-multiple-select/components/OPERATING_PARAM.js
  17. 0 14
      src/components/popover-multiple-select/components/ORG_PARAM.js
  18. 0 14
      src/components/popover-multiple-select/components/PAYAGREEMENT_PARAM.js
  19. 0 21
      src/components/popover-multiple-select/components/PROCESSTYPE_PARAM.js
  20. 0 21
      src/components/popover-multiple-select/components/PROJECT_PARAM.js
  21. 0 21
      src/components/popover-multiple-select/components/PSNLICENSE_PARAM.js
  22. 0 21
      src/components/popover-multiple-select/components/RETREASON_PARAM.js
  23. 0 21
      src/components/popover-multiple-select/components/SUPPLIERCONTACTS_PARAM.js
  24. 0 14
      src/components/popover-multiple-select/components/SUPPLIER_PARAM.js
  25. 0 29
      src/components/popover-multiple-select/components/WAREHOUSE_PARAM.js
  26. 0 145
      src/components/popover-multiple-select/index.vue
  27. 0 0
      src/components/popover-select/api/index.js
  28. 0 0
      src/components/popover-select/components/ALLOCATION_PARAM.js
  29. 0 0
      src/components/popover-select/components/BALATYPE_PARAM.js
  30. 0 0
      src/components/popover-select/components/CONTACTS_PARAM.js
  31. 0 0
      src/components/popover-select/components/CURRENCY_PARAM.js
  32. 0 0
      src/components/popover-select/components/CUSTOMERDEPT_PARAM.js
  33. 0 0
      src/components/popover-select/components/CUSTOMER_PARAM.js
  34. 0 0
      src/components/popover-select/components/DEPT_PARAM.js
  35. 0 0
      src/components/popover-select/components/MATERIAL_PARAM.js
  36. 0 0
      src/components/popover-select/components/OPERATING_PARAM.js
  37. 0 0
      src/components/popover-select/components/ORG_PARAM.js
  38. 0 0
      src/components/popover-select/components/PAYAGREEMENT_PARAM.js
  39. 0 0
      src/components/popover-select/components/PROCESSTYPE_PARAM.js
  40. 0 0
      src/components/popover-select/components/PROJECT_PARAM.js
  41. 0 0
      src/components/popover-select/components/PSNLICENSE_PARAM.js
  42. 0 0
      src/components/popover-select/components/RETREASON_PARAM.js
  43. 0 0
      src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js
  44. 0 0
      src/components/popover-select/components/SUPPLIER_PARAM.js
  45. 0 0
      src/components/popover-select/components/WAREHOUSE_PARAM.js
  46. 19 20
      src/components/popover-select/components/index.vue
  47. 216 0
      src/components/popover-select/index.vue
  48. 0 0
      src/components/popover-tree-select/api/index.js
  49. 1 1
      src/components/popover-tree-select/components/MATERIALCLASSIFY_PARAM.js
  50. 177 0
      src/components/popover-tree-select/components/index.vue
  51. 213 0
      src/components/popover-tree-select/index.vue
  52. 63 50
      src/main.js
  53. 11 31
      src/utils/init/index.js
  54. 33 0
      src/utils/init/setting.js
  55. 121 202
      src/views/business/spd/bo/basic/details.vue
  56. 2 1
      src/views/business/spd/bo/basic/index.vue
  57. 13 5
      src/views/business/spd/bo/basic/process.vue
  58. 8 1
      src/views/business/spd/bo/behavior/behaviorList.vue
  59. 9 2
      src/views/business/spd/bo/contact/contactList.vue
  60. 8 1
      src/views/business/spd/bo/education/educationList.vue
  61. 8 1
      src/views/business/spd/bo/pojpsn/pojpsnList.vue
  62. 9 2
      src/views/business/spd/bo/relationship/relationshipList.vue
  63. 134 9
      src/views/business/spd/bo/statement/index.vue
  64. 15 8
      src/views/business/spd/bo/statement/proportion/index.vue
  65. 9 0
      src/views/business/spd/bo/task/taskList.vue
  66. 36 2
      src/views/purchase/DemandSummary/index.vue
  67. 68 200
      src/views/purchase/apply/add/index.vue
  68. 69 201
      src/views/purchase/apply/edit/index.vue
  69. 68 200
      src/views/purchase/catalogue/add/index.vue
  70. 68 200
      src/views/purchase/catalogue/edit/index.vue
  71. 76 202
      src/views/purchase/contract/add/index.vue
  72. 68 200
      src/views/purchase/contract/edit/index.vue
  73. 1 0
      src/views/purchase/deliveryAddress/add.vue
  74. 97 76
      src/views/purchase/purchase-order/add/column.js
  75. 326 126
      src/views/purchase/purchase-order/add/index.vue
  76. 170 170
      src/views/purchase/purchase-order/column.js
  77. 68 30
      src/views/purchase/purchase-order/edit/index.vue
  78. 87 19
      src/views/purchase/purchase-order/index.vue
  79. 158 46
      src/views/purchase/task/column.js
  80. 0 105
      src/views/purchase/task/config/add.js
  81. 7 24
      src/views/purchase/task/first-direct/column.js
  82. 70 210
      src/views/purchase/task/first-direct/index.vue
  83. 84 57
      src/views/purchase/task/index.vue
  84. 17 10
      src/views/purchase/task/modify-buyer/index.vue
  85. 0 514
      src/views/purchase/task/see/column.js
  86. 24 71
      src/views/purchase/task/see/index.vue
  87. 56 36
      src/views/purchase/transferOrder/add.vue
  88. 17 7
      src/views/purchase/transferOrder/index.vue

+ 12 - 2
src/api/business/purchase/purchase-order.js

@@ -1,9 +1,9 @@
 import request from "@/utils/request";
 
 // 采购订单修订列表
-const list = (data) => {
+const list = (data, page) => {
   return request({
-    url: `/pu/order/list`,
+    url: `/pu/order/list?pageSize=${page.pageSize}&pageNum=${page.pageNum}`,
     method: "post",
     data,
   });
@@ -71,6 +71,15 @@ const getPrice = (data) => {
   });
 }
 
+// 采购订单退回
+const documentsReturn = (data) => {
+  return request({
+    url: `/pu/order/documentsReturn`,
+    method: "put",
+    data,
+  });
+}
+
 export default {
   list,
   details,
@@ -80,5 +89,6 @@ export default {
   revision,
   remove,
   getPrice,
+  documentsReturn,
 
 }

+ 2 - 1
src/api/business/purchase/task.js

@@ -1,10 +1,11 @@
 import request from "@/utils/request";
 
-export function LIST(data) {
+export function LIST(data, params) {
   return request({
     url: "/pu/order/generate/list",
     method: "POST",
     data: data,
+    params: params,
   });
 }
 

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

@@ -11,6 +11,7 @@ export function listBasic(query) {
 
 // 查询商机百分比列表
 export function listProportion(query) {
+  console.log('query',query);
   return request({
     url: '/mk/bo/statement/listCollect',
     method: 'get',

+ 4 - 2
src/components/DictTag/index.vue

@@ -14,6 +14,7 @@
           :disable-transitions="true"
           :key="item.value"
           :index="index"
+          :size="size"
           :type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
           :class="item.raw.cssClass"
         >
@@ -33,10 +34,11 @@ export default {
       default: null,
     },
     value: [Number, String, Array],
+    size: String,
   },
   computed: {
     values() {
-      if (this.value !== null && typeof this.value !== 'undefined') {
+      if (this.value !== null && typeof this.value !== "undefined") {
         return Array.isArray(this.value) ? this.value : [String(this.value)];
       } else {
         return [];
@@ -49,4 +51,4 @@ export default {
 .el-tag + .el-tag {
   margin-left: 10px;
 }
-</style>
+</style>

+ 0 - 186
src/components/input-dialog/components/index.vue

@@ -1,186 +0,0 @@
-<script>
-import { refer } from "../api/index";
-import { initParams } from "@/utils/init";
-import InitColumnHooks from "./init-column";
-
-export default {
-  name: "InputDialog",
-  props: ["type", "title", "queryParams"],
-  components: {},
-  data() {
-    const { type } = this.$props;
-    const { TableColumns, SearchColumns } = InitColumnHooks(type);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      showKey: "name",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      layout: "total, prev, pager, next, sizes, jumper",
-      pageSizes: [25, 50, 100],
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      params: { search: "" },
-      searchColumns: SearchColumns,
-      // table
-      data: [],
-      tableColumns: TableColumns,
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { type, queryParams } = this.$props;
-        const { code, msg, rows, total } = await refer(
-          {
-            type: type,
-            isPage: true,
-            ...prop,
-            ...queryParams,
-          },
-          
-          { pageNum, pageSize }
-        );
-        if (code === 200) {
-          this.data = rows;
-          this.page.total = total;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-      }
-    },
-    // setting up to fetch table data
-    queryList() {
-      this.fetchList(this.params, this.page);
-    },
-    // reset to fetch table data
-    resetList() {
-      this.page.pageNum = 1;
-      this.params = initParams(this.searchColumns);
-      this.fetchList(this.params, this.page);
-    },
-    // size change to fetch table data
-    pageSizeChange(prop) {
-      this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // number change to fetch table data
-    pageNumberChange(prop) {
-      this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // click select row data
-    clickSelectCurrentData(row) {
-      this.currentData = row;
-    },
-    // double click select row data and confirm
-    dblclickSelectCurrentData(row) {
-      this.confirm(row);
-    },
-    //
-    confirm(prop) {
-      if (prop) {
-        this.$emit("confirm", prop);
-      }
-      this.setVisible(false);
-    },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-dialog
-    :title="title"
-    :visible.sync="visible"
-    :width="width"
-    append-to-body
-    @open="beforeOpen"
-  >
-    <el-form :size="size" :inline="true" :model="params" @submit.native.prevent>
-      <el-form-item prop="search">
-        <el-input
-          v-model="params.search"
-          @keydown.enter="queryList"
-          @change="queryList"
-        >
-        </el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button icon="el-icon-refresh" @click="resetList"></el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-      v-loading="loading"
-      :data="data"
-      :size="size"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="clickSelectCurrentData"
-      @row-dblclick="dblclickSelectCurrentData"
-    >
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width"
-        show-overflow-tooltip
-      >
-      </el-table-column>
-    </el-table>
-    <div
-      style="display: flex; justify-content: space-between; align-items: center"
-    >
-      <p>
-        <span style="font-size: 12px">已选择 :</span>
-        <el-tag v-if="currentData" :size="size">{{
-          currentData[showKey]
-        }}</el-tag>
-        <span v-else>无</span>
-      </p>
-      <el-pagination
-        :layout="layout"
-        :total="page.total"
-        :page-sizes="pageSizes"
-        :page-size="page.pageSize"
-        :current-page="page.pageNum"
-        :small="size === 'mini'"
-        background
-        @size-change="pageSizeChange"
-        @current-change="pageNumberChange"
-      >
-      </el-pagination>
-    </div>
-    <div style="margin-top: 20px; text-align: right">
-      <el-button :size="size" @click="visible = false">取 消</el-button>
-      <el-button :size="size" type="primary" @click="confirm(currentData)"
-        >确 定</el-button
-      >
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 12
src/components/input-dialog/components/init-column.js

@@ -1,12 +0,0 @@
-export default function InitColumnsHooks(prop) {
-  //
-  const TableColumns = require(`./${prop}`).default.filter(
-    (element) => element.key
-  );
-  //
-  const SearchColumns = require(`./${prop}`).default.filter(
-    (element) => element.search
-  );
-  //
-  return { TableColumns, SearchColumns };
-}

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

@@ -1,62 +0,0 @@
-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;

+ 0 - 97
src/components/input-dialog/index.vue

@@ -1,97 +0,0 @@
-<script>
-export default {
-  name: "DrInputDialog",
-  props: {
-    // 参照类型 ,对应后端
-    type: {
-      type: String,
-      require: true,
-    },
-    // Input显示数据
-    value: {
-      type: String,
-      require: true,
-    },
-    // 需映射源数据
-    source: {
-      type: Object,
-      require: true,
-    },
-    // 参照内外映射
-    dataMapping: {
-      type: Object,
-      require: true,
-    },
-    // 参照弹窗标题
-    title: {
-      type: String,
-      default: "TITLE",
-    },
-    // 默认查询参数
-    queryParams: {
-      type: Object,
-      default: () => ({}),
-    },
-    //
-    size: String,
-    //
-    readonly: Boolean,
-    //
-    disabled: Boolean,
-    //
-    clearable: Boolean,
-    //
-    placeholder: String,
-  },
-  components: {
-    InputDialog: () => import("./components/index.vue"),
-  },
-  data() {
-    return {};
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // 处理默认传参
-    handleMakeQueryParams() {
-      const newQueryParams = {}
-      const { source, queryParams } = this.$props;
-      for (let key in queryParams) {
-        newQueryParams[key] = queryParams[key] === key ? source[queryParams[key]] : queryParams[key]
-      }
-      return newQueryParams
-    },
-    // 打开弹窗
-    handleAsyncOpenDialog() {
-      this.$nextTick(() => {
-        const { setVisible } = this.$refs.InputDialogFef;
-        setVisible(true);
-      });
-    },
-    // 更新映射数据
-    handleUpdateSource(prop) {
-      const { source, dataMapping } = this.$props;
-      for (let key in dataMapping) {
-        source[key] = prop[dataMapping[key]];
-      }
-      this.$emit("update:source", source);
-    },
-  },
-  created() {
-    this.handleMakeQueryParams()
-  },
-  mounted() { },
-  destroyed() { },
-};
-</script>
-<template>
-  <el-input v-model="value" :size="size" :readonly="readonly" :disabled="disabled" :clearable="clearable"
-    :placeholder="placeholder" style="width: 100%; cursor: pointer" @click.native.stop="handleAsyncOpenDialog">
-    <template #suffix>
-      <el-icon class="el-icon-milk-tea"></el-icon>
-      <input-dialog ref="InputDialogFef" :type="type" :title="title" :queryParams="handleMakeQueryParams()"
-        @confirm="handleUpdateSource"></input-dialog>
-    </template>
-  </el-input>
-</template>
-<style scoped></style>

+ 0 - 22
src/components/popover-multiple-select/components/ALLOCATION_PARAM.js

@@ -1,22 +0,0 @@
-// 货位
-export default [
-  // 树
-  {
-    key: "id",
-    title: "ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "货位",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/BALATYPE_PARAM.js

@@ -1,21 +0,0 @@
-// 结算方式
-export default [
-  {
-    key: "id",
-    title: "结算方式ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "结算方式",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 15
src/components/popover-multiple-select/components/CONTACTS_PARAM.js

@@ -1,15 +0,0 @@
-// 客户部门
-export default [
-  {
-    key: "code",
-    title: "人员编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "人员名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 30
src/components/popover-multiple-select/components/CURRENCY_PARAM.js

@@ -1,30 +0,0 @@
-export default [
-  {
-    key: "name",
-    title: "币种",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "币种简称",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "",
-    title: "单价精度",
-  },
-  {
-    key: "",
-    title: "单价舍入规则",
-  },
-  {
-    key: "",
-    title: "金额精度",
-  },
-  {
-    key: "",
-    title: "金额舍入规则",
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/CUSTOMER_PARAM.js

@@ -1,21 +0,0 @@
-// 收货客户
-export default [
-  {
-    key: "id",
-    title: "收货客户ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "收货客户编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "收货客户名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 14
src/components/popover-multiple-select/components/DEPT_PARAM.js

@@ -1,14 +0,0 @@
-export default [
-  {
-    key: "code",
-    title: "组织编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "组织名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 14
src/components/popover-multiple-select/components/MATERIAL_PARAM.js

@@ -1,14 +0,0 @@
-export default [
-  {
-    key: "code",
-    title: "物料编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "物料名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/OPERATING_PARAM.js

@@ -1,21 +0,0 @@
-// 经营性项目
-export default [
-  {
-    key: "id",
-    title: "经营性项目ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "经营性项目编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "经营性项目名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 14
src/components/popover-multiple-select/components/ORG_PARAM.js

@@ -1,14 +0,0 @@
-export default [
-    {
-      key: "code",
-      title: "组织编码",
-      type: "Input",
-      search: true,
-    },
-    {
-      key: "name",
-      title: "组织名称",
-      type: "Input",
-      search: true,
-    },
-  ]

+ 0 - 14
src/components/popover-multiple-select/components/PAYAGREEMENT_PARAM.js

@@ -1,14 +0,0 @@
-export default [
-  {
-    key: "code",
-    title: "付款协议编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "付款协议名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/PROCESSTYPE_PARAM.js

@@ -1,21 +0,0 @@
-// 处理方式
-export default [
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
-  {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "处理方式",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/PROJECT_PARAM.js

@@ -1,21 +0,0 @@
-// 在建工程项目
-export default [
-  {
-    key: "id",
-    title: "在建工程项目ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "在建工程项目编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "在建工程项目名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/PSNLICENSE_PARAM.js

@@ -1,21 +0,0 @@
-// 处理方式
-export default [
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
-  {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "处理方式",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/RETREASON_PARAM.js

@@ -1,21 +0,0 @@
-// 退换原因
-export default [
-  {
-    key: "id",
-    title: "退换原因ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "退换原因编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "退换原因",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 21
src/components/popover-multiple-select/components/SUPPLIERCONTACTS_PARAM.js

@@ -1,21 +0,0 @@
-// 供应商联系人
-export default [
-  {
-    key: "id",
-    title: "ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "供应商联系人名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 14
src/components/popover-multiple-select/components/SUPPLIER_PARAM.js

@@ -1,14 +0,0 @@
-export default [
-  {
-    key: "code",
-    title: "供应商编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "供应商名称",
-    type: "Input",
-    search: true,
-  },
-];

+ 0 - 29
src/components/popover-multiple-select/components/WAREHOUSE_PARAM.js

@@ -1,29 +0,0 @@
-// 收货仓库
-export default [
-  {
-    key: "id",
-    title: "仓库ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "仓库编码",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "name",
-    title: "仓库名称",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "",
-    title: "备注",
-  },
-  {
-    key: "",
-    title: "助记码",
-  },
-];

+ 0 - 145
src/components/popover-multiple-select/index.vue

@@ -1,145 +0,0 @@
-<script>
-export default {
-  name: "DrTableDialog",
-  props: {
-    // 参照类型 ,对应后端
-    type: {
-      type: String,
-      require: true,
-    },
-    // Input显示数据
-    value: {
-      type: String,
-      require: true,
-    },
-    // 需映射源数据
-    source: {
-      type: Object,
-      require: true,
-    },
-    // 参照内外映射
-    dataMapping: {
-      type: Object,
-      require: true,
-    },
-    // 参照弹窗标题
-    title: {
-      type: String,
-      default: "TITLE",
-    },
-    // 默认查询参数
-    queryParams: {
-      type: Object,
-      default: () => ({}),
-    },
-    //
-    size: String,
-    //
-    readonly: Boolean,
-    //
-    disabled: Boolean,
-    //
-    clearable: Boolean,
-    //
-    placeholder: String,
-  },
-  components: {
-    TableDialog: () => import("./components/index.vue"),
-  },
-  data() {
-    return { data: [] };
-  },
-  computed: {},
-  watch: {
-    data: {
-      handler: function (newProp) {
-        console.log("newProp", newProp);
-      },
-      immediate: true,
-    },
-  },
-  methods: {
-    // 处理默认传参
-    handleMakeQueryParams() {
-      const newQueryParams = {};
-      const { source, queryParams } = this.$props;
-      for (let key in queryParams) {
-        newQueryParams[key] =
-          queryParams[key] === key
-            ? source[queryParams[key]]
-            : queryParams[key];
-      }
-      return newQueryParams;
-    },
-    // 打开弹窗
-    handleAsyncOpenDialog() {
-      this.$nextTick(() => {
-        const { setVisible } = this.$refs.TableDialogFef;
-        setVisible(true);
-      });
-    },
-    // 更新映射数据
-    handleUpdateSource(prop) {
-      this.data = prop;
-      // const { source, dataMapping } = this.$props;
-      // for (let key in dataMapping) {
-      //   source[key] = prop[dataMapping[key]];
-      // }
-      // this.$emit("update:source", source);
-    },
-  },
-  created() {
-    this.handleMakeQueryParams();
-  },
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <div style="position: relative">
-    <el-input
-      v-model="value"
-      :size="size"
-      readonly
-      :disabled="disabled"
-      :clearable="clearable"
-      :placeholder="placeholder"
-      style="width: 100%; cursor: pointer"
-      @click.native.stop="handleAsyncOpenDialog"
-    >
-      <template #suffix>
-        <el-icon class="el-icon-search"></el-icon>
-      </template>
-    </el-input>
-    <div
-      style="
-        position: absolute;
-        left: 10px;
-        top: 50%;
-        transform: translateY(-50%);
-        padding-right: 30px;
-        overflow: hidden;
-      "
-    >
-      <div ref="TagList" style="width: 200px; display: flex">
-        <el-tag
-          v-for="item in 10"
-          :key="item"
-          size="mini"
-          closable
-          style="margin-right: 10px"
-          >mini tag</el-tag
-        >
-      </div>
-    </div>
-    <table-dialog
-      v-model="data"
-      ref="TableDialogFef"
-      :type="type"
-      :title="title"
-      :queryParams="handleMakeQueryParams()"
-      @confirm="handleUpdateSource"
-    ></table-dialog>
-  </div>
-</template>
-<style scoped></style>

+ 0 - 0
src/components/input-dialog/api/index.js → src/components/popover-select/api/index.js


+ 0 - 0
src/components/input-dialog/components/ALLOCATION_PARAM.js → src/components/popover-select/components/ALLOCATION_PARAM.js


+ 0 - 0
src/components/input-dialog/components/BALATYPE_PARAM.js → src/components/popover-select/components/BALATYPE_PARAM.js


+ 0 - 0
src/components/input-dialog/components/CONTACTS_PARAM.js → src/components/popover-select/components/CONTACTS_PARAM.js


+ 0 - 0
src/components/input-dialog/components/CURRENCY_PARAM.js → src/components/popover-select/components/CURRENCY_PARAM.js


+ 0 - 0
src/components/input-dialog/components/CUSTOMERDEPT_PARAM.js → src/components/popover-select/components/CUSTOMERDEPT_PARAM.js


+ 0 - 0
src/components/input-dialog/components/CUSTOMER_PARAM.js → src/components/popover-select/components/CUSTOMER_PARAM.js


+ 0 - 0
src/components/input-dialog/components/DEPT_PARAM.js → src/components/popover-select/components/DEPT_PARAM.js


+ 0 - 0
src/components/input-dialog/components/MATERIAL_PARAM.js → src/components/popover-select/components/MATERIAL_PARAM.js


+ 0 - 0
src/components/input-dialog/components/OPERATING_PARAM.js → src/components/popover-select/components/OPERATING_PARAM.js


+ 0 - 0
src/components/input-dialog/components/ORG_PARAM.js → src/components/popover-select/components/ORG_PARAM.js


+ 0 - 0
src/components/input-dialog/components/PAYAGREEMENT_PARAM.js → src/components/popover-select/components/PAYAGREEMENT_PARAM.js


+ 0 - 0
src/components/input-dialog/components/PROCESSTYPE_PARAM.js → src/components/popover-select/components/PROCESSTYPE_PARAM.js


+ 0 - 0
src/components/input-dialog/components/PROJECT_PARAM.js → src/components/popover-select/components/PROJECT_PARAM.js


+ 0 - 0
src/components/input-dialog/components/PSNLICENSE_PARAM.js → src/components/popover-select/components/PSNLICENSE_PARAM.js


+ 0 - 0
src/components/input-dialog/components/RETREASON_PARAM.js → src/components/popover-select/components/RETREASON_PARAM.js


+ 0 - 0
src/components/input-dialog/components/SUPPLIERCONTACTS_PARAM.js → src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js


+ 0 - 0
src/components/input-dialog/components/SUPPLIER_PARAM.js → src/components/popover-select/components/SUPPLIER_PARAM.js


+ 0 - 0
src/components/input-dialog/components/WAREHOUSE_PARAM.js → src/components/popover-select/components/WAREHOUSE_PARAM.js


+ 19 - 20
src/components/popover-multiple-select/components/index.vue → src/components/popover-select/components/index.vue

@@ -1,19 +1,15 @@
 <script>
 import { refer } from "../api/index";
-// import { initParams } from "@/utils/init";
 
 export default {
   name: "TableDialog",
-  props: ["type", "title", "queryParams"],
+  props: ["type", "title", "multiple", "queryParams"],
   components: {},
   data() {
     const { type } = this.$props;
     const TableColumns = require(`./${type}`).default.filter(
       (element) => element.key
     );
-    // const SearchColumns = require(`./${type}`).default.filter(
-    //   (element) => element.search
-    // );
     return {
       // global
       size: "mini",
@@ -27,12 +23,10 @@ export default {
       loading: false,
       // search
       params: { search: "", isPage: true },
-      // searchColumns: SearchColumns,
       // table
       data: [],
       multipleSelection: [],
       tableColumns: TableColumns,
-      currentData: null,
     };
   },
   computed: {},
@@ -96,22 +90,22 @@ export default {
       this.fetchList(this.params, this.page);
     },
     // click select row data
-    handleClick(row) {
-      this.currentData = row;
+    handleSelect(row) {
+      this.multipleSelection = [row];
     },
     // double click select row data and confirm
-    handleDoubleClick(row) {
-      this.confirm(row);
+    handleDoubleClickSelect(row) {
+      const { multiple } = this.$props;
+      if (!multiple) this.confirm([row]);
     },
-    // multiple
-    handleSelectionChange(prop) {
+    // multiple select row data
+    handleMultipleSelect(prop) {
       this.multipleSelection = prop;
-      this.$notify.success({ title: "success" });
     },
-    //
+    // confirm
     confirm(prop) {
       this.setVisible(false);
-      if (prop.length) this.$emit("confirm", prop);
+      this.$emit("confirm", prop);
     },
   },
   created() {},
@@ -147,11 +141,16 @@ export default {
       height="45vh"
       highlight-current-row
       style="width: 100%; margin-bottom: 20px"
-      @row-click="handleClick"
-      @row-dblclick="handleDoubleClick"
-      @selection-change="handleSelectionChange"
+      @row-click="handleSelect"
+      @row-dblclick="handleDoubleClickSelect"
+      @selection-change="handleMultipleSelect"
     >
-      <el-table-column type="selection" width="55" align="center">
+      <el-table-column
+        v-if="multiple"
+        type="selection"
+        width="55"
+        align="center"
+      >
       </el-table-column>
       <el-table-column
         v-for="(column, index) in tableColumns"

+ 216 - 0
src/components/popover-select/index.vue

@@ -0,0 +1,216 @@
+<script>
+export default {
+  name: "PopoverSelect",
+  props: {
+    // 参照类型 ,对应后端
+    type: {
+      type: String,
+      require: true,
+    },
+    // v-model
+    value: {
+      type: [Array, String],
+      require: true,
+    },
+    // 参照弹窗标题
+    title: {
+      type: String,
+      default: "TITLE",
+    },
+    // 作为 value 唯一标识的键名,绑定值为对象类型时必填
+    valueKey: {
+      type: String,
+      default: "id",
+    },
+    // 默认查询参数
+    queryParams: {
+      type: Object,
+      default: () => ({}),
+    },
+    // 组件大小
+    size: {
+      type: String,
+      default: "mini",
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      default: "",
+    },
+    // 是否可读
+    readonly: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否禁止
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否清除
+    clearable: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否多选
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
+    // 需映射源数据
+    source: Object,
+    // 参照内外映射
+    dataMapping: Object,
+  },
+  emits: ["hide"],
+  components: {
+    TableDialog: () => import("./components/index.vue"),
+  },
+  data() {
+    return {
+      // popover宽度
+      width: "",
+      // 显示value
+      showValue: "",
+      // 选中data
+      data: [],
+    };
+  },
+  computed: {},
+  watch: {
+    "$props.value": {
+      handler: function (newProp, oldProp) {
+        if (!newProp) {
+          this.data = [];
+          this.showValue = "";
+        } else {
+          this.showValue = newProp;
+        }
+      },
+      immediate: true,
+    },
+  },
+  methods: {
+    // 打开弹窗
+    handleAsyncOpenDialog() {
+      this.$nextTick(() => {
+        const { setVisible } = this.$refs.TableDialogFef;
+        setVisible(true);
+      });
+    },
+    // 新增操作
+    handleAdd(prop) {
+      this.data = prop;
+      this.handleUpdate(this.data);
+      this.$emit("hide", prop);
+    },
+    // 删除操作
+    handleDelete(prop) {
+      this.data.splice(prop, 1);
+      this.handleUpdate(this.data);
+    },
+    // 更新操作
+    handleUpdate(prop) {
+      const { source, multiple, valueKey, dataMapping } = this.$props;
+      // 多选
+      if (multiple) {
+        this.showValue = "";
+        this.$emit(
+          "input",
+          prop.map((item) => item[valueKey])
+        );
+      }
+      // 单选
+      if (!multiple) {
+        this.showValue = prop[0].name;
+        this.$emit("input", prop[0][valueKey]);
+        // 更新映射数据
+        for (let key in dataMapping) {
+          source[key] = prop[0][dataMapping[key]];
+        }
+        this.$emit("update:source", source);
+      }
+      //
+      this.$emit("change", prop, source);
+    },
+  },
+  created() {
+    this.$nextTick(() => {
+      const { clientWidth } = this.$refs.PopoverSelect;
+      this.width = clientWidth;
+    });
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <div ref="PopoverSelect" style="position: relative">
+    <el-input
+      v-model="showValue"
+      :size="size"
+      :disabled="disabled"
+      :clearable="clearable"
+      :placeholder="placeholder"
+      readonly
+      style="width: 100%; cursor: pointer"
+      @click.native.stop="handleAsyncOpenDialog"
+    >
+      <template #suffix>
+        <el-icon class="el-icon-more"></el-icon>
+      </template>
+    </el-input>
+    <div
+      v-if="multiple && data.length"
+      style="
+        position: absolute;
+        left: 10px;
+        top: 50%;
+        transform: translateY(-50%);
+        padding-right: 30px;
+        overflow: hidden;
+      "
+    >
+      <div style="width: 150px; display: flex">
+        <el-popover
+          :offset="-10"
+          :width="width"
+          :visible-arrow="false"
+          title=""
+          content=""
+          trigger="click"
+          placement="bottom-start"
+        >
+          <el-tag slot="reference" :size="size" style="margin-right: 10px">
+            + {{ data.length }}
+          </el-tag>
+          <el-tag
+            v-for="(item, index) in data"
+            :size="size"
+            hit
+            closable
+            style="
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
+              margin: 0 0 5px 0;
+            "
+            @close="handleDelete(index)"
+          >
+            {{ item.name }}
+          </el-tag>
+        </el-popover>
+      </div>
+    </div>
+    <table-dialog
+      v-model="data"
+      ref="TableDialogFef"
+      :type="type"
+      :title="title"
+      :multiple="multiple"
+      :queryParams="queryParams"
+      @confirm="handleAdd"
+    ></table-dialog>
+  </div>
+</template>
+<style scoped></style>

+ 0 - 0
src/components/popover-multiple-select/api/index.js → src/components/popover-tree-select/api/index.js


+ 1 - 1
src/components/popover-multiple-select/components/CUSTOMERDEPT_PARAM.js → src/components/popover-tree-select/components/MATERIALCLASSIFY_PARAM.js

@@ -1,4 +1,4 @@
-// 客户部门
+// 客户部门 tree
 export default [
   {
     key: "id",

+ 177 - 0
src/components/popover-tree-select/components/index.vue

@@ -0,0 +1,177 @@
+<script>
+import { refer } from "../api/index";
+
+export default {
+  name: "TableDialog",
+  props: ["type", "title", "multiple", "queryParams"],
+  components: {},
+  data() {
+    const { type } = this.$props;
+    const TableColumns = require(`./${type}`).default.filter(
+      (element) => element.key
+    );
+    return {
+      // global
+      size: "mini",
+      width: "50%",
+      // dialog
+      visible: false,
+      loading: false,
+      // search
+      params: { search: "", isPage: true },
+      // table
+      data: [],
+      tableColumns: TableColumns,
+      radio: "",
+      multipleSelection: [],
+      defaultProps: {
+        label: "name",
+        children: "children",
+      },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    // set dialog visible
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // do something before dialog open
+    beforeOpen() {
+      this.radio = "";
+      this.multipleSelection = [];
+      this.fetchList(this.params);
+    },
+    // fetch table data
+    async fetchList(prop) {
+      try {
+        this.loading = true;
+        const { type, queryParams } = this.$props;
+        const { code, msg, rows } = await refer({
+          type: type,
+          ...prop,
+          ...queryParams,
+        });
+        if (code === 200) {
+          this.data = rows;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+    // setting up to fetch table data
+    queryList() {
+      this.fetchList(this.params);
+    },
+    // reset to fetch table data
+    resetList() {
+      this.params.search = "";
+      this.fetchList(this.params);
+    },
+    // click select row data
+    handleSelect(data) {
+      this.multipleSelection = [data];
+    },
+    // double click select row data and confirm
+    handleDoubleClickSelect(row) {
+      this.confirm([row]);
+    },
+    // multiple select row data
+    handleMultipleSelect(prop, data) {
+      if (prop) {
+        this.multipleSelection.push(data);
+      } else {
+        const { code } = data;
+        const index = this.multipleSelection.findIndex(
+          (item) => item.code === code
+        );
+        this.multipleSelection.splice(index, 1);
+      }
+    },
+    // confirm
+    confirm(prop) {
+      this.setVisible(false);
+      this.$emit("confirm", prop);
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    :width="width"
+    append-to-body
+    destroy-on-close
+    @open="beforeOpen"
+  >
+    <el-form :size="size" :inline="true" :model="params" @submit.native.prevent>
+      <el-form-item prop="search">
+        <el-input
+          v-model="params.search"
+          @keydown.enter="queryList"
+          @change="queryList"
+        >
+        </el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-refresh" @click="resetList"></el-button>
+      </el-form-item>
+    </el-form>
+    <el-tree
+      v-if="multiple"
+      v-loading="loading"
+      :data="data"
+      :props="defaultProps"
+      accordion
+      node-key="id"
+    >
+      <div slot-scope="{ node, data }">
+        <el-checkbox
+          v-model="data.checked"
+          @click.native.stop
+          @change="handleMultipleSelect($event, data)"
+          style="margin: 0 5px 0 0"
+        >
+        </el-checkbox>
+        <span> {{ data.name }}</span>
+      </div>
+    </el-tree>
+    <el-radio-group v-else v-model="radio" style="width: 100%">
+      <el-tree
+        v-loading="loading"
+        :data="data"
+        :props="defaultProps"
+        accordion
+        node-key="id"
+      >
+        <div slot-scope="{ node, data }">
+          <el-radio
+            :label="data.code"
+            @click.native.stop="handleSelect(data)"
+            @dblclick.native.stop="handleDoubleClickSelect(data)"
+            style="margin: 0 5px 0 0"
+          >
+            {{ data.name }}
+          </el-radio>
+        </div>
+      </el-tree>
+    </el-radio-group>
+    <div style="margin-top: 20px; text-align: right">
+      <el-button :size="size" @click="visible = false">取 消</el-button>
+      <el-button :size="size" type="primary" @click="confirm(multipleSelection)"
+        >确 定</el-button
+      >
+    </div>
+  </el-dialog>
+</template>
+<style scoped></style>

+ 213 - 0
src/components/popover-tree-select/index.vue

@@ -0,0 +1,213 @@
+<script>
+export default {
+  name: "PopoverTreeSelect",
+  props: {
+    // 参照类型 ,对应后端
+    type: {
+      type: String,
+      require: true,
+    },
+    // v-model
+    value: {
+      type: [Array, String],
+      require: true,
+    },
+    // 参照弹窗标题
+    title: {
+      type: String,
+      default: "TITLE",
+    },
+    // 作为 value 唯一标识的键名,绑定值为对象类型时必填
+    valueKey: {
+      type: String,
+      default: "id",
+    },
+    // 默认查询参数
+    queryParams: {
+      type: Object,
+      default: () => ({}),
+    },
+    // 组件大小
+    size: {
+      type: String,
+      default: "mini",
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      default: "",
+    },
+    // 是否可读
+    readonly: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否禁止
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否清除
+    clearable: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否多选
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
+    // 需映射源数据
+    source: Object,
+    // 参照内外映射
+    dataMapping: Object,
+  },
+  components: {
+    TableDialog: () => import("./components/index.vue"),
+  },
+  data() {
+    return {
+      // popover宽度
+      width: "",
+      // 显示value
+      showValue: "",
+      // 选中data
+      data: [],
+    };
+  },
+  computed: {},
+  watch: {
+    "$props.value": {
+      handler: function (newProp, oldProp) {
+        if (!newProp) {
+          this.data = [];
+          this.showValue = "";
+        } else {
+          this.showValue = newProp;
+        }
+      },
+      immediate: true,
+    },
+  },
+  methods: {
+    // 打开弹窗
+    handleAsyncOpenDialog() {
+      this.$nextTick(() => {
+        const { setVisible } = this.$refs.TableDialogFef;
+        setVisible(true);
+      });
+    },
+    // 新增操作
+    handleAdd(prop) {
+      this.data = prop;
+      this.handleUpdate(this.data);
+    },
+    // 删除操作
+    handleDelete(prop) {
+      this.data.splice(prop, 1);
+      this.handleUpdate(this.data);
+    },
+    // 更新操作
+    handleUpdate(prop) {
+      const { source, multiple, valueKey, dataMapping } = this.$props;
+      // 多选
+      if (multiple) {
+        this.showValue = "";
+        this.$emit(
+          "input",
+          prop.map((item) => item[valueKey])
+        );
+      }
+      // 单选
+      if (!multiple) {
+        this.showValue = prop[0].name;
+        this.$emit("input", prop[0][valueKey]);
+        // 更新映射数据
+        for (let key in dataMapping) {
+          source[key] = prop[0][dataMapping[key]];
+        }
+        this.$emit("update:source", source);
+      }
+      //
+      this.$emit("change", prop, source);
+    },
+  },
+  created() {
+    this.$nextTick(() => {
+      const { clientWidth } = this.$refs.PopoverSelect;
+      this.width = clientWidth;
+    });
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <div ref="PopoverSelect" style="position: relative">
+    <el-input
+      v-model="showValue"
+      :size="size"
+      :disabled="disabled"
+      :clearable="clearable"
+      :placeholder="placeholder"
+      readonly
+      style="width: 100%; cursor: pointer"
+      @click.native.stop="handleAsyncOpenDialog"
+    >
+      <template #suffix>
+        <el-icon class="el-icon-more"></el-icon>
+      </template>
+    </el-input>
+    <div
+      v-if="multiple && data.length"
+      style="
+        position: absolute;
+        left: 10px;
+        top: 50%;
+        transform: translateY(-50%);
+        padding-right: 30px;
+        overflow: hidden;
+      "
+    >
+      <div style="width: 150px; display: flex">
+        <el-popover
+          :offset="-10"
+          :width="width"
+          :visible-arrow="false"
+          title=""
+          content=""
+          trigger="click"
+          placement="bottom-start"
+        >
+          <el-tag slot="reference" :size="size" style="margin-right: 10px">
+            + {{ data.length }}
+          </el-tag>
+          <el-tag
+            v-for="(item, index) in data"
+            :size="size"
+            hit
+            closable
+            style="
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
+              margin: 0 0 5px 0;
+            "
+            @close="handleDelete(index)"
+          >
+            {{ item.name }}
+          </el-tag>
+        </el-popover>
+      </div>
+    </div>
+    <table-dialog
+      ref="TableDialogFef"
+      :type="type"
+      :title="title"
+      :multiple="multiple"
+      :query-params="queryParams"
+      @confirm="handleAdd"
+    ></table-dialog>
+  </div>
+</template>
+<style scoped></style>

+ 63 - 50
src/main.js

@@ -1,70 +1,83 @@
-import Vue from 'vue'
+import Vue from "vue";
 
-import Cookies from 'js-cookie'
+import Cookies from "js-cookie";
 
-import Element from 'element-ui'
-import './assets/styles/element-variables.scss'
+import Element from "element-ui";
+import "./assets/styles/element-variables.scss";
 
-import '@/assets/styles/index.scss' // global css
-import '@/assets/styles/ruoyi.scss' // ruoyi css
-import App from './App'
-import store from './store'
-import router from './router'
-import directive from './directive' // directive
-import plugins from './plugins' // plugins
-import { download } from '@/utils/request'
+import "@/assets/styles/index.scss"; // global css
+import "@/assets/styles/ruoyi.scss"; // ruoyi css
+import App from "./App";
+import store from "./store";
+import router from "./router";
+import directive from "./directive"; // directive
+import plugins from "./plugins"; // plugins
+import { download } from "@/utils/request";
 
 // 时间格式化方法挂载
-import '@/views/marketing/utils/date';
+import "@/views/marketing/utils/date";
 
-import './assets/icons' // icon
-import './permission' // permission control
+import "./assets/icons"; // icon
+import "./permission"; // permission control
 import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
+import {
+  parseTime,
+  resetForm,
+  addDateRange,
+  selectDictLabel,
+  selectDictLabels,
+  handleTree,
+} from "@/utils/ruoyi";
 // 分页组件
 import Pagination from "@/components/Pagination";
 // 自定义表格工具组件
-import RightToolbar from "@/components/RightToolbar"
+import RightToolbar from "@/components/RightToolbar";
 // 富文本组件
-import Editor from "@/components/Editor"
+import Editor from "@/components/Editor";
 // 文件上传组件
-import FileUpload from "@/components/FileUpload"
+import FileUpload from "@/components/FileUpload";
 // 图片上传组件
-import ImageUpload from "@/components/ImageUpload"
+import ImageUpload from "@/components/ImageUpload";
 // 图片预览组件
-import ImagePreview from "@/components/ImagePreview"
+import ImagePreview from "@/components/ImagePreview";
 // 字典标签组件
-import DictTag from '@/components/DictTag'
+import DictTag from "@/components/DictTag";
 // 头部标签组件
-import VueMeta from 'vue-meta'
+import VueMeta from "vue-meta";
 // 字典数据组件
-import DictData from '@/components/DictData'
+import DictData from "@/components/DictData";
+//
+import PopoverSelect from "@/components/popover-select/index.vue";
+//
+import PopoverTreeSelect from "@/components/popover-tree-select/index.vue";
 
 // 全局方法挂载
-Vue.prototype.getDicts = getDicts
-Vue.prototype.getConfigKey = getConfigKey
-Vue.prototype.parseTime = parseTime
-Vue.prototype.resetForm = resetForm
-Vue.prototype.addDateRange = addDateRange
-Vue.prototype.selectDictLabel = selectDictLabel
-Vue.prototype.selectDictLabels = selectDictLabels
-Vue.prototype.download = download
-Vue.prototype.handleTree = handleTree
+Vue.prototype.getDicts = getDicts;
+Vue.prototype.getConfigKey = getConfigKey;
+Vue.prototype.parseTime = parseTime;
+Vue.prototype.resetForm = resetForm;
+Vue.prototype.addDateRange = addDateRange;
+Vue.prototype.selectDictLabel = selectDictLabel;
+Vue.prototype.selectDictLabels = selectDictLabels;
+Vue.prototype.download = download;
+Vue.prototype.handleTree = handleTree;
 
 // 全局组件挂载
-Vue.component('DictTag', DictTag)
-Vue.component('Pagination', Pagination)
-Vue.component('RightToolbar', RightToolbar)
-Vue.component('Editor', Editor)
-Vue.component('FileUpload', FileUpload)
-Vue.component('ImageUpload', ImageUpload)
-Vue.component('ImagePreview', ImagePreview)
+Vue.component("DictTag", DictTag);
+Vue.component("Pagination", Pagination);
+Vue.component("RightToolbar", RightToolbar);
+Vue.component("Editor", Editor);
+Vue.component("FileUpload", FileUpload);
+Vue.component("ImageUpload", ImageUpload);
+Vue.component("ImagePreview", ImagePreview);
+Vue.component("DrPopoverSelect", PopoverSelect);
+Vue.component("DrPopoverTreeSelect", PopoverTreeSelect);
 
-Vue.use(directive)
-Vue.use(plugins)
-Vue.use(VueMeta)
-DictData.install()
+Vue.use(directive);
+Vue.use(plugins);
+Vue.use(VueMeta);
+DictData.install();
 
 /**
  * If you don't want to use mock-server
@@ -76,14 +89,14 @@ DictData.install()
  */
 
 Vue.use(Element, {
-  size: Cookies.get('size') || 'medium' // set element-ui default size
-})
+  size: Cookies.get("size") || "medium", // set element-ui default size
+});
 
-Vue.config.productionTip = false
+Vue.config.productionTip = false;
 
 new Vue({
-  el: '#app',
+  el: "#app",
   router,
   store,
-  render: h => h(App)
-})
+  render: (h) => h(App),
+});

+ 11 - 31
src/utils/init/index.js

@@ -1,39 +1,19 @@
-import { arr2obj } from "../data-transform";
-
-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 };
-  });
+import Setting from "./setting";
+
+// 初始化模板
+export const initColumns = (arr) => {
+  return arr.map((element) => ({
+    ...element,
+    ...Setting(element.type),
+  }));
 };
-
 // 初始化参数
 export const initParams = (prop, key = "key", value = "value") =>
-  arr2obj(prop, key, value);
+  Object.fromEntries(prop.map((item) => [item[key], item[value]]));
 // 初始化字典
 export const initDicts = (prop) =>
-  prop
-    .filter((column) => column.type === "Select")
-    .map((column) => column.config.optionsName);
+
+  prop.filter((column) => column.referName).map((column) => column.referName);
 // 初始化校验
 export const initRules = (prop) => {
   const rules = {};

+ 33 - 0
src/utils/init/setting.js

@@ -0,0 +1,33 @@
+const Input = {};
+
+const Select = {};
+
+const PopoverSelect = {
+  readonly: true,
+  dataMapping: {},
+  queryParams: () => ({}),
+};
+
+const InputNumber = {
+  controlsPosition: "right",
+};
+
+const DatePicker = {
+  type: "date",
+};
+
+const Upload = {
+  value: [],
+};
+
+export default (prop) => {
+  return {
+    Input: Input,
+    Select: Select,
+    PopoverSelect: PopoverSelect,
+    PopoverMultipleSelect: PopoverSelect,
+    InputNumber: InputNumber,
+    DatePicker: DatePicker,
+    Upload: Upload,
+  }[prop];
+};

+ 121 - 202
src/views/business/spd/bo/basic/details.vue

@@ -5,74 +5,42 @@
     <el-row type="flex" class="row-bg" justify="space-around">
       <el-col :span="4">
         <div class="grid-content bg-purple">
-          <el-button
-            type="info"
-            plain
-            icon="el-icon-back"
-            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">
         <div class="grid-content bg-purple-light">
           <el-descriptions :colon="false" :size="medium">
             <el-descriptions-item>
-                <dev style="width: 200px; height: 60px; font-size: 18px" v-show="!showCustomer">{{form.basic.boName.split('-')[0] + '-' + form.basic.boName.split('-')[1].substring(0,2) + '******' + form.basic.boName.split('-')[1].substring(form.basic.boName.split('-')[1].length - 2,form.basic.boName.split('-')[1].length) + '-' + form.basic.boName.split('-')[2]}}</dev>
-                <dev style="width: 200px; height: 60px; font-size: 18px" v-show="showCustomer">{{form.basic.boName}}</dev>
-                <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton"/>
+              <dev style="width: 200px; height: 60px; font-size: 18px" v-show="!showCustomer">
+                {{ form.basic.boName.split('-')[0] + '-' + form.basic.boName.split('-')[1].substring(0, 2) + '******' +
+                  form.basic.boName.split('-')[1].substring(form.basic.boName.split('-')[1].length -
+                    2, form.basic.boName.split('-')[1].length) + '-' + form.basic.boName.split('-')[2] }}</dev>
+              <dev style="width: 200px; height: 60px; font-size: 18px" v-show="showCustomer">{{ form.basic.boName }}</dev>
+              <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton" />
             </el-descriptions-item>
             <el-descriptions-item label="商机状态:" style="margin-left:27px">
               <div v-for="dict in dict.type.mk_bo_state" v-if="form.basic.boState == dict.value">
-                <div>{{dict.label}}</div>
+                <div>{{ dict.label }}</div>
               </div>
             </el-descriptions-item>
             <el-descriptions-item label="赢丢单状态:">
               <div v-for="dict in dict.type.mk_bo_winstate" v-if="form.basic.winningState == dict.value">
-                {{dict.label}}
+                {{ dict.label }}
               </div>
             </el-descriptions-item>
           </el-descriptions>
         </div>
       </el-col>
       <el-col :span="6">
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-delete-solid"
-          size="small"
-          @click="handleWinningState('1','关闭')"
-          v-if="(showClose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boClose"
-          >关闭</el-button
-        >
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-close"
-          size="small"
-          @click="handleWinningState('2','丢单')"
-          v-if="(showLose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boLose"
-          >丢单</el-button
-        >
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-check"
-          size="small"
-          @click="handleWinningState('3','赢单')"
-          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-button type="info" plain icon="el-icon-delete-solid" size="small" @click="handleWinningState('1', '关闭')"
+          v-if="(showClose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boClose">关闭</el-button>
+        <el-button type="info" plain icon="el-icon-close" size="small" @click="handleWinningState('2', '丢单')"
+          v-if="(showLose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boLose">丢单</el-button>
+        <el-button type="info" plain icon="el-icon-check" size="small" @click="handleWinningState('3', '赢单')"
+          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>
     <!-- 主多页签 -->
@@ -82,7 +50,8 @@
         <el-divider content-position="left" style="font-size: 30px">
           <dev style="width: 50px; height: 40px; font-size: 18px">项目流程</dev>
         </el-divider>
-        <Process :key="timer" :form="form.basic" :boAuthority="boAuthority" :boStage="boStage" :dict="dict" @reload="reload"/>
+        <Process :key="timer" :form="form.basic" :boAuthority="boAuthority" :boStage="boStage" :dict="dict"
+          @reload="reload" />
         <!-- 基本信息 -->
         <el-divider content-position="left">
           <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
@@ -90,36 +59,37 @@
         <el-descriptions>
           <el-descriptions-item label="商机来源">
             <div v-for="dict in dict.type.mk_bo_source" v-if="form.basic.boSource == dict.value">
-              {{dict.label}}
+              {{ dict.label }}
             </div>
           </el-descriptions-item>
           <el-descriptions-item label="商机类型">
             <div v-for="dict in dict.type.mk_bo_type" v-if="form.basic.boType == dict.value">
-              {{dict.label}}
+              {{ dict.label }}
             </div>
           </el-descriptions-item>
           <el-descriptions-item label="客户">
             <dev v-show="!showCustomer">
-              {{form.basic.customerName.substring(0,2) + '******' + form.basic.customerName.substring(form.basic.customerName.length - 2,form.basic.customerName.length)}}
+              {{ form.basic.customerName.substring(0, 2) + '******' +
+                form.basic.customerName.substring(form.basic.customerName.length - 2, form.basic.customerName.length) }}
             </dev>
             <dev v-show="showCustomer">
-              {{form.basic.customerName}}
+              {{ form.basic.customerName }}
             </dev>
-            <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton"/>
+            <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton" />
           </el-descriptions-item>
           <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}}
+              {{ dict.label }}
             </div>
           </el-descriptions-item>
           <el-descriptions-item :label="estimate">
-            {{form.basic.hosDiscreetValue}}
+            {{ form.basic.hosDiscreetValue }}
           </el-descriptions-item>
           <el-descriptions-item label="赢单率">
-            {{form.basic.winningRate}}
+            {{ form.basic.winningRate }}
           </el-descriptions-item>
           <el-descriptions-item label="商机内容">
-            {{form.basic.boContent}}
+            {{ form.basic.boContent }}
           </el-descriptions-item>
         </el-descriptions>
         <!-- 其它信息 -->
@@ -128,58 +98,43 @@
         </el-divider>
         <el-descriptions>
           <el-descriptions-item label="销售组织">
-            {{form.basic.marketingOrganizingName}}
+            {{ form.basic.marketingOrganizingName }}
           </el-descriptions-item>
           <el-descriptions-item label="销售区域">
-            {{form.basic.marketingAreaName}}
+            {{ form.basic.marketingAreaName }}
           </el-descriptions-item>
           <el-descriptions-item label="部门">
-            {{form.basic.deptName}}
+            {{ form.basic.deptName }}
           </el-descriptions-item>
           <el-descriptions-item label="商机负责人">
-            {{form.basic.principalName}}
+            {{ form.basic.principalName }}
           </el-descriptions-item>
           <el-descriptions-item label="创建人">
-            {{form.basic.creatorName}}
+            {{ form.basic.creatorName }}
           </el-descriptions-item>
           <el-descriptions-item label="创建时间">
-            {{form.basic.createTime}}
+            {{ form.basic.createTime }}
           </el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 商机任务页签 -->
       <el-tab-pane label="商机任务" name="second">
-        <TaskList
-          :source="'BoDetails'"
-          :bo="this.form.basic"
-          :boAuthority="this.boAuthority"
-          v-if="masterTabs == 'second'"
-        />
+        <TaskList :source="'BoDetails'" :bo="this.form.basic" :boAuthority="this.boAuthority"
+          v-if="masterTabs == 'second'" />
       </el-tab-pane>
       <!-- 联系人页签 -->
       <el-tab-pane label="商机联系人" name="third">
-        <ContactList
-          :source="'BoDetails'"
-          :bo="this.form.basic"
-          :boAuthority="this.boAuthority"
-          v-if="masterTabs == 'third'"
-        />
+        <ContactList :source="'BoDetails'" :bo="this.form.basic" :boAuthority="this.boAuthority"
+          v-if="masterTabs == 'third'" />
       </el-tab-pane>
       <!-- 附件页签 -->
       <el-tab-pane label="附件信息" name="fourth">
-        <AccessoryList
-          :source="'BoDetails'"
-          :bo="this.form.basic"
-          :boAuthority="this.boAuthority"
-          v-if="masterTabs == 'fourth'"
-        />
+        <AccessoryList :source="'BoDetails'" :bo="this.form.basic" :boAuthority="this.boAuthority"
+          v-if="masterTabs == 'fourth'" />
       </el-tab-pane>
       <!-- 模板文件页签 -->
       <el-tab-pane label="模板文件下载" name="five">
-        <FileTemplate
-          :botype="form.basic.boType"
-          v-if="masterTabs == 'five'"
-        />
+        <FileTemplate :botype="form.basic.boType" v-if="masterTabs == 'five'" />
       </el-tab-pane>
     </el-tabs>
 
@@ -188,64 +143,46 @@
       <el-form ref="wsform" :model="winningStateData" :rules="winningStateDataRules" label-width="140px">
         <!-- 赢单 -->
         <el-form-item label="赢单日期" prop="winningStateDate" v-if="this.winningStateData.winningState == '3'">
-          <el-date-picker clearable
-            v-model="winningStateData.winningStateDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择赢单日期"
-            style="width:220px"
-            >
+          <el-date-picker clearable v-model="winningStateData.winningStateDate" type="date" value-format="yyyy-MM-dd"
+            placeholder="请选择赢单日期" style="width:220px">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="赢单金额(万元)" prop="winningStateMoney" v-if="this.winningStateData.winningState == '3'">
-          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="赢单金额"/>
+          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="赢单金额" />
         </el-form-item>
-        <el-form-item label="赢单原因" prop="winningStateCause"  v-if="this.winningStateData.winningState == '3'">
+        <el-form-item label="赢单原因" prop="winningStateCause" v-if="this.winningStateData.winningState == '3'">
           <el-select v-model="winningStateData.winningStateCause" placeholder="请输入">
-            <el-option
-              v-for="dict in dict.type.mk_bo_wincause"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.label"
-            ></el-option>
+            <el-option v-for="dict in dict.type.mk_bo_wincause" :key="dict.value" :label="dict.label"
+              :value="dict.label"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="赢单备注" prop="winningStateRemark" v-if="this.winningStateData.winningState == '3'">
-          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入赢单备注"/>
+          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入赢单备注" />
         </el-form-item>
         <!-- 丢单 -->
         <el-form-item label="丢单日期" prop="winningStateDate" v-if="this.winningStateData.winningState == '2'">
-          <el-date-picker clearable
-            v-model="winningStateData.winningStateDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="丢单日期"
-            style="width:220px"
-            >
+          <el-date-picker clearable v-model="winningStateData.winningStateDate" type="date" value-format="yyyy-MM-dd"
+            placeholder="丢单日期" style="width:220px">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="丢单金额(万元)" prop="winningStateMoney" v-if="this.winningStateData.winningState == '2'">
-          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="丢单金额"/>
+          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="丢单金额" />
         </el-form-item>
-        <el-form-item label="丢单原因" prop="winningStateCause"  v-if="this.winningStateData.winningState == '2'">
+        <el-form-item label="丢单原因" prop="winningStateCause" v-if="this.winningStateData.winningState == '2'">
           <el-select v-model="winningStateData.winningStateCause" placeholder="请输入">
-            <el-option
-              v-for="dict in dict.type.mk_bo_losecause"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.label"
-            ></el-option>
+            <el-option v-for="dict in dict.type.mk_bo_losecause" :key="dict.value" :label="dict.label"
+              :value="dict.label"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="丢单备注" prop="winningStateRemark" v-if="this.winningStateData.winningState == '2'">
-          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入丢单备注"/>
+          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入丢单备注" />
         </el-form-item>
         <!-- 关闭 -->
         <el-form-item label="关闭原因" prop="winningStateCause" v-if="this.winningStateData.winningState == '1'">
-          <el-input v-model="winningStateData.winningStateCause" style="width:220px" placeholder="关闭原因"/>
+          <el-input v-model="winningStateData.winningStateCause" style="width:220px" placeholder="关闭原因" />
         </el-form-item>
         <el-form-item label="关闭备注" prop="winningStateRemark" v-if="this.winningStateData.winningState == '1'">
-          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="关闭备注"/>
+          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="关闭备注" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,38 +192,21 @@
     </el-dialog>
 
     <!-- 分配商机负责人对话框 -->
-    <el-dialog
-      title="分配商机负责人"
-      :visible.sync="allocationPopover"
-      width="500px"
-      append-to-body
-    >
+    <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>
+          <dr-popover-select v-model="allocationForm.allocationStaffName" title="员工" type="CONTACTS_PARAM" :dataMapping="{
+            allocationStaff: 'id',
+            allocationStaffName: 'name',
+          }" :source.sync="allocationForm"></dr-popover-select>
         </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-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 type="primary" @click="submitAllocationForm">确 定</el-button>
         <el-button @click="cancelAllocation">取 消</el-button>
       </div>
     </el-dialog>
@@ -306,14 +226,13 @@ 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,DrInputDialog,},
+  components: { TaskList, ContactList, AccessoryList, FileTemplate, Process,},
   //平台枚举
   dicts: [
     "mk_bo_type",
@@ -336,7 +255,7 @@ export default {
       //赢单状态
       winningState: null,
       //赢单状态数据
-      winningStateData:{},
+      winningStateData: {},
       //赢单状态表单校验
       // 赢单表单校验
       winningStateDataRules: {
@@ -358,15 +277,15 @@ export default {
         accessory: [],
       },
       //权限数据
-      boAuthority:{},
+      boAuthority: {},
       //流程节点数据
-      boStage:[],
+      boStage: [],
       //关单按钮是否显示
-      showClose:false,
+      showClose: false,
       //赢单按钮是否显示
-      showWin:false,
+      showWin: false,
       //丢单按钮是否显示
-      showLose:false,
+      showLose: false,
       //重新加载子组件参数
       timer: "",
       //是否显示客户
@@ -387,16 +306,16 @@ export default {
       //分配弹窗
       allocationPopover: false,
       //营收总额
-      totalRevenue:"***营收总额",
+      totalRevenue: "***营收总额",
       //预估额
-      estimate:"***预估额(万元)",
+      estimate: "***预估额(万元)",
     };
   },
   watch: {
     'form.basic.boType': {
       handler(newVal, oldVal) {
-        console.log('newVal',newVal);
-        switch(newVal) {
+        console.log('newVal', newVal);
+        switch (newVal) {
           case '0':
             this.totalRevenue = "医院营收总额";
             this.estimate = "医院耗材预估值(万元)"
@@ -422,7 +341,7 @@ export default {
             this.estimate = "工程预估额(万元)"
             break;
           default:
-              break;
+            break;
         }
       },
       immediate: true,
@@ -455,7 +374,7 @@ export default {
       }
     },
     //赢单状态按钮
-    handleWinningState(winningState,title){
+    handleWinningState(winningState, title) {
       this.resetWinningStateData();
       this.winningStateOpen = true;
       this.winningStateTitle = title;
@@ -463,7 +382,7 @@ export default {
       this.winningStateData.boId = this.form.basic.id;
       this.winningStateData.winningStateDate = new Date();
     },
-    resetWinningStateData(){
+    resetWinningStateData() {
       this.winningStateData = {
         boId: null,
         winningState: null,
@@ -497,11 +416,11 @@ export default {
       // 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);
+      console.log('this.allocationForm', this.allocationForm);
       this.$refs["afform"].validate(valid => {
         if (valid) {
           allocationParticipant(this.allocationForm).then(response => {
-            console.log('response',response);
+            console.log('response', response);
             this.$modal.msgSuccess("分配成功");
             this.allocationPopover = false;
             this.reload();
@@ -514,7 +433,7 @@ export default {
       this.allocationPopover = false;
     },
     //重新加载数据
-    reload(){
+    reload() {
       //加载基础数据
       getBasic(this.$route.params.id).then((response) => {
         this.form.basic = response.data;
@@ -530,27 +449,27 @@ export default {
           var curNode = 0;
           var signContract = 999;
           for (var i = 0; i < this.boStage.length; i++) {
-            if(this.boStage[i].code == this.form.basic.boStage){
+            if (this.boStage[i].code == this.form.basic.boStage) {
               curNode = i;
             }
-            if(this.boStage[i].name.toString().includes('审核')){
+            if (this.boStage[i].name.toString().includes('审核')) {
               auditNode = i;
             }
-            if(this.boStage[i].name.toString().includes('合同')){
+            if (this.boStage[i].name.toString().includes('合同')) {
               signContract = i;
             }
           }
-          this.showClose=false;
-          this.showLose=false;
-          this.showWin=false;
-          if(curNode < auditNode){
-            this.showClose=true;
+          this.showClose = false;
+          this.showLose = false;
+          this.showWin = false;
+          if (curNode < auditNode) {
+            this.showClose = true;
           }
-          if(curNode > auditNode){
-            this.showLose=true;
+          if (curNode > auditNode) {
+            this.showLose = true;
           }
-          if(curNode >= signContract){
-            this.showWin=true;
+          if (curNode >= signContract) {
+            this.showWin = true;
           }
           //确定数据加载完成,子组件可以开始展示
           this.timer = new Date().getTime();
@@ -558,7 +477,7 @@ export default {
       });
     },
     //是否显示客户
-    customerButton(){
+    customerButton() {
       this.showCustomer = !this.showCustomer;
     },
   },
@@ -574,33 +493,33 @@ export default {
       //加载流程节点数据
       getBoNodeListByType(this.form.basic.boType).then(response => {
         this.boStage = response.rows;
-        console.log('this.boStage',this.boStage);
+        console.log('this.boStage', this.boStage);
         //赢丢单按钮显示逻辑
         var auditNode = 999;
         var curNode = 0;
         var signContract = 999;
         for (var i = 0; i < this.boStage.length; i++) {
-          if(this.boStage[i].code == this.form.basic.boStage){
+          if (this.boStage[i].code == this.form.basic.boStage) {
             curNode = i;
           }
-          if(this.boStage[i].name.toString().includes('审核')){
+          if (this.boStage[i].name.toString().includes('审核')) {
             auditNode = i;
           }
-          if(this.boStage[i].name.toString().includes('合同')){
+          if (this.boStage[i].name.toString().includes('合同')) {
             signContract = i;
           }
         }
-        this.showClose=false;
-        this.showLose=false;
-        this.showWin=false;
-        if(curNode < auditNode){
-          this.showClose=true;
+        this.showClose = false;
+        this.showLose = false;
+        this.showWin = false;
+        if (curNode < auditNode) {
+          this.showClose = true;
         }
-        if(curNode > auditNode){
-          this.showLose=true;
+        if (curNode > auditNode) {
+          this.showLose = true;
         }
-        if(curNode >= signContract){
-          this.showWin=true;
+        if (curNode >= signContract) {
+          this.showWin = true;
         }
         //确定数据加载完成,子组件可以开始展示
         this.timer = new Date().getTime();
@@ -612,35 +531,35 @@ export default {
 
 
 <style scoped>
-.md-content >>> .el-form-item {
+.md-content>>>.el-form-item {
   margin-bottom: 10px;
 }
 
-.md-content >>> .el-tabs--border-card > .el-tabs__content {
+.md-content>>>.el-tabs--border-card>.el-tabs__content {
   padding-bottom: 8px;
 }
 
-.md-content .md-auditInfo >>> .el-form-item {
+.md-content .md-auditInfo>>>.el-form-item {
   margin-bottom: 0px;
 }
 
-.md-main >>> .el-form-item,
-.md-vice >>> .el-form-item {
+.md-main>>>.el-form-item,
+.md-vice>>>.el-form-item {
   width: 100%;
   box-sizing: border-box;
 }
 
-.md-main >>> .el-form-item__label,
-.md-vice >>> .el-form-item__label {
+.md-main>>>.el-form-item__label,
+.md-vice>>>.el-form-item__label {
   width: 40%;
 }
 
-.md-main >>> .el-form-item__content,
-.md-md-vice >>> .el-form-item__content {
+.md-main>>>.el-form-item__content,
+.md-md-vice>>>.el-form-item__content {
   width: 60%;
 }
 
-.md-content >>> .el-form-item__label {
+.md-content>>>.el-form-item__label {
   font-weight: normal;
   /* text-align: left;
   width: 28%; */
@@ -656,11 +575,11 @@ export default {
   /* Firefox */
 }
 
-.md-main >>> .material-table {
+.md-main>>>.material-table {
   height: 100%;
 }
 
-.md-vice >>> .material-table {
+.md-vice>>>.material-table {
   height: 140px;
   overflow-y: auto;
   overflow-x: auto;

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

@@ -801,8 +801,9 @@ export default {
               this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
-        this.submitButtonEditStatus = false;
       });
     },
     /** 删除按钮操作 */

+ 13 - 5
src/views/business/spd/bo/basic/process.vue

@@ -308,7 +308,7 @@
               <div>{{dict.label}}</div>
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+          <el-descriptions-item label="医院耗材集采预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 项目立项 -->
@@ -389,8 +389,10 @@
           <el-row>
             <el-col :span="8">
               <el-form-item label="医院决策人" prop="hospitalDecisionMaker" >
-                <el-input v-model="form.consumablesBoFlow.hospitalDecisionMaker" />
+                <el-input v-model="form.consumablesBoFlow.hospitalDecisionMaker" v-show="decisionMakerDisplay"/>
+                <el-input :placeholder="form.consumablesBoFlow.hospitalDecisionMaker ? form.consumablesBoFlow.hospitalDecisionMaker[0] + new Array(form.consumablesBoFlow.hospitalDecisionMaker.length).join('*') : ''" v-show="!decisionMakerDisplay"/>
               </el-form-item>
+              <el-button size="mini" type="text" icon="el-icon-view" :disabled="false" @click="decisionMakerDisplay = !decisionMakerDisplay" v-show="!isUpdate"/>
             </el-col>
             <el-col :span="8">
               <el-form-item label="医院决策时间" prop="hospitalDecisionTime" >
@@ -614,8 +616,11 @@
           <el-row>
             <el-col :span="8">
               <el-form-item label="医院决策人" prop="hospitalDecisionMaker" >
-                <el-input v-model="form.medicalBoFlow.hospitalDecisionMaker" />
+                <!-- <el-input v-model="form.medicalBoFlow.hospitalDecisionMaker" /> -->
+                <el-input v-model="form.medicalBoFlow.hospitalDecisionMaker" v-show="decisionMakerDisplay"/>
+                <el-input :placeholder="form.medicalBoFlow.hospitalDecisionMaker ? form.medicalBoFlow.hospitalDecisionMaker[0] + new Array(form.medicalBoFlow.hospitalDecisionMaker.length).join('*') : ''" v-show="!decisionMakerDisplay"/>
               </el-form-item>
+              <el-button size="mini" type="text" icon="el-icon-view" :disabled="false" @click="decisionMakerDisplay = !decisionMakerDisplay" v-show="!isUpdate"/>
             </el-col>
             <el-col :span="8">
               <el-form-item label="医院决策时间" prop="hospitalDecisionTime" >
@@ -748,7 +753,7 @@
               <div>{{dict.label}}</div>
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+          <el-descriptions-item label="医院设备预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 项目立项 -->
@@ -978,7 +983,7 @@
               <div>{{dict.label}}</div>
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+          <el-descriptions-item label="军队医院设备预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 项目立项 -->
@@ -1537,6 +1542,8 @@ export default {
       isUpdate:false,
       //跟进记录参数
       behaviorParame:{},
+      //医院决策人是否显示
+      decisionMakerDisplay:false,
     };
   },
   created() {
@@ -1608,6 +1615,7 @@ export default {
     //修改按钮
     modifyButton() {
       this.isUpdate = true;
+      this.decisionMakerDisplay = true;
     },
     //取消按钮
     cancelButton() {

+ 8 - 1
src/views/business/spd/bo/behavior/behaviorList.vue

@@ -292,7 +292,7 @@
         </div>
       </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>
@@ -394,6 +394,8 @@ export default {
       },
       //当前操作状态
       operatingState: '',
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -559,6 +561,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           let formData = new FormData();
@@ -575,14 +578,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addBehavior(formData).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 9 - 2
src/views/business/spd/bo/contact/contactList.vue

@@ -35,7 +35,7 @@
           <dict-tag :options="dict.type.mk_bo_power" :value="scope.row.power"/>
         </template>
       </el-table-column>
-      <el-table-column label="业务爱好" align="center" prop="hobby" />
+      <el-table-column label="兴趣爱好" align="center" prop="hobby" />
       <el-table-column label="家庭地址" align="center" prop="address" />
       <el-table-column label="状态" align="center" prop="state" >
         <template slot-scope="scope">
@@ -332,7 +332,7 @@
         </div>
       </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>
@@ -444,6 +444,8 @@ export default {
       operatingState: '',
       //
       activeName: 'first',
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -577,6 +579,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -584,14 +587,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addContact(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 8 - 1
src/views/business/spd/bo/education/educationList.vue

@@ -122,7 +122,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -203,6 +203,8 @@ export default {
           );
         }
       },
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -283,6 +285,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -290,14 +293,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addEducation(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 8 - 1
src/views/business/spd/bo/pojpsn/pojpsnList.vue

@@ -152,7 +152,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -231,6 +231,8 @@ export default {
       },
       //职责列表
       mk_bo_pojpsn_job:[],
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -323,6 +325,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
@@ -330,14 +333,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addPojpsn(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 9 - 2
src/views/business/spd/bo/relationship/relationshipList.vue

@@ -113,7 +113,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -183,7 +183,9 @@ export default {
             trigger: "blur"
           }
         ],
-      }
+      },
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -266,6 +268,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -273,14 +276,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addRelationship(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 134 - 9
src/views/business/spd/bo/statement/index.vue

@@ -23,11 +23,17 @@
         />
       </el-form-item>
       <el-form-item label="商机来源" prop="boSource">
-        <el-input
+        <el-select
           v-model="queryParams.boSource"
           clearable
-          @keyup.enter.native="handleQuery"
-        />
+        >
+          <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>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -36,7 +42,7 @@
     </el-form>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="SPD商机" name="0">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -94,7 +100,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="耗材集采商机" name="1">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -160,7 +166,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="医疗耗材商机" name="2">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -242,7 +248,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="医疗设备商机" name="3">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -308,7 +314,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="军队医疗设备商机" name="4">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -373,6 +379,72 @@
           </el-table-column>
         </el-table>
       </el-tab-pane>
+      <el-tab-pane label="工程商机" name="5">
+        <el-table :data="boList" v-loading="loading">
+          <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="b500">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b500">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b500}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="商机审核" align="center" prop="b501" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b501">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b501}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="项目立项" align="center" prop="b502" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b502">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b502}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="考察" align="center" prop="b503" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b503">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b503}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="解决方案" align="center" prop="b504" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b504">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b504}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="投标与签合同" align="center" prop="b505" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b505">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b505}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="完成" align="center" prop="b599" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b599">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b599}}
+              </dev>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
     </el-tabs>
 
     <pagination
@@ -390,6 +462,10 @@
 import { listBasic } from "@/api/business/spd/bo/statement";
 
 export default {
+  dicts: [
+    "mk_bo_type",
+    "mk_bo_source",
+  ],
   data() {
     return {
       // 遮罩层
@@ -412,6 +488,7 @@ export default {
       activeName: '0',
       //分页参数
       total:0,
+      loading: true,
     };
   },
   created() {
@@ -429,6 +506,7 @@ export default {
       this.handleClick(e);
     },
     handleClick(e) {
+      this.loading = true;
       console.log('e',e);
       this.queryParams.boType = e.name;
       switch (e.name) {
@@ -438,7 +516,7 @@ export default {
             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);
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '0-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b000 = nodesfilter[0].day;
@@ -473,6 +551,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '1-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b100 = nodesfilter[0].day;
@@ -511,6 +590,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '2-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b200 = nodesfilter[0].day;
@@ -539,6 +619,10 @@ export default {
               if(nodesfilter.length > 0){
                 this.boList[i].b207 = nodesfilter[0].day;
               }
+              nodesfilter = nodes.filter(n => n.code == '2-08');
+              if(nodesfilter.length > 0){
+                this.boList[i].b208 = nodesfilter[0].day;
+              }
               nodesfilter = nodes.filter(n => n.code == '2-99');
               if(nodesfilter.length > 0){
                 this.boList[i].b299 = nodesfilter[0].day;
@@ -553,6 +637,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '3-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b300 = nodesfilter[0].day;
@@ -591,6 +676,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '4-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b400 = nodesfilter[0].day;
@@ -624,6 +710,45 @@ export default {
             this.loading = false;
           });
           break;
+        case "5":
+          listBasic(this.queryParams).then(response => {
+            this.boList = response.rows;
+            for(var i = 0;i < this.boList.length;i++){
+              var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
+              var nodesfilter = nodes.filter(n => n.code == '5-00');
+              if(nodesfilter.length > 0){
+                this.boList[i].b500 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-01');
+              if(nodesfilter.length > 0){
+                this.boList[i].b501 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-02');
+              if(nodesfilter.length > 0){
+                this.boList[i].b502 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-03');
+              if(nodesfilter.length > 0){
+                this.boList[i].b503 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-04');
+              if(nodesfilter.length > 0){
+                this.boList[i].b504 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-05');
+              if(nodesfilter.length > 0){
+                this.boList[i].b505 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-99');
+              if(nodesfilter.length > 0){
+                this.boList[i].b599 = nodesfilter[0].day;
+              }
+            }
+            this.total = response.total;
+            this.loading = false;
+          });
+          break;
         default:
           break;
       }

+ 15 - 8
src/views/business/spd/bo/statement/proportion/index.vue

@@ -12,7 +12,6 @@
       <el-form-item label="商机类型" prop="boType">
         <el-select
           v-model="queryParams.boType"
-          @change="boTypeChange"
           clearable
         >
           <el-option
@@ -105,7 +104,8 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        yearMonth: null,
+        // yearMonth: new Date().Format(),
+        yearMonth: new Date(),
         boType: null,
         boSource: null,
         deptName: null,
@@ -124,13 +124,14 @@ export default {
     /** 查询职责列表 */
     getList() {
       this.loading = true;
+      this.queryParams.yearMonth = this.queryParams.yearMonth.Format();
       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) + '%';}
+          if(item.passAuditRate){item.passAuditRate = this.accMul(item.passAuditRate,100) + '%';}
+          if(item.approveInitiateProjectRate){item.approveInitiateProjectRate = this.accMul(item.approveInitiateProjectRate,100) + '%';}
+          if(item.hangingRate){item.hangingRate = this.accMul(item.hangingRate , 100) + '%';}
+          if(item.contractSigningRate){item.contractSigningRate = this.accMul(item.contractSigningRate , 100) + '%';}
         }
         this.total = response.total;
         this.loading = false;
@@ -160,13 +161,13 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      console.log('this.queryParams',this.queryParams);
       this.queryParams.pageNum = 1;
       this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.yearMonth = new Date();
       this.handleQuery();
     },
     // 多选框选中数据
@@ -226,7 +227,13 @@ export default {
       this.download('pu/job/export', {
         ...this.queryParams
       }, `job_${new Date().getTime()}.xlsx`)
-    }
+    },
+    accMul(arg1,arg2){
+      var m=0,s1=arg1.toString(),s2=arg2.toString();
+      try{m+=s1.split(".")[1].length}catch(e){}
+      try{m+=s2.split(".")[1].length}catch(e){}
+      return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
+    },
   }
 };
 </script>

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

@@ -402,6 +402,7 @@
           type="primary"
           @click="submitForm"
           v-if="this.operatingState != 'Browse'"
+          :disabled="submitButtonEditStatus"
           >确 定</el-button
         >
         <el-button @click="cancel">取 消</el-button>
@@ -564,6 +565,8 @@ export default {
           );
         }
       },
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -683,21 +686,27 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate((valid) => {
+        console.log('valid',valid);
         if (valid) {
           if (this.form.id != null) {
             updateTask(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addTask(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

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

@@ -267,6 +267,7 @@
           :key="isUpdate"
         >
           <el-table-column type="selection" width="55" />
+          <el-table-column label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
           <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
           <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
           <el-table-column label="品名" align="center" prop="materialName" width="180px"/>
@@ -309,7 +310,6 @@
           <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
           <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
           <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
-          <el-table-column label="单据状态" align="center" prop="status"/>
           <el-table-column label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
@@ -326,7 +326,7 @@
           </el-table-column>
           <el-table-column label="有效期" align="center" prop="validityPeriod"/>
           <el-table-column label="有效期单位" align="center" prop="validityPeriodUnit" width="100px"/>
-          <el-table-column label="业务类型" align="center" prop="businessType"/>
+          <el-table-column label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
           <el-table-column label="安全库存量" align="center" prop="safetyStock" width="100px"/>
           <el-table-column label="单据来源" align="center" prop="billSource"/>
           <el-table-column label="行号" align="center" prop="rowNo"/>
@@ -393,6 +393,40 @@ export default {
   },
   data() {
     return {
+      hangStatus(row) {
+        switch (row.status) {
+          case '0':
+            return '需补货'
+          case '1':
+            return '待采购确认'
+          case '2':
+            return '采购已确认'
+          case '3':
+            return '采购已审核'
+          case '4':
+            return '行关闭'
+          case '5':
+            return '总供应可满足'
+        }
+      },
+      formatterBusinessType(row) {
+        switch (row.businessType) {
+          case 'ZQBH':
+            return '周期备货'
+          case 'FXXQ':
+            return '分销需求'
+          case 'TSXQ':
+            return '特殊采购需求'
+          case 'BDXQ':
+            return '补单需求'
+          case 'JJXQ':
+            return '紧急需求单'
+          case 'XPXQ':
+            return '新品需求'
+          case 'HZBM':
+            return '合作部门需求'
+        }
+      },
       isUpdate: false,
       expanded: false,
       // 页面配置

+ 68 - 200
src/views/purchase/apply/add/index.vue

@@ -13,7 +13,7 @@ export default {
   name: "AddDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -118,161 +118,70 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
-    <el-form
-      v-loading="loading"
-      :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
-      >
-        <div
-          slot="header"
-          style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          "
-        >
+          ">
           <h3>新增</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava"
-              >保 存</el-button
-            >
+            <el-button :size="size" type="danger" @click="handleSava">保 存</el-button>
             <el-button :size="size" type="info" @click="handleSubmit">
               新 增
             </el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <dr-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :title="column.title"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :source.sync="params"
-              >
-              </dr-input-dialog>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping" :source.sync="params">
+              </dr-popover-select>
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-view"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://sy.derom.com/document-center/fastdfs/upload"
-                multiple
-              >
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -285,83 +194,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
                 <template slot-scope="scope">
                   <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span
-                  >
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
-                    :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
-                    :source.sync="scope.row"
-                    :size="size"
-                  >
-                  </dr-input-dialog>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input-number>
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%"></el-input>
+                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                  </dr-popover-select>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
+                    style="width: 100%"></el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -370,9 +240,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 69 - 201
src/views/purchase/apply/edit/index.vue

@@ -17,7 +17,7 @@ export default {
   name: "EditDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -136,163 +136,72 @@ export default {
         // this.setVisible(false);
       }
     },
-    beforeOpen(){},
+    beforeOpen() { },
   },
   created() {
     console.log("ADD CREATED");
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
-    <el-form
-      v-loading="loading"
-      :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
-      >
-        <div
-          slot="header"
-          style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          "
-        >
+          ">
           <h3>编辑</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava"
-              >更 新</el-button
-            >
+            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <dr-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :source.sync="params"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :title="column.title"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :clearable="column.clearable"
-                :placeholder="column.placeholder"
-              >
-              </dr-input-dialog>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]" :source.sync="params"
+                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :title="column.title"
+                :disabled="column.disabled" :readonly="column.readonly" :clearable="column.clearable"
+                :placeholder="column.placeholder">
+              </dr-popover-select>
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-view"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://sy.derom.com/document-center/fastdfs/upload"
-                multiple
-              >
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -305,83 +214,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
                 <template slot-scope="scope">
                   <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span
-                  >
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
-                    :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
-                    :source.sync="scope.row"
-                    :size="size"
-                  >
-                  </dr-input-dialog>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input-number>
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%"></el-input>
+                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                  </dr-popover-select>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
+                    style="width: 100%"></el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -390,9 +260,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 68 - 200
src/views/purchase/catalogue/add/index.vue

@@ -13,7 +13,7 @@ export default {
   name: "AddDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -118,161 +118,70 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
-    <el-form
-      v-loading="loading"
-      :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
-      >
-        <div
-          slot="header"
-          style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          "
-        >
+          ">
           <h3>新增</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava"
-              >保 存</el-button
-            >
+            <el-button :size="size" type="danger" @click="handleSava">保 存</el-button>
             <el-button :size="size" type="info" @click="handleSubmit">
               新 增
             </el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <dr-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :title="column.title"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :source.sync="params"
-              >
-              </dr-input-dialog>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping" :source.sync="params">
+              </dr-popover-select>
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-view"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://sy.derom.com/document-center/fastdfs/upload"
-                multiple
-              >
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -285,83 +194,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
                 <template slot-scope="scope">
                   <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span
-                  >
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
-                    :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
-                    :source.sync="scope.row"
-                    :size="size"
-                  >
-                  </dr-input-dialog>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input-number>
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%"></el-input>
+                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                  </dr-popover-select>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
+                    style="width: 100%"></el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -370,9 +240,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 68 - 200
src/views/purchase/catalogue/edit/index.vue

@@ -17,7 +17,7 @@ export default {
   name: "EditDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -140,158 +140,67 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
-    <el-form
-      v-loading="loading"
-      :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
-      >
-        <div
-          slot="header"
-          style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          "
-        >
+          ">
           <h3>编辑</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava"
-              >更 新</el-button
-            >
+            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <dr-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :source.sync="params"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :title="column.title"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :clearable="column.clearable"
-                :placeholder="column.placeholder"
-              >
-              </dr-input-dialog>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]" :source.sync="params"
+                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :title="column.title"
+                :disabled="column.disabled" :readonly="column.readonly" :clearable="column.clearable"
+                :placeholder="column.placeholder">
+              </dr-popover-select>
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-view"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://sy.derom.com/document-center/fastdfs/upload"
-                multiple
-              >
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -304,83 +213,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
                 <template slot-scope="scope">
                   <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span
-                  >
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
-                    :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
-                    :source.sync="scope.row"
-                    :size="size"
-                  >
-                  </dr-input-dialog>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input-number>
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%"></el-input>
+                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                  </dr-popover-select>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
+                    style="width: 100%"></el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -389,9 +259,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 76 - 202
src/views/purchase/contract/add/index.vue

@@ -12,9 +12,8 @@ const NewTabColumns = TabColumns.map((element) => ({
 export default {
   name: "AddDrawer",
   dicts: initDicts(NewColumns),
-  components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
-  },
+
+  components: {},
   data() {
     return {
       size: "mini",
@@ -114,165 +113,81 @@ export default {
         // this.setVisible(false);
       }
     },
+
+
+
+
+    handleHide(PROP) {
+      console.log(1233123123, PROP);
+    },
   },
   created() {
     console.log("ADD CREATED");
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
-    <el-form
-      v-loading="loading"
-      :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
-      >
-        <div
-          slot="header"
-          style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          "
-        >
+          ">
           <h3>新增</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava"
-              >保 存</el-button
-            >
+            <el-button :size="size" type="danger" @click="handleSava">保 存</el-button>
             <el-button :size="size" type="info" @click="handleSubmit">
               新 增
             </el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <dr-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :title="column.title"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :source.sync="params"
-              >
-              </dr-input-dialog>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping" :source.sync="params">
+              </dr-popover-select>
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-view"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://sy.derom.com/document-center/fastdfs/upload"
-                multiple
-              >
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -285,83 +200,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
                 <template slot-scope="scope">
                   <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span
-                  >
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
-                    :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
-                    :source.sync="scope.row"
-                    :size="size"
-                  >
-                  </dr-input-dialog>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input-number>
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%"></el-input>
+                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size" @hide="handleHide">
+                  </dr-popover-select>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
+                    style="width: 100%"></el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -370,9 +246,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 68 - 200
src/views/purchase/contract/edit/index.vue

@@ -17,7 +17,7 @@ export default {
   name: "EditDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+    
   },
   data() {
     return {
@@ -140,158 +140,67 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
-    <el-form
-      v-loading="loading"
-      :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
-      >
-        <div
-          slot="header"
-          style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          "
-        >
+          ">
           <h3>编辑</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava"
-              >更 新</el-button
-            >
+            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <dr-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :source.sync="params"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :title="column.title"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :clearable="column.clearable"
-                :placeholder="column.placeholder"
-              >
-              </dr-input-dialog>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]" :source.sync="params"
+                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :title="column.title"
+                :disabled="column.disabled" :readonly="column.readonly" :clearable="column.clearable"
+                :placeholder="column.placeholder">
+              </dr-popover-select>
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%"></el-input>
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-view"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://sy.derom.com/document-center/fastdfs/upload"
-                multiple
-              >
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -304,83 +213,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
                 <template slot-scope="scope">
                   <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span
-                  >
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
-                    :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
-                    :source.sync="scope.row"
-                    :size="size"
-                  >
-                  </dr-input-dialog>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :size="size"
-                    style="width: 100%"
-                  ></el-input-number>
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%"></el-input>
+                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                  </dr-popover-select>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
+                    style="width: 100%"></el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -389,9 +259,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 1 - 0
src/views/purchase/deliveryAddress/add.vue

@@ -262,6 +262,7 @@ export default {
       if (this.referCondition.type == 'WAREHOUSE_PARAM') {
         this.houseOptions = selection
         this.basicForm.warehouseName = selection[0].name
+        this.basicForm.name = selection[0].name
         this.basicForm.warehouse = selection[0].id
       }
       if (this.referCondition.type == 'CONTACTS_PARAM') {

+ 97 - 76
src/views/purchase/purchase-order/add/column.js

@@ -2,7 +2,7 @@ export const Columns = [
   {
     key: "puOrgName",
     title: "采购组织",
-    type: "InputDialog",
+    type: "PopoverSelect",
     config: {
       componentName: "ORG_PARAM",
       dataMapping: {
@@ -16,9 +16,13 @@ export const Columns = [
     key: "billTypeName",
     title: "订单类型",
     type: "Select",
-    require: true,
+
     config: {
       optionsName: "sys_order_type", // 字典名
+      dataMapping: {
+        billType: "code",
+        billTypeName: "name",
+      },
     },
   },
   // { key: "billTypeName", title: "订单类型名称", },
@@ -33,7 +37,7 @@ export const Columns = [
   {
     key: "supplierName",
     title: "供应商",
-    type: "InputDialog",
+    type: "PopoverSelect",
     config: {
       componentName: "SUPPLIER_PARAM",
       dataMapping: {
@@ -46,7 +50,7 @@ export const Columns = [
   {
     key: "paymentAgreementName",
     title: "付款协议",
-    type: "InputDialog",
+    type: "PopoverSelect",
     config: {
       componentName: "PAYAGREEMENT_PARAM",
       dataMapping: {
@@ -58,7 +62,7 @@ export const Columns = [
   {
     key: "finalTypeName",
     title: "结算方式",
-    type: "InputDialog",
+    type: "PopoverSelect",
     config: {
       componentName: "BALATYPE_PARAM",
       dataMapping: {
@@ -70,7 +74,7 @@ export const Columns = [
   {
     key: "currencyName",
     title: "币种",
-    type: "InputDialog",
+    type: "PopoverSelect",
     config: {
       componentName: "CURRENCY_PARAM",
       dataMapping: {
@@ -82,14 +86,14 @@ export const Columns = [
   {
     key: "buyerName",
     title: "采购员",
-    type: "InputDialog",
+    type: "PopoverSelect",
     config: {
-      componentName: "ORG_PARAM",
+      componentName: "CONTACTS_PARAM",
       dataMapping: {
-        buyer: "userId",
-        buyerName: "userName",
-        puDept: "deptId",
-        puDeptName: "deptName",
+        buyer: "code",
+        buyerName: "name",
+        // puDept: "deptId",
+        // puDeptName: "deptName",
       },
     },
     require: true,
@@ -97,7 +101,7 @@ export const Columns = [
   {
     key: "puDeptName",
     title: "采购部门",
-    type: "InputDialog",
+    type: "PopoverSelect",
     config: {
       componentName: "DEPT_PARAM",
       dataMapping: {
@@ -110,8 +114,9 @@ export const Columns = [
   {
     key: "customerName",
     title: "收货客户",
-    type: "InputDialog",
+    type: "PopoverSelect",
     width: 200,
+    require: true,
     config: {
       componentName: "CUSTOMER_PARAM",
       dataMapping: {
@@ -152,7 +157,8 @@ export const Columns = [
   {
     key: "warehouseName",
     title: "WMS入库仓库", // 收货仓库
-    type: "InputDialog",
+    type: "PopoverSelect",
+    require: true,
     config: {
       componentName: "WAREHOUSE_PARAM",
       dataMapping: {
@@ -164,7 +170,8 @@ export const Columns = [
   {
     key: "goodsAllocationName",
     title: "货位",
-    type: "InputDialog",
+    type: "PopoverSelect",
+    require: true,
     config: {
       componentName: "ALLOCATION_PARAM",
       dataMapping: {
@@ -187,7 +194,7 @@ export const Columns = [
   {
     key: "customerDeptName",
     title: "客户部门",
-    type: "InputDialog",
+    type: "PopoverSelect",
     width: 200,
     config: {
       componentName: "CUSTOMERDEPT_PARAM",
@@ -200,7 +207,8 @@ export const Columns = [
   {
     key: "supplierContactsName",
     title: "供应商业务联系人",
-    type: "InputDialog",
+    type: "PopoverSelect",
+    require: true,
     config: {
       componentName: "SUPPLIERCONTACTS_PARAM",
       dataMapping: {
@@ -223,26 +231,40 @@ export const Columns = [
   //   key: "supplierPersonal",
   //   title: "供应商业务员",
   //   type: "Input",
-  //   // type: "InputDialog",
+  //   // type: "PopoverSelect",
   // },
-  { key: "supplierPersonalName", title: "供应商业务员名称", type: "Input", },
+  {
+    key: "supplierPersonalName",
+    title: "供应商业务员名称",
+    type: "PopoverSelect",
+    config: {
+      componentName: "SUPPLIERCONTACTS_PARAM",
+      dataMapping: {
+        supplierPersonal: "code",
+        supplierPersonalName: "name",
+      },
+    },
+    require: true,
+  },
   { key: "isDeliver", title: "是否发货", type: "Checkbox", },
   {
-    key: "retReason",
+    key: "retReasonName",
     title: "退换原因",
-    type: "InputDialog",
+    type: "PopoverSelect",
+    require: true,
     config: {
       componentName: "RETREASON_PARAM",
       dataMapping: {
         retReason: "code",
-        // retReasonName: "name",
+        retReasonName: "name",
       },
     },
   },
   {
     key: "processTypeName",
     title: "处理方式",
-    type: "InputDialog",
+    type: "PopoverSelect",
+    require: true,
     config: {
       componentName: "PROCESSTYPE_PARAM",
       dataMapping: {
@@ -253,26 +275,28 @@ export const Columns = [
   },
   { key: "isEnd", title: "整单关闭标识", type: "Input", },
   {
-    key: "projectNow",
+    key: "projectNowName",
     title: "在建工程项目",
-    type: "InputDialog",
+    type: "PopoverSelect",
+    require: true,
     config: {
       componentName: "PROJECT_PARAM",
       dataMapping: {
         projectNow: "code",
-        // processTypeName: "name",
+        projectNowName: "name",
       },
     },
   },
   {
-    key: "operatingItems",
+    key: "operatingItemsName",
     title: "经营性项目",
-    type: "InputDialog",
+    type: "PopoverSelect",
+    require: true,
     config: {
       componentName: "OPERATING_PARAM",
       dataMapping: {
         operatingItems: "code",
-        // processTypeName: "name",
+        operatingItemsName: "name",
       },
     },
   },
@@ -306,15 +330,15 @@ export const TabColumns = [
     title: '物料信息',
     key: 'puOrderItemList',
     tableColumns: [
-      // { key: "id", title: "主键" },
       { key: "rowNo", title: "行号", type: "Input", },
-      { key: "orderId", title: "采购订单ID", type: "Input", },
+      { key: "orderId", title: "采购订单ID", type: "Input", width: 180 },
       // {key: "material",title: "物料",type: "Input",   },
-      { key: "materialName", title: "物料名称", type: "Input", },
+      { key: "materialName", title: "物料", type: "Input", width: 180 },
       {
         key: "materialCode",
         title: "物料编码",
-        type: "InputDialog",
+        type: "PopoverSelect",
+        width: 180,
         config: {
           componentName: "MATERIAL_PARAM",
           dataMapping: {
@@ -324,13 +348,13 @@ export const TabColumns = [
           },
         },
       },
-      { key: "materialClassify", title: "物料分类", type: "Input", },
-      { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", },
-      { key: "specification", title: "规格", type: "Input", },
+      { key: "materialClassify", title: "物料分类", type: "Input", width: 180 },
+      { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", width: 180 },
+      { key: "specification", title: "规格", type: "Input", width: 180 },
       { key: "model", title: "型号", type: "Input", },
-      { key: "isMedcine", title: "医药物料", type: "Input", },
-      { key: "manufacturer", title: "生产厂家代理人", type: "Input", },
-      { key: "isDrug", title: "物料药品属性", type: "Input", },
+      { key: "isMedcine", title: "医药物料", type: "Input", width: 180 },
+      { key: "manufacturer", title: "生产厂家代理人", type: "Input", width: 180 },
+      { key: "isDrug", title: "物料药品属性", type: "Input", width: 180 },
       { key: "unit", title: "单位", type: "Input", },
       { key: "qty", title: "数量", type: "Input", },
       { key: "taxPrice", title: "含税单价", type: "Input", },
@@ -345,11 +369,11 @@ export const TabColumns = [
       { key: "isInvoice", title: "开票关闭", type: "Input", },
       { key: "isArrival", title: "到货关闭", type: "Input", },
       { key: "isPayment", title: "付款关闭", type: "Input", },
-      { key: "isGift", title: "赠品", type: "Input", },
+      { key: "isGift", title: "赠品", type: "Input", width: 180 },
       {
         key: "warehouseName",
         title: "收货仓库", //WMS入库仓库
-        type: "InputDialog",
+        type: "PopoverSelect",
         config: {
           componentName: "WAREHOUSE_PARAM",
           dataMapping: {
@@ -359,13 +383,13 @@ export const TabColumns = [
         },
         width: 200,
       },
-      { key: "place", title: "收货地点", type: "Input", },
-      { key: "address", title: "收货地址", type: "Input", },
-      { key: "productBatch", title: "产品批号", type: "Input", },
-      { key: "manufactureDate", title: "生产日期", type: "Input", },
-      { key: "efficacyLoseDate", title: "有效期至/失效日期", type: "Input", },
-      { key: "approvalNumber", title: "批准文号", type: "Input", },
-      { key: "registration", title: "注册证号", type: "Input", },
+      { key: "place", title: "收货地点", type: "Input", width: 180 },
+      { key: "address", title: "收货地址", type: "Input", width: 180 },
+      { key: "productBatch", title: "产品批号", type: "Input", width: 180 },
+      { key: "manufactureDate", title: "生产日期", type: "Input", width: 180 },
+      { key: "efficacyLoseDate", title: "有效期至/失效日期", type: "Input", width: 180 },
+      { key: "approvalNumber", title: "批准文号", type: "Input", width: 180 },
+      { key: "registration", title: "注册证号", type: "Input", width: 180 },
 
       {
         key: "storageCondition",
@@ -374,6 +398,7 @@ export const TabColumns = [
         config: {
           optionsName: "sys_storage_condition",
         },
+        width: 180
       },
       {
         key: "carriageCondition",
@@ -382,6 +407,7 @@ export const TabColumns = [
         config: {
           optionsName: "sys_conditions_carriage",
         },
+        width: 180
       },
 
       { key: "isBatchLock", title: "批号锁定标识", type: "Input", },
@@ -389,16 +415,16 @@ export const TabColumns = [
       { key: "isUrgency", title: "紧急标识", type: "Input", },
       { key: "originalQty", title: "原始数量", type: "Input", },
       { key: "originalMoney", title: "原始金额", type: "Input", },
-      { key: "directProductBatch", title: "直运产品批号", type: "Input", },
-      { key: "discountRule", title: "折扣规则编码", type: "Input", },
+      { key: "directProductBatch", title: "直运产品批号", type: "Input", width: 180 },
+      { key: "discountRule", title: "折扣规则编码", type: "Input", width: 180 },
       { key: "reservedQty", title: "预留数量", type: "Input", },
       { key: "reservedPeriod", title: "预留周期", type: "Input", },
       { key: "taxDeductClassify", title: "扣税类别", type: "Input", },
       { key: "exchangeRate", title: "折本汇率", type: "Input", },
-      { key: "source", title: "上游单据号", type: "Input", },
-      { key: "sourceId", title: "上游单据ID", type: "Input", },
-      { key: "demandCode", title: "采购需求单号", type: "Input", },
-      { key: "arrivalDatePlan", title: "计划到货日期", type: "Input", },
+      { key: "source", title: "上游单据号", type: "Input", width: 180 },
+      { key: "sourceId", title: "上游单据ID", type: "Input", width: 180 },
+      { key: "demandCode", title: "采购需求单号", type: "Input", width: 180 },
+      { key: "arrivalDatePlan", title: "计划到货日期", type: "Input", width: 180 },
       {
         key: "priceType",
         title: "价格类型",
@@ -410,14 +436,10 @@ export const TabColumns = [
       { key: "isDistributionPrice", title: "配送价", type: "Input", },
       { key: "createByName", title: "创建人名称", type: "Input", },
       { key: "updateByName", title: "更新人名称", type: "Input", },
-      // { key: "materialClassifyOne", title: "物料一级分类",type: "Input", },
-      { key: "materialClassifyOneName", title: "物料一级分类名称", type: "Input", },
-      // { key: "materialClassifyTwo", title: "物料二级分类",type: "Input", },
-      { key: "materialClassifyTwoName", title: "物料二级分类名称", type: "Input", },
-      // { key: "materialClassifyThree", title: "物料三级分类",type: "Input", },
-      { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", },
-      // { key: "materialClassifyFour", title: "物料四级分类",type: "Input", },
-      { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", },
+      { key: "materialClassifyOneName", title: "物料一级分类名称", type: "Input", width: 180 },
+      { key: "materialClassifyTwoName", title: "物料二级分类名称", type: "Input", width: 180 },
+      { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", width: 180 },
+      { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", width: 180 },
       { key: "price", title: "无税单价", type: "Input", }
     ]
   },
@@ -425,33 +447,32 @@ export const TabColumns = [
     title: '执行结果',
     key: 'puOrderExecuteList',
     tableColumns: [
-      // { key: "id", title: "主键",type: "Input", },
-      { key: "orderId", title: "采购订单ID", type: "Input", },
+      { key: "orderId", title: "采购订单ID", type: "Input", width: 180 },
       { key: "rowno", title: "行号", type: "Input", },
       {
         key: "materialName",
         title: "物料",
-        type: "InputDialog",
+        type: "PopoverSelect",
         config: {
           componentName: "MATERIAL_PARAM",
           dataMapping: {
             material: "id",
             materialName: "name",
-            // materialCode: "code",
+            materialCode: "code",
           },
         },
+        width: 180
       },
-      // { key: "materialName", title: "物料名称", type: "Input", },
       { key: "specification", title: "规格", type: "Input", },
       { key: "qty", title: "数量", type: "Input", },
-      { key: "stroageQty", title: "累计到货主数量", type: "Input", },
-      { key: "stockQty", title: "累计入库主数量", type: "Input", },
-      { key: "invoiceQty", title: "累计开票主数量", type: "Input", },
-      { key: "rollbackQty", title: "累计退货主数量", type: "Checkbox", },
-      { key: "backStockQty", title: "累计退库主数量", type: "Input", },
-      { key: "floatQty", title: "未到货数量", type: "Input", },
-      { key: "createByName", title: "创建人名称", type: "Input", },
-      { key: "updateByName", title: "更新人名称", type: "Input", },
+      { key: "stroageQty", title: "累计到货主数量", type: "Input", width: 120 },
+      { key: "stockQty", title: "累计入库主数量", type: "Input", width: 120 },
+      { key: "invoiceQty", title: "累计开票主数量", type: "Input", width: 120 },
+      { key: "rollbackQty", title: "累计退货主数量", type: "Input", width: 120 },
+      { key: "backStockQty", title: "累计退库主数量", type: "Input", width: 120 },
+      { key: "floatQty", title: "未到货数量", type: "Input", width: 120 },
+      { key: "createByName", title: "创建人名称", type: "Input", width: 120 },
+      { key: "updateByName", title: "更新人名称", type: "Input", width: 120 },
     ]
   },
 ];

+ 326 - 126
src/views/purchase/purchase-order/add/index.vue

@@ -9,18 +9,17 @@ const NewTabColumns = TabColumns.map((element) => ({
   tableColumns: initColumns(element.tableColumns),
 }));
 
-const SelectColumns = NewColumns.filter(column => column.type === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === 'Select'))
+const SelectColumns = NewColumns.filter((column) => column.type === "Select");
+NewTabColumns.forEach((column) => {
+  SelectColumns.push(
+    ...column.tableColumns.filter((cColumn) => cColumn.type === "Select")
+  );
 });
 
-
 export default {
   name: "AddPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
-  components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
-  },
+  components: {},
 
   data() {
     return {
@@ -40,15 +39,29 @@ export default {
     };
   },
   computed: {},
-  watch: {},
+  watch: {
+    "params.puOrderItemList": {
+      handler(nVal, oVal) {
+        this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
+        console.log("params", this.params);
+      },
+      deep: true,
+    },
+    "params.puOrderExecuteList": {
+      handler(nVal, oVal) {
+        this.handleSynchronousMaterial("puOrderExecuteList", "puOrderItemList");
+      },
+      deep: true,
+    },
+  },
   methods: {
     beforeOpen() {
-      const { deptName, deptId, name, id, orgName, orgId } =
+      const { deptName, deptId, name, nickName, orgName, orgId } =
         this.$store.state.user;
       this.params.puOrg = orgId;
       this.params.puOrgName = orgName;
-      this.params.buyer = id;
-      this.params.buyerName = name;
+      this.params.buyer = name;
+      this.params.buyerName = nickName;
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
     },
@@ -57,14 +70,45 @@ export default {
     },
     // 增行
     addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
+      for (const key in this.params) {
+        if (Array.isArray(this.params[key])) {
+          const arr = this.tabColumns.find(
+            (element) => element.key === key
+          ).tableColumns;
+
+          let rowData = initParams(arr, "key", "value");
+
+          "rowno" in rowData &&
+            (rowData["rowno"] = this.params[key].length + 1);
+          "rowNo" in rowData &&
+            (rowData["rowNo"] = this.params[key].length + 1);
+
+          this.params[key].push(rowData);
+        }
+      }
+
+      // const arr = this.tabColumns.find(
+      //   (element) => element.key === this.tabName
+      // ).tableColumns;
+      // prop.push(initParams(arr, "key", "value"));
     },
     // 删行
     delTableRow(prop, index) {
-      prop.splice(index, 1);
+      for (const key in this.params) {
+        if (Array.isArray(this.params[key])) {
+          this.params[key].splice(index, 1);
+        }
+      }
+      // prop.splice(index, 1);
+    },
+    // 同步子表物料
+    handleSynchronousMaterial(key1, key2) {
+      // this.params[key1]-- -> this.params[key2]
+      this.params[key1].forEach((item, index) => {
+        this.params[key2][index].material = item.material;
+        this.params[key2][index].materialName = item.materialName;
+        this.params[key2][index].materialCode = item.materialCode;
+      });
     },
     // 取消
     handleCancel() {
@@ -73,8 +117,10 @@ export default {
     },
     // 保存
     async handleSava() {
-      // this.setVisible(false);
-      console.log(this.params, 'params');
+      // orderAddForm
+      console.log(this.params, "params");
+      // this.$refs['orderAddForm'].validate(async (valid) => {
+      //   if (valid) {
       try {
         const { code, msg } = await orderApi.create(this.params);
         if (code === 200) {
@@ -88,106 +134,212 @@ export default {
       } finally {
         // this.setVisible(false);
       }
-
-
-
+      // } else {
+      //   console.log('error submit!!');
+      //   return false;
+      // }
+      // });
     },
     // 保存并新增
-    async handleSubmit() {
-      try {
-        const createById = this.params.buyer;
-        const createByName = this.params.buyerName;
-        const updateById = this.$store.state.user.id;
-        const updateByName = this.$store.state.user.name;
-        const { code, msg } = await orderApi.create({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
+    handleSubmit() {
+      this.$refs["orderAddForm"].validate(async (valid) => {
+        if (valid) {
+          try {
+            const createById = this.params.buyer;
+            const createByName = this.params.buyerName;
+            const updateById = this.$store.state.user.id;
+            const updateByName = this.$store.state.user.name;
+            const { code, msg } = await orderApi.create({
+              createById,
+              createByName,
+              updateById,
+              updateByName,
+              ...this.params,
+            });
+            if (code === 200) {
+              this.$notify.success({ title: msg });
+              this.setVisible(false);
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            this.$notify.error({ title: "error", message: err });
+          } finally {
+            // this.setVisible(false);
+          }
         } else {
-          this.$notify.warning({ title: msg });
+          console.log("error submit!!");
+          return false;
         }
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        // this.setVisible(false);
-      }
+      });
     },
   },
   created() {
-    console.log("ADD CREATED");
+    console.log("ADD CREATED", this.params);
   },
-  mounted() { },
-  destroyed() { },
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form size="mini" label-position="right" label-width="135px" :model="params" :rules="rules">
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+  >
+    <el-form
+      size="mini"
+      label-position="right"
+      ref="orderAddForm"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          ">
+          "
+        >
           <h3>新增</h3>
           <div style="text-align: right">
             <el-button size="mini" @click="handleCancel">取消</el-button>
-            <el-button size="mini" type="danger" @click="handleSava">保存</el-button>
+            <el-button size="mini" type="danger" @click="handleSava"
+              >保存</el-button
+            >
             <el-button size="mini" type="info" @click="handleSubmit">
               保存并新增
             </el-button>
           </div>
         </div>
         <el-row>
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
+          <el-col
+            v-for="(column, index) in columns"
+            :key="index"
+            :span="column.span || 6"
+          >
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
-              <dr-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping" :query-params="column.config.queryParams" :source.sync="params">
-              </dr-input-dialog>
-              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
-              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
-              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
-                  :value="item.value">
+              <el-input
+                v-if="column.type === 'Input'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input>
+              <dr-popover-select
+                v-if="column.type === 'PopoverSelect'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                :readonly="column.readonly"
+                :title="column.title"
+                :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping"
+                :query-params="column.config.queryParams"
+                :source.sync="params"
+              >
+              </dr-popover-select>
+              <el-input
+                v-if="column.type === 'Textarea'"
+                v-model="params[column.key]"
+                type="textarea"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input>
+              <el-input-number
+                v-if="column.type === 'InputNumber'"
+                v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
+              </el-input-number>
+              <el-select
+                v-if="column.type === 'Select'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in dict.type[column.config.optionsName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+              <el-select
+                v-if="column.type === 'TagSelect'"
+                v-model="params[column.key]"
+                multiple
+                clearable
+                collapse-tags
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
                 <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+                  <el-icon
+                    class="el-icon-view"
+                    style="cursor: pointer"
+                    @click.stop="$message.info(234)"
+                  ></el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
+              <el-date-picker
+                v-if="column.type === 'DatePicker'"
+                v-model="params[column.key]"
+                :type="column.config.type"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                :picker-options="column.pickerOptions"
+                style="width: 100%"
+              >
               </el-date-picker>
-              <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                false-label="N"></el-checkbox>
-              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://jsonplaceholder.typicode.com/posts/" multiple>
+              <el-checkbox
+                v-else-if="column.type === 'Checkbox'"
+                v-model="params[column.key]"
+                true-label="Y"
+                false-label="N"
+              ></el-checkbox>
+              <el-upload
+                v-if="column.type === 'Upload'"
+                :file-list="params[column.key]"
+                :disabled="column.disabled"
+                drag
+                action="https://jsonplaceholder.typicode.com/posts/"
+                multiple
+              >
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -200,56 +352,102 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
+
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+          position: 'relative',
+        }"
+        style="margin: 10px"
+      >
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
             <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width">
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width || 80"
+              >
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}
                   </el-tag>
-                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%"></el-input>
-                  <dr-input-dialog v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" size="mini">
-                  </dr-input-dialog>
-                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini" style="width: 100%">
+                  <el-input
+                    v-if="cColumn.type === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    size="mini"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-popover-select
+                    v-if="cColumn.type === 'PopoverSelect'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly"
+                    :title="cColumn.title"
+                    :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping"
+                    :source.sync="scope.row"
+                    size="mini"
+                  >
+                  </dr-popover-select>
+                  <el-input-number
+                    v-if="cColumn.type === 'InputNumber'"
+                    v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    size="mini"
+                    style="width: 100%"
+                  >
                   </el-input-number>
-                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
-                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
-                      :value="item.value">
+                  <el-select
+                    v-if="cColumn.type === 'Select'"
+                    v-model="params[cColumn.key]"
+                    :placeholder="column.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in dict.type[cColumn.config.optionsName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
                     </el-option>
                   </el-select>
-                  <el-checkbox v-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
-                    false-label="N"></el-checkbox>
-                  <!-- <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                    :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                    :readonly="column.readonly" style="width: 100%; cursor: pointer">
-                    <template #suffix>
-                      <el-icon class="el-icon-thumb"></el-icon>
-                    </template>
-                  </el-input> -->
+                  <el-checkbox
+                    v-else-if="cColumn.type === 'Checkbox'"
+                    v-model="params[cColumn.key]"
+                    true-label="Y"
+                    false-label="N"
+                  ></el-checkbox>
                 </template>
               </el-table-column>
-              <el-table-column fixed="right" label="操作" width="120">
+              <el-table-column fixed="right" label="操作" width="80">
                 <template slot-scope="scope">
-                  <el-button @click.native.prevent="
-                    delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
+                  <el-button
+                    @click.native.prevent="
+                      delTableRow(params[tabName], scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                  >
                     删行
                   </el-button>
                 </template>
@@ -258,7 +456,9 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button size="mini" @click="addTableRow(params[tabName])">增行</el-button>
+          <el-button size="mini" @click="addTableRow(params[tabName])"
+            >增行</el-button
+          >
         </el-row>
       </el-card>
     </el-form>

+ 170 - 170
src/views/purchase/purchase-order/column.js

@@ -1,179 +1,179 @@
 export const TableColumns = [
-   // { key: "id", title: "主键" },
-      // { key: "puOrg", title: "采购组织" },
-      { key: "puOrgName", title: "采购组织名称",search: true, type: "Input"  },
-      { key: "billType", title: "订单类型" },
-      { key: "code", title: "订单编号",search: true, type: "Input"  },
-      { key: "billDate", title: "订单日期" },
-      // { key: "supplier", title: "供应商" },
-      { key: "supplierName", title: "供应商名称",search: true, type: "Input" },
-      { key: "paymentAgreement", title: "付款协议" },
-      // { key: "currency", title: "币种" },
-      { key: "currencyName", title: "币种名称" },
-      // { key: "buyer", title: "采购员" },
-      { key: "buyerName", title: "采购员" },
-      // { key: "puDept", title: "采购部门" },
-      { key: "puDeptName", title: "采购部门名称" },
-      // { key: "customer", title: "收货客户" },
-      { key: "customerName", title: "收货客户名称" },
-      { key: "isDeliver", title: "是否发货" },
-      { key: "isArrival", title: "到货超期" },
-      { key: "isBack", title: "退货" },
-      // { key: "freezeCause", title: "冻结原因" },
-      { key: "qty", title: "总数量" },
-      { key: "money", title: "总数量" },
-      { key: "isMarketing", title: "已协同生成销售订单" },
-      { key: "isMarketingSource", title: "由销售订单协同生成" },
-      // { key: "personal", title: "人员" },
-      { key: "personalName", title: "人员名称" },
-      // { key: "isSendSrm", title: "是否同步SRM" },
-      { key: "isInvoice", title: "发票标识" },
-      { key: "rebateMoney", title: "订单使用返利金额" },
-      { key: "deductionMoney", title: "订单抵扣余款金额" },
-      // { key: "warehouse", title: "WMS入库仓库" },
-      { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
-      // { key: "goodsAllocation", title: "货位" },
-      { key: "goodsAllocationName", title: "货位名称" },
-      // { key: "customerDept", title: "客户部门" },
-      { key: "customerDeptName", title: "客户部门名称" },
-      // { key: "supplierContacts", title: "供应商业务联系人" },
-      { key: "supplierContactsName", title: "供应商业务联系人名称" },
-      { key: "isUrgency", title: "紧急程度" },
-      // { key: "agent", title: "代理人" }, // 建议删除
-      { key: "agentName", title: "代理人名称" },
-      { key: "isClose", title: "最终关闭" },
-      { key: "applyPaymentMoney", title: "累计付款申请金额" },
-      { key: "paymentMoney", title: "累计付款金额" },
-      { key: "invoiceMoney", title: "发票金额" },
-      // { key: "supplierPersonal", title: "供应商业务员" },
-      { key: "supplierPersonalName", title: "供应商业务员名称" },
-      { key: "marketingCode", title: "销售订单号" },
+  // { key: "id", title: "主键" },
+  // { key: "puOrg", title: "采购组织" },
+  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
+  { key: "billType", title: "订单类型" },
+  { key: "code", title: "订单编号", search: true, type: "Input" },
+  { key: "billDate", title: "订单日期" },
+  // { key: "supplier", title: "供应商" },
+  { key: "supplierName", title: "供应商名称", search: true, type: "Input" },
+  { key: "paymentAgreement", title: "付款协议" },
+  // { key: "currency", title: "币种" },
+  { key: "currencyName", title: "币种名称" },
+  // { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员" },
+  // { key: "puDept", title: "采购部门" },
+  { key: "puDeptName", title: "采购部门名称" },
+  // { key: "customer", title: "收货客户" },
+  { key: "customerName", title: "收货客户名称" },
+  { key: "isDeliver", title: "是否发货" },
+  { key: "isArrival", title: "到货超期" },
+  { key: "isBack", title: "退货" },
+  // { key: "freezeCause", title: "冻结原因" },
+  { key: "qty", title: "总数量" },
+  { key: "money", title: "总数量" },
+  { key: "isMarketing", title: "已协同生成销售订单" },
+  { key: "isMarketingSource", title: "由销售订单协同生成" },
+  // { key: "personal", title: "人员" },
+  { key: "personalName", title: "人员名称" },
+  // { key: "isSendSrm", title: "是否同步SRM" },
+  { key: "isInvoice", title: "发票标识" },
+  { key: "rebateMoney", title: "订单使用返利金额" },
+  { key: "deductionMoney", title: "订单抵扣余款金额" },
+  // { key: "warehouse", title: "WMS入库仓库" },
+  { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
+  // { key: "goodsAllocation", title: "货位" },
+  { key: "goodsAllocationName", title: "货位名称" },
+  // { key: "customerDept", title: "客户部门" },
+  { key: "customerDeptName", title: "客户部门名称" },
+  // { key: "supplierContacts", title: "供应商业务联系人" },
+  { key: "supplierContactsName", title: "供应商业务联系人名称" },
+  { key: "isUrgency", title: "紧急程度" },
+  // { key: "agent", title: "代理人" }, // 建议删除
+  { key: "agentName", title: "代理人名称" },
+  { key: "isClose", title: "最终关闭" },
+  { key: "applyPaymentMoney", title: "累计付款申请金额" },
+  { key: "paymentMoney", title: "累计付款金额" },
+  { key: "invoiceMoney", title: "发票金额" },
+  // { key: "supplierPersonal", title: "供应商业务员" },
+  { key: "supplierPersonalName", title: "供应商业务员名称" },
+  { key: "marketingCode", title: "销售订单号" },
+  // { key: "tenantId", title: "租户号" },
+  // { key: "revision", title: "乐观锁" },
+  { key: "createByName", title: "创建人名称" },
+  { key: "updateByName", title: "更新人名称" },
+  // { key: "delFlag", title: "删除标记" },
+  { key: "flowId", title: "OA流程ID" },
+  { key: "approver", title: "审批人" },
+  { key: "approverFinishTime", title: "审批时间" },
+  { key: "approveTime", title: "提交时间" },
+  { key: "createTime", title: "制单日期/创建时间" },
+  { key: "remark", title: "备注" },
+  { key: "updateTime", title: "最后修改时间" },
+  { key: "status", title: "单据状态" },
+  { key: "oaDemandNo", title: "OA需求单号" },
+  { key: "address", title: "收货地址" },
+  { key: "contacts", title: "收获联系人" },
+  { key: "isSendWms", title: "已同步WMS" },
+  { key: "retReason", title: "退换原因" },
+  { key: "closeTime", title: "最终关闭日期" },
+  { key: "processType", title: "处理方式" },
+  { key: "isEnd", title: "整单关闭标识" },
+  { key: "projectNow", title: "在建工程项目" },
+  { key: "operatingItems", title: "经营性项目" },
+  { key: "isArrivalReson", title: "到货超期原因" },
+  { key: "midOrderNo", title: "中台采购订单号" }
+];
+
+export const TabColumns = [
+  {
+    title: '物料信息',
+    key: 'puOrderItemList',
+    tableColumns: [
+      { key: "rowNo", title: "行号" },
+      { key: "orderId", title: "采购订单ID" },
+      { key: "material", title: "物料" },
+      { key: "materialName", title: "物料名称", width: 180 },
+      { key: "materialCode", title: "物料编码", width: 180 },
+      { key: "materialClassify", title: "物料分类", width: 180 },
+      { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
+      { key: "specification", title: "规格", width: 180 },
+      { key: "model", title: "型号", width: 180 },
+      { key: "isMedcine", title: "医药物料", width: 180 },
+      { key: "manufacturer", title: "生产厂家代理人", width: 180 },
+      { key: "isDrug", title: "物料药品属性", width: 180 },
+      { key: "unit", title: "单位", width: 180 },
+      { key: "qty", title: "数量" },
+      { key: "taxPrice", title: "含税单价" },
+      { key: "money", title: "价税合计" },
+      { key: "tax", title: "税率" },
+      { key: "taxDeductMoneya", title: "折扣金额" },
+      { key: "arrivalQty", title: "已到货数量" },
+      { key: "unarrivedQty", title: "未到货数量" },
+      { key: "notaxMoney", title: "无税金额" },
+      { key: "priceSource", title: "价格目录ID" },
+      { key: "isStorage", title: "入库关闭" },
+      { key: "isInvoice", title: "开票关闭" },
+      { key: "isArrival", title: "到货关闭" },
+      { key: "isPayment", title: "付款关闭" },
+      { key: "isGift", title: "赠品" },
+      { key: "warehouse", title: "收货仓库", width: 180 },
+      { key: "place", title: "收货地点", width: 180 },
+      { key: "address", title: "收货地址", width: 180 },
+      { key: "productBatch", title: "产品批号", width: 180 },
+      { key: "manufactureDate", title: "生产日期", width: 180 },
+      { key: "efficacyLoseDate", title: "有效期至/失效日期", width: 180 },
+      { key: "approvalNumber", title: "批准文号", width: 180 },
+      { key: "registration", title: "注册证号", width: 180 },
+      { key: "storageCondition", title: "存储条件" },
+      { key: "carriageCondition", title: "运输条件" },
+      { key: "isBatchLock", title: "批号锁定标识" },
+      { key: "isReplenishment", title: "补单标识" },
+      { key: "isUrgency", title: "紧急标识" },
+      { key: "originalQty", title: "原始数量" },
+      { key: "originalMoney", title: "原始金额" },
+      { key: "directProductBatch", title: "直运产品批号", width: 180 },
+      { key: "discountRule", title: "折扣规则编码", width: 180 },
+      { key: "reservedQty", title: "预留数量" },
+      { key: "reservedPeriod", title: "预留周期", width: 180 },
+      { key: "taxDeductClassify", title: "扣税类别" },
+      { key: "exchangeRate", title: "折本汇率" },
+      { key: "source", title: "上游单据号", width: 180 },
+      { key: "sourceId", title: "上游单据ID", width: 180 },
+      { key: "demandCode", title: "采购需求单号", width: 180 },
+      { key: "arrivalDatePlan", title: "计划到货日期", width: 180 },
+      { key: "priceType", title: "价格类型" },
+      { key: "isDistributionPrice", title: "配送价" },
       // { key: "tenantId", title: "租户号" },
       // { key: "revision", title: "乐观锁" },
       { key: "createByName", title: "创建人名称" },
       { key: "updateByName", title: "更新人名称" },
       // { key: "delFlag", title: "删除标记" },
-      { key: "flowId", title: "OA流程ID" },
-      { key: "approver", title: "审批人" },
-      { key: "approverFinishTime", title: "审批时间" },
-      { key: "approveTime", title: "提交时间" },
-      { key: "createTime", title: "制单日期/创建时间" },
-      { key: "remark", title: "备注" },
-      { key: "updateTime", title: "最后修改时间" },
-      { key: "status", title: "单据状态" },
-      { key: "oaDemandNo", title: "OA需求单号" },
-      { key: "address", title: "收货地址" },
-      { key: "contacts", title: "收获联系人" },
-      { key: "isSendWms", title: "已同步WMS" },
-      { key: "retReason", title: "退换原因" },
-      { key: "closeTime", title: "最终关闭日期" },
-      { key: "processType", title: "处理方式" },
-      { key: "isEnd", title: "整单关闭标识" },
-      { key: "projectNow", title: "在建工程项目" },
-      { key: "operatingItems", title: "经营性项目" },
-      { key: "isArrivalReson", title: "到货超期原因" },
-      { key: "midOrderNo", title: "中台采购订单号" }
+      // { key: "materialClassifyOne", title: "物料一级分类" },
+      { key: "materialClassifyOneName", title: "物料一级分类名称", width: 180 },
+      // { key: "materialClassifyTwo", title: "物料二级分类" },
+      { key: "materialClassifyTwoName", title: "物料二级分类名称", width: 180 },
+      // { key: "materialClassifyThree", title: "物料三级分类" },
+      { key: "materialClassifyThreeName", title: "物料三级分类名称", width: 180 },
+      // { key: "materialClassifyFour", title: "物料四级分类" },
+      { key: "materialClassifyFourName", title: "物料四级分类名称", width: 180 },
+      { key: "price", title: "无税单价" }
+    ]
+  },
+  {
+    title: '执行结果',
+    key: 'puOrderExecuteList',
+    tableColumns: [
+      // { key: "id", title: "主键" },
+      { key: "orderId", title: "采购订单ID", width: 180 },
+      { key: "rowno", title: "行号" },
+      { key: "material", title: "物料", width: 180 },
+      { key: "materialName", title: "物料名称", width: 180 },
+      { key: "specification", title: "规格" },
+      { key: "qty", title: "数量" },
+      { key: "stroageQty", title: "累计到货主数量" },
+      { key: "stockQty", title: "累计入库主数量" },
+      { key: "invoiceQty", title: "累计开票主数量" },
+      { key: "rollbackQty", title: "累计退货主数量" },
+      { key: "backStockQty", title: "累计退库主数量" },
+      { key: "floatQty", title: "未到货数量" },
+      // { key: "tenantId", title: "租户号" },
+      // { key: "revision", title: "乐观锁" },
+      { key: "createByName", title: "创建人名称", width: 180 },
+      { key: "updateByName", title: "更新人名称", width: 180 },
+      // { key: "delFlag", title: "删除标记" }
+    ]
+  },
 ];
 
-export const TabColumns = [
-   {
-     title: '物料信息',
-     key: 'puOrderItemList',
-     tableColumns: [
-       { key: "rowNo", title: "行号" },
-       { key: "orderId", title: "采购订单ID" },
-       { key: "material", title: "物料" },
-       { key: "materialName", title: "物料名称" },
-       { key: "materialCode", title: "物料编码" },
-       { key: "materialClassify", title: "物料分类" },
-       { key: "materialManufacturersCode", title: "厂家物料编码" },
-       { key: "specification", title: "规格" },
-       { key: "model", title: "型号" },
-       { key: "isMedcine", title: "医药物料" },
-       { key: "manufacturer", title: "生产厂家代理人" },
-       { key: "isDrug", title: "物料药品属性" },
-       { key: "unit", title: "单位" },
-       { key: "qty", title: "数量" },
-       { key: "taxPrice", title: "含税单价" },
-       { key: "money", title: "价税合计" },
-       { key: "tax", title: "税率" },
-       { key: "taxDeductMoneya", title: "折扣金额" },
-       { key: "arrivalQty", title: "已到货数量" },
-       { key: "unarrivedQty", title: "未到货数量" },
-       { key: "notaxMoney", title: "无税金额" },
-       { key: "priceSource", title: "价格目录ID" },
-       { key: "isStorage", title: "入库关闭" },
-       { key: "isInvoice", title: "开票关闭" },
-       { key: "isArrival", title: "到货关闭" },
-       { key: "isPayment", title: "付款关闭" },
-       { key: "isGift", title: "赠品" },
-       { key: "warehouse", title: "收货仓库" },
-       { key: "place", title: "收货地点" },
-       { key: "address", title: "收货地址" },
-       { key: "productBatch", title: "产品批号" },
-       { key: "manufactureDate", title: "生产日期" },
-       { key: "efficacyLoseDate", title: "有效期至/失效日期" },
-       { key: "approvalNumber", title: "批准文号" },
-       { key: "registration", title: "注册证号" },
-       { key: "storageCondition", title: "存储条件" },
-       { key: "carriageCondition", title: "运输条件" },
-       { key: "isBatchLock", title: "批号锁定标识" },
-       { key: "isReplenishment", title: "补单标识" },
-       { key: "isUrgency", title: "紧急标识" },
-       { key: "originalQty", title: "原始数量" },
-       { key: "originalMoney", title: "原始金额" },
-       { key: "directProductBatch", title: "直运产品批号" },
-       { key: "discountRule", title: "折扣规则编码" },
-       { key: "reservedQty", title: "预留数量" },
-       { key: "reservedPeriod", title: "预留周期" },
-       { key: "taxDeductClassify", title: "扣税类别" },
-       { key: "exchangeRate", title: "折本汇率" },
-       { key: "source", title: "上游单据号" },
-       { key: "sourceId", title: "上游单据ID" },
-       { key: "demandCode", title: "采购需求单号" },
-       { key: "arrivalDatePlan", title: "计划到货日期" },
-       { key: "priceType", title: "价格类型" },
-       { key: "isDistributionPrice", title: "配送价" },
-       // { key: "tenantId", title: "租户号" },
-       // { key: "revision", title: "乐观锁" },
-       { key: "createByName", title: "创建人名称" },
-       { key: "updateByName", title: "更新人名称" },
-       // { key: "delFlag", title: "删除标记" },
-       // { key: "materialClassifyOne", title: "物料一级分类" },
-       { key: "materialClassifyOneName", title: "物料一级分类名称" },
-       // { key: "materialClassifyTwo", title: "物料二级分类" },
-       { key: "materialClassifyTwoName", title: "物料二级分类名称" },
-       // { key: "materialClassifyThree", title: "物料三级分类" },
-       { key: "materialClassifyThreeName", title: "物料三级分类名称" },
-       // { key: "materialClassifyFour", title: "物料四级分类" },
-       { key: "materialClassifyFourName", title: "物料四级分类名称" },
-       { key: "price", title: "无税单价" }
-     ]
-   },
-   {
-     title: '执行结果',
-     key: 'puOrderExecuteList',
-     tableColumns: [
-       // { key: "id", title: "主键" },
-       { key: "orderId", title: "采购订单ID" },
-       { key: "rowno", title: "行号" },
-       { key: "material", title: "物料" },
-       { key: "materialName", title: "物料名称" },
-       { key: "specification", title: "规格" },
-       { key: "qty", title: "数量" },
-       { key: "stroageQty", title: "累计到货主数量" },
-       { key: "stockQty", title: "累计入库主数量" },
-       { key: "invoiceQty", title: "累计开票主数量" },
-       { key: "rollbackQty", title: "累计退货主数量" },
-       { key: "backStockQty", title: "累计退库主数量" },
-       { key: "floatQty", title: "未到货数量" },
-       // { key: "tenantId", title: "租户号" },
-       // { key: "revision", title: "乐观锁" },
-       { key: "createByName", title: "创建人名称" },
-       { key: "updateByName", title: "更新人名称" },
-       // { key: "delFlag", title: "删除标记" }
-     ]
-   },
- ];
-
 export const SearchColumns = TableColumns.filter((element) => element.search);

+ 68 - 30
src/views/purchase/purchase-order/edit/index.vue

@@ -18,7 +18,7 @@ export default {
   name: "EditPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+
   },
   data() {
     return {
@@ -49,10 +49,34 @@ export default {
       const { id } = this.params;
       // this.fetchTable(id, newProp);
     },
+    'params.puOrderItemList': {
+      handler(nVal, oVal) {
+        this.handleSynchronousMaterial('puOrderItemList', 'puOrderExecuteList');
+      },
+      deep: true,
+      immediate: true
+    },
+    'params.puOrderExecuteList': {
+      handler(nVal, oVal) {
+        this.handleSynchronousMaterial('puOrderExecuteList', 'puOrderItemList');
+      },
+      deep: true,
+      immediate: true
+    },
   },
   methods: {
     setVisible(prop) {
       this.visible = prop;
+
+    },
+    // 同步子表物料
+    handleSynchronousMaterial(key1, key2) {
+      // this.params[key1]-- -> this.params[key2]
+      this.params[key1].forEach((item, index) => {
+        this.params[key2][index].material = item.material;
+        this.params[key2][index].materialName = item.materialName;
+        this.params[key2][index].materialCode = item.materialCode;
+      })
     },
     // 查询详细
     async fetchItem(prop) {
@@ -72,33 +96,40 @@ export default {
         this.loading = false;
       }
     },
-    // 查询详情关联TABLE
-    // async fetchTable(prop, name) {
-    //   try {
-    //     this.loading = true;
-    //     const { code, msg, rows } = await itemTableList({ id: prop }, name);
-    //     if (code === 200) {
-    //       this.params[name] = rows;
-    //       this.$notify.success({ title: msg });
-    //     } else {
-    //       this.$notify.warning({ title: msg });
-    //     }
-    //   } catch (err) {
-    //     this.$notify.error({ title: "error", message: err });
-    //   } finally {
-    //     this.loading = false;
-    //   }
-    // },
     // 新增行
     addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
+
+      for (const key in this.params) {
+
+        if (Array.isArray(this.params[key])) {
+
+          const arr = this.tabColumns.find(
+            (element) => element.key === key
+          ).tableColumns;
+
+          let rowData = initParams(arr, "key", "value");
+
+          'rowno' in rowData && (rowData['rowno'] = this.params[key].length + 1);
+          'rowNo' in rowData && (rowData['rowNo'] = this.params[key].length + 1);
+
+          this.params[key].push(rowData);
+        }
+      }
+
+      // const arr = this.tabColumns.find(
+      //   (element) => element.key === this.tabName
+      // ).tableColumns;
+      // prop.push(initParams(arr, "key", "value"));
     },
     // 删除行
     delTableRow(prop, index) {
-      prop.splice(index, 1);
+      // prop.splice(index, 1);
+      for (const key in this.params) {
+
+        if (Array.isArray(this.params[key])) {
+          this.params[key].splice(index, 1);
+        }
+      }
     },
     // 取消
     handleCancel() {
@@ -107,7 +138,8 @@ export default {
     },
     // 保存
     async handleSava() {
-
+      // this.$refs['orderEditForm'].validate(async (valid) => {
+      //   if (valid) {
       try {
         this.loading = true;
         const { code, msg } = await (this.handleIsRevise(this.params.status) ?
@@ -126,6 +158,11 @@ export default {
         this.loading = false;
       }
 
+      //   } else {
+      //     console.log('error submit!!');
+      //     return false;
+      //   }
+      // });
     },
     beforeOpen() {
     },
@@ -135,7 +172,7 @@ export default {
     },
   },
   created() {
-    console.log("ADD CREATED");
+    console.log("EDIT CREATED");
     console.log(this.params, 'this.params');
   },
   mounted() { },
@@ -145,7 +182,8 @@ export default {
 <template>
   <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
     @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+    <el-form v-loading="loading" :size="size" ref="orderEditForm" label-position="right" label-width="135px"
+      :model="params" :rules="rules">
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -168,11 +206,11 @@ export default {
               <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input>
-              <dr-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :readonly="column.readonly" :query-params="column.config.queryParams" :title="column.title"
                 :type="column.config.componentName" :data-mapping="column.config.dataMapping" :source.sync="params">
-              </dr-input-dialog>
+              </dr-popover-select>
               <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 style="width: 100%">
@@ -240,11 +278,11 @@ export default {
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :size="size" style="width: 100%">
                   </el-input>
-                  <dr-input-dialog v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
                     :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
-                  </dr-input-dialog>
+                  </dr-popover-select>
                   <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
                     :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     style="width: 100%">

+ 87 - 19
src/views/purchase/purchase-order/index.vue

@@ -130,6 +130,7 @@ export default {
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
+      checkedList: [],
     };
   },
   computed: {
@@ -156,12 +157,8 @@ export default {
     async fetchList(params, page) {
       try {
         this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await orderApi.list({
-          pageNum,
-          pageSize,
-          ...params,
-        });
+        // const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await orderApi.list(params, page);
         if (code === 200) {
           this.page.total = total;
           this.tableData = rows;
@@ -268,7 +265,65 @@ export default {
     // 提交
     async handleSubmit(row) {
 
-    }
+    },
+    // 判断“退回”按钮
+    judgeIsAllSendBack() {
+
+      if (this.checkedList.length == 1) {
+
+        // 非手工、状态非审批通过  
+        if (this.checkedList[0].source != 3 && this.checkedList[0].status != 2) {
+
+          return false
+        }
+      }
+      return true;
+    },
+    //  退回
+    handleAllSendBack() {
+      let data = {
+        id: this.checkedList[0].id,
+        documentIds: [],
+        baskCause: ''
+      }
+      console.log(data);
+      try {
+        this.loading = true;
+        // let { code, msg } = orderApi.documentsReturn(data);
+
+      } catch (error) {
+
+      } finally {
+        this.loading = false;
+      }
+    },
+    handleSelect(selection, row) {
+      this.checkedList = selection;
+      console.log(this.checkedList, 'this.checkedList');
+    },
+    // 判断状态
+    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;
+    },
 
   },
 };
@@ -292,7 +347,8 @@ export default {
           </el-row>
         </el-col>
         <el-col :span="4" style="text-align: right; padding-right: 40px">
-          <el-button type="primary" size="mini" @click="handleQueryList">搜索</el-button>
+          <el-button type="primary" size="mini" @click="handleQueryList"
+            v-hasPermi="['material:order:query']">搜索</el-button>
           <el-button size="mini" @click="handleResetList">重置</el-button>
         </el-col>
       </el-row>
@@ -308,13 +364,15 @@ export default {
       <!-- <el-col :span="6">123</el-col> -->
       <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini" type="danger" @click="handleOpenAddDrawer">新增</el-button>
+          <el-button size="mini" type="danger" @click="handleOpenAddDrawer"
+            v-hasPermi="['material:order:add']">新增</el-button>
           <el-button size="mini">复制</el-button>
 
         </el-button-group>
 
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini">退回</el-button>
+          <el-button size="mini" @click="handleAllSendBack" :key="checkedList.length"
+            :disabled="judgeIsAllSendBack()">整单退回</el-button>
         </el-button-group>
 
         <el-button-group style="margin-left: 10px">
@@ -327,18 +385,27 @@ export default {
     </el-row>
 
     <el-table @row-dblclick="handleOpenSeeDrawer" @row-click="handleDetailsData" :data="tableData" size="mini"
-      highlight-current-row style="width: 100%; margin: 20px 0 0 0">
+      highlight-current-row style="width: 100%; margin: 20px 0 0 0" @select="handleSelect" height="450">
+      <el-table-column type="selection" width="45"></el-table-column>
       <el-table-column type="index" width="50" label="序号"></el-table-column>
-      <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
+      <el-table-column v-for="(column, index) in tableColumns" :key="index" :label="column.title"
         :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+
+        <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 @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button> -->
-          <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
+          <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)"
+            v-hasPermi="['material:order:edit']">
             {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
           <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 -->
-          <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)">删除</el-button>
+          <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)"
+            v-hasPermi="['material:order:remove']">删除</el-button>
           <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
             @click.stop="handleSubmit(scope.row)">提交</el-button>
         </template>
@@ -346,16 +413,17 @@ export default {
 
     </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">
+      :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page :layout="layout"
+      style="text-align: right;margin-top: 10px;">
     </el-pagination>
 
     <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
       <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
-        <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row>
+        <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row
+          :height="tabTableDatas[column.key].length ? 300 : 100">
           <el-table-column type="index" width="50" label="序号"></el-table-column>
-          <el-table-column width="100" v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-            :label="cColumn.title">
+          <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+            :label="cColumn.title" :width="cColumn.width || 100" show-overflow-tooltip>
           </el-table-column>
         </el-table>
       </el-tab-pane>

+ 158 - 46
src/views/purchase/task/column.js

@@ -1,82 +1,194 @@
 export const TableColumns = [
-  { key: "materialName", title: "物料名称", search: true, type: "Input" },
-  { key: "material", title: "物料", search: true, type: "Input" },
-  { key: "materialDesc", title: "物料/物料描述", search: true, type: "Input" },
+  { key: "demandCode", title: "采购需求单号" },
+  { key: "materialCode", title: "物料编码" },
+  { key: "materialName", title: "物料名称" },
+  // { key: "material", title: "物料" },
+  { key: "materialDesc", title: "物料描述" },
   { key: "manufacturerName", title: "生产厂家名称" },
   { key: "puQty", title: "采购数量" },
   {
-    key: "priceType",
+    key: "priceinputType",
     title: "价格类型",
-    type: "Select",
-    config: {
-      optionsName: "sys_price_type",
-    },
+    referName: "sys_price_inputType",
   },
   { key: "puUnitName", title: "采购单位名称" },
-
-  { key: "id", title: "主键" },
+  // { key: "id", title: "主键" },
   {
     key: "status",
     title: "状态",
-    search: true,
-    type: "Select",
-    config: {
-      optionsName: "purchase_task_status",
-    },
+    referName: "purchase_task_status",
   },
-  { key: "manufacturer", title: "生产厂家" },
-  { key: "buyer", title: "采购员" },
-  { key: "buyerName", title: "采购员名称", search: true, type: "Input" },
-  { key: "supplier", title: "建议供应商" },
+  // { key: "manufacturer", title: "生产厂家" },
+  // { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员名称" },
+  // { key: "supplier", title: "建议供应商" },
   { key: "supplierName", title: "建议供应商名称" },
-  { key: "puOrg", title: "采购组织" },
+  // { key: "puOrg", title: "采购组织" },
   {
     key: "puOrgName",
     title: "采购组织名称",
-    search: true,
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
-    },
   },
-  { key: "currency", title: "币种" },
+  // { key: "currency", title: "币种" },
   { key: "currencyName", title: "币种名称" },
   { key: "billYpe", title: "交易类型" },
   { key: "source", title: "需求来源" },
-  { key: "customer", title: "收货客户" },
+  // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户名称" },
   { key: "puUnit", title: "采购单位" },
 
-  { key: "demandDate", title: "需求时间", search: true, type: "DatePicker" },
+  { key: "demandDate", title: "需求时间" },
   { key: "projectName", title: "项目名称" },
   { key: "demandPersonal", title: "需求人" },
   {
     key: "demandPersonalName",
     title: "需求人名称",
-    search: true,
-    type: "Input",
   },
-  { key: "demandOrg", title: "需求组织", search: true, type: "Input" },
+  // { key: "demandOrg", title: "需求组织" },
   { key: "demandOrgName", title: "需求组织名称" },
-  { key: "demandDept", title: "需求部门" },
-  { key: "demandDeptName", title: "需求部门名称", search: true, type: "Input" },
+  // { key: "demandDept", title: "需求部门" },
+  { key: "demandDeptName", title: "需求部门名称" },
   { key: "isBack", title: "是否退回" },
   { key: "baskCause", title: "退回原因" },
   { key: "backDate", title: "退回日期" },
-  { key: "assignSupplier", title: "指定供应商" },
+  // { key: "assignSupplier", title: "指定供应商" },
   { key: "assignSupplierName", title: "指定供应商名称" },
-  { key: "unit", title: "单位" },
+  // { key: "unit", title: "单位" },
   { key: "unitName", title: "单位名称" },
-  { key: "demandCode", title: "采购需求单号" },
-  { key: "file", title: "附件" },
-  { key: "tenantId", title: "租户号" },
-  { key: "revision", title: "乐观锁" },
-  { key: "delFlag", title: "删除标记" },
-  { key: "materialCode", title: "物料编码" },
+  // { key: "file", title: "附件" },
+  // { key: "tenantId", title: "租户号" },
+  // { key: "revision", title: "乐观锁" },
+  // { key: "delFlag", title: "删除标记" },
 ];
 
-export const SearchColumns = TableColumns.filter((element) => element.search);
+const pickerOptions = {
+  shortcuts: [
+    {
+      text: "昨天",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近三天",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近一周",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近一个月",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近三个月",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近半年",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+  ],
+};
+
+export const SearchColumns = [
+  {
+    key: "classIds",
+    title: "物料分类",
+    inputType: "PopoverTreeSelect",
+    multiple: false,
+    valueKey: "id",
+    referName: "MATERIALCLASSIFY_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  {
+    key: "materialCodes",
+    title: "物料编码",
+    inputType: "PopoverSelect",
+    multiple: true,
+    valueKey: "code",
+    referName: "MATERIAL_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  { key: "materialDesc", title: "物料描述", inputType: "Input" },
+  { key: "source", title: "需求来源", inputType: "Input" },
+  {
+    key: "puOrgIds",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    multiple: true,
+    valueKey: "id",
+    referName: "ORG_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  {
+    key: "date",
+    title: "创建时间",
+    inputType: "DatePicker",
+    type: "daterange",
+    unlinkPanels: true,
+    rangeSeparator: "至",
+    valueFormat: "yyyy-MM-dd",
+    endPlaceholder: "结束日期",
+    startPlaceholder: "开始日期",
+    pickerOptions: pickerOptions,
+    value: [],
+  },
+  {
+    key: "buyers",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    multiple: true,
+    valueKey: "id",
+    referName: "PSNLICENSE_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  {
+    key: "status",
+    title: "状态",
+    inputType: "Select",
+    referName: "purchase_task_status",
+  },
+  // {
+  //   key: "documentsCodes",
+  //   title: "需求来源",
+  //   inputType: "Input",
+  //   placeholder: "请输入来源单据号,多个用,分隔",
+  // },
+];

+ 0 - 105
src/views/purchase/task/config/add.js

@@ -1,105 +0,0 @@
-const pickerOptions = {
-  disabledDate(time) {
-    return time.getTime() > Date.now();
-  },
-  shortcuts: [
-    {
-      text: "今天",
-      onClick(picker) {
-        picker.$emit("pick", new Date());
-      },
-    },
-    {
-      text: "昨天",
-      onClick(picker) {
-        const date = new Date();
-        date.setTime(date.getTime() - 3600 * 1000 * 24);
-        picker.$emit("pick", date);
-      },
-    },
-    {
-      text: "一周前",
-      onClick(picker) {
-        const date = new Date();
-        date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
-        picker.$emit("pick", date);
-      },
-    },
-  ],
-};
-
-const columns = [
-  {
-    title: "采购组织",
-    key: "puOrg",
-    type: "InputDialog",
-    value: [],
-    required: true,
-  },
-  { title: "需求来源", key: "source", type: "Input", value: "采购创建" },
-  { title: "采购员", key: "buyer", value: [], type: "InputDialog" },
-  { title: "交易类型", key: "billYpe", value: [], type: "InputDialog" },
-  { title: "物料编码", key: "material", type: "Input", required: true },
-  {
-    title: "物料名称",
-    key: "materialName",
-    type: "InputDialog",
-    value: [],
-    required: true,
-  },
-  {
-    title: "物料/物料描述",
-    key: "materialDesc",
-    type: "InputDialog",
-    value: [],
-    required: true,
-  },
-  { title: "生产厂家", key: "manufacturer", type: "Input" },
-  { title: "收货客户", key: "customer", type: "InputDialog", value: [] },
-  {
-    title: "采购单位",
-    key: "puUnit",
-    type: "InputDialog",
-    value: [],
-    required: true,
-  },
-  {
-    title: "采购数量",
-    key: "puQty",
-    type: "InputNumber",
-    required: true,
-  },
-  {
-    title: "需求时间",
-    key: "demandDate",
-    type: "DatePicker",
-    config: { type: "date", pickerOptions: pickerOptions },
-  },
-  { title: "项目名称", key: "projectName", type: "InputDialog", value: [] },
-  { title: "需求人", key: "demandPersonal", type: "InputDialog", value: [] },
-  {
-    title: "需求组织",
-    key: "demandOrg",
-    type: "InputDialog",
-    value: [],
-    require: true,
-  },
-  { title: "需求部门", key: "demandDept", type: "InputDialog", value: [] },
-  { title: "建议供应商", key: "supplier", type: "InputDialog", value: [] },
-  { title: "收货人", key: "a", type: "InputDialog", value: [] },
-  { title: "收货组织", key: "b", type: "InputDialog", value: [] },
-  { title: "收货人联系方式", key: "c", type: "Input" },
-  { title: "收货地址", key: "d", type: "Input" },
-  { title: "收货仓库", key: "e", type: "InputDialog", value: [] },
-  {
-    title: "指定供应商",
-    key: "assignSupplier",
-    type: "InputDialog",
-    value: [],
-  },
-  { title: "单位", key: "unit", type: "InputDialog", value: [] },
-  { title: "收货地址", key: "f", type: "InputDialog", value: [] },
-];
-
-export const initColumns = () => columns;
-

+ 7 - 24
src/views/purchase/task/first-direct/column.js

@@ -15,35 +15,18 @@ export const TableColumns = [
   {
     key: "purchaseQuantity",
     title: "本次采购数量",
-    type: "InputNumber",
+    inputType: "InputNumber",
     width: 200,
+    min: (prop) => 0,
+    max: (prop) => prop.puQty - (prop.executeQty || 0),
+    controlsPosition: "right",
   },
   {
     key: "arrivalDatePlan",
     title: "计划到货日期",
-    type: "DatePicker",
+    inputType: "DatePicker",
+    valueFormat: "yyyy-MM-dd",
     width: 200,
   },
-  { key: "note", title: "备注", type: "Textarea", width: 200 },
-
-  // { key: "id", title: "主键" },
-  // { key: "material", title: "物料id" },
-  // { key: "manufacturer", title: "生产厂家" },
-  // { key: "materialClassify", title: "物料一级分类" },
-  // { key: "materialName", title: "物料名称" },
-  // { key: "model", title: "物料型号" },
-  // { key: "specification", title: "物料规格" },
-  // { key: "unit", title: "主单位" },
-  // { key: "unitName", title: "主单位名称" },
-  // { key: "buyer", title: "采购员" },
-  // { key: "buyerName", title: "采购员名称" },
-  // { key: "source", title: "来源单据编号" },
-  // { key: "status", title: "有效状态" },
-  // { key: "enableStatus", title: "启用状态" },
-  // { key: "convertRate", title: "换算率" },
-  // { key: "materialStatus", title: "物料启用状态" },
-  // { key: "demandCode", title: "采购需求单号" },
-  // { key: "expiryEarly", title: "效期预警" },
-
-  ,
+  { key: "note", title: "备注", inputType: "Textarea", width: 200 },
 ];

+ 70 - 210
src/views/purchase/task/first-direct/index.vue

@@ -3,7 +3,7 @@ import { TableColumns } from "./column";
 import { FIRSTDIRECT, ADD } from "@/api/business/purchase/task";
 import { initColumns } from "@/utils/init";
 export default {
-  name: "FirstDirectPurchaseDrawer",
+  name: "FirstDirectPurchaseDialog",
   components: {},
   data() {
     return {
@@ -76,216 +76,77 @@ export default {
 </script>
 
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-  >
-    <el-card
-      :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }"
-      style="margin: 10px"
+  <el-dialog :with-header="false" :visible.sync="visible">
+    <div
+      v-for="(item, index) in data"
+      :key="index"
+      style="width: 100%; margin: 0 0 20px 0"
     >
-      <div
-        slot="header"
-        style="
-          display: flex;
-          justify-content: space-between;
-          align-items: center;
-        "
+      <el-descriptions border size="mini" :column="4">
+        <template #title>
+          <span style="margin-right: 10px">{{ item.materialName }}</span>
+          <span style="color: tomato">{{ item.puQty }}</span>
+          <span> {{ item.puUnitName }}</span>
+        </template>
+        <el-descriptions-item label="需求组织">
+          {{ item.demandOrgName }}
+        </el-descriptions-item>
+        <el-descriptions-item label="采购组织">
+          {{ item.puOrgName }}
+        </el-descriptions-item>
+        <el-descriptions-item label="需求时间">
+          {{ item.demandDate }}
+        </el-descriptions-item>
+      </el-descriptions>
+      <el-table
+        v-loading="loading"
+        :data="item.orderPriceVos"
+        style="width: 100%"
       >
-        <h3>首次协议直采</h3>
-        <div style="text-align: right">
-          <el-button :size="size" @click="handleCancel">取 消</el-button>
-          <el-button :size="size" type="info" @click="handleSubmit">
-            新 增
-          </el-button>
-        </div>
-      </div>
-      <div
-        v-for="(item, index) in data"
-        :key="index"
-        style="width: 100%; margin: 0 0 20px 0"
-      >
-        <el-descriptions border size="mini" :column="4">
-          <template #title>
-            <span style="margin-right: 10px">{{ item.materialName }}</span>
-            <span style="color: tomato">{{ item.puQty }}</span>
-            <span> {{ item.puUnitName }}</span>
-          </template>
-          <el-descriptions-item label="需求组织">
-            {{ item.demandOrgName }}
-          </el-descriptions-item>
-          <el-descriptions-item label="采购组织">
-            {{ item.puOrgName }}
-          </el-descriptions-item>
-          <el-descriptions-item label="需求时间">
-            {{ item.demandDate }}
-          </el-descriptions-item>
-        </el-descriptions>
-        <el-table
-          v-loading="loading"
-          :data="item.orderPriceVos"
-          style="width: 100%"
+        <el-table-column
+          v-for="(cItem, cIndex) in tableColumns"
+          :key="cIndex"
+          :prop="cItem.key"
+          :label="cItem.title"
+          :fixed="cItem.fixed"
+          :width="cItem.width || 180"
+          show-overflow-tooltip
         >
-          <el-table-column
-            prop="supplier"
-            label="供应商"
-            width="125"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="supplierName"
-            label="供应商名称"
-            width="125"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="puOrg"
-            label="采购组织"
-            width="125"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="puOrgName"
-            label="采购组织名称"
-            width="150"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="customer"
-            label="客户"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="customerName"
-            label="客户名称"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="priceType"
-            label="价格类型"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="isDistribution"
-            label="配送价"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="effectiveDate"
-            label="价格生效日期"
-            width="150"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="endDate"
-            label="价格失效日期"
-            width="150"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="tax"
-            label="税率"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="taxFreePrice"
-            label="无税单价"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="taxPrice"
-            label="主含税单价"
-            width="125"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            prop="purchaseQuantity"
-            label="本次采购数量"
-            width="175"
-          >
-            <template slot-scope="scope">
-              <el-input-number
-                v-model="scope.row.purchaseQuantity"
-                :min="0"
-                :max="item.puQty - (item.executeQty || 0)"
-                size="mini"
-                controls-position="right"
-                style="width: 100%"
-              ></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="arrivalDatePlan"
-            label="计划到货日期"
-            width="175"
-          >
-            <template slot-scope="scope">
-              <el-date-picker
-                v-model="scope.row.arrivalDatePlan"
-                size="mini"
-                style="width: 100%"
-              ></el-date-picker>
-            </template>
-          </el-table-column>
-          <el-table-column prop="note" label="备注" width="250">
-            <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.note"
-                autosize
-                size="mini"
-                type="textarea"
-                style="width: 100%"
-              ></el-input>
-            </template>
-          </el-table-column>
-          <!-- <el-table-column
-            v-for="(cItem, cIndex) in tableColumns"
-            :key="cIndex"
-            :prop="cItem.key"
-            :label="cItem.title"
-            :width="cItem.width || 180"
-            :show-overflow-tooltip="cItem.showOverflowTooltip || true"
-          >
-            <template slot-scope="scope">
-              <el-input-number
-                v-if="cItem.edit && cItem.editConfig.type === 'InputNumber'"
-                v-model="scope.row[cItem.key]"
-                :controls-position="cItem.editConfig.controlsPosition"
-                :min="cItem.editConfig.min"
-                :max="cItem.editConfig.max"
-                :size="cItem.editConfig.size || 'mini'"
-                :placeholder="cItem.editConfig.placeholder"
-                style="width: 90%"
-              ></el-input-number>
-              <el-date-picker
-                v-else-if="cItem.edit && cItem.editConfig.type === 'DatePicker'"
-                v-model="scope.row[cItem.key]"
-                :type="cItem.editConfig.showType"
-                :picker-options="cItem.editConfig.pickerOptions"
-                :size="cItem.editConfig.size || 'mini'"
-                :placeholder="cItem.editConfig.placeholder"
-                style="width: 90%"
-              ></el-date-picker>
-              <el-input
-                v-else-if="cItem.edit && cItem.editConfig.type === 'Textarea'"
-                v-model="scope.row[cItem.key]"
-                type="textarea"
-                :autosize="cItem.editConfig.autosize || true"
-                :size="cItem.editConfig.size || 'mini'"
-                style="width: 90%"
-              ></el-input>
-              <span v-else>{{ scope.row[cItem.key] }}</span>
-            </template>
-          </el-table-column> -->
-        </el-table>
-      </div>
-      <!-- <el-pagination
+          <template slot-scope="scope">
+            <el-input-number
+              v-if="cItem.inputType === 'InputNumber'"
+              v-model="scope.row[cItem.key]"
+              :size="size"
+              :min="cItem.min(item)"
+              :max="cItem.max(item)"
+              :controls-position="cItem.controlsPosition"
+              :placeholder="cItem.placeholder"
+              style="width: 90%"
+            ></el-input-number>
+            <el-date-picker
+              v-else-if="cItem.inputType === 'DatePicker'"
+              v-model="scope.row[cItem.key]"
+              :size="size"
+              :type="cItem.type"
+              :placeholder="cItem.placeholder"
+              :picker-options="cItem.pickerOptions"
+              :value-format="cItem.valueFormat"
+              style="width: 90%"
+            ></el-date-picker>
+            <el-input
+              v-else-if="cItem.inputType === 'Textarea'"
+              v-model="scope.row[cItem.key]"
+              :size="size"
+              autosize
+              type="textarea"
+              style="width: 90%"
+            ></el-input>
+            <span v-else>{{ scope.row[cItem.key] }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!-- <el-pagination
       @size-change="handleSizeChange"
       @current-change="handleCurrentChange"
       :total="total"
@@ -296,8 +157,7 @@ export default {
       layout="total, prev, pager, next, sizes, jumper"
     >
     </el-pagination> -->
-    </el-card>
-  </el-drawer>
+  </el-dialog>
 </template>
 
 <style scoped></style>

+ 84 - 57
src/views/purchase/task/index.vue

@@ -6,18 +6,15 @@ import {
   initLayout,
   initPageSizes,
   initParams,
-  initColumns,
   initDicts,
 } from "@/utils/init";
 export default {
   name: "PuchaseTask",
   dicts: initDicts(TableColumns),
   components: {
-    DrInputDialog: () =>
-      import("@/components/popover-multiple-select/index.vue"),
-    SeeDrawer: () => import("./see/index.vue"),
-    FirstDirectDrawer: () => import("./first-direct/index.vue"),
-    DocumentsReturnDialog: () => import("./documents-return/index.vue"),
+    SeeDialog: () => import("./see/index.vue"),
+    FirstDirectDialog: () => import("./first-direct/index.vue"),
+    DocReturnDialog: () => import("./documents-return/index.vue"),
     ModifyBuyerDialog: () => import("./modify-buyer/index.vue"),
   },
   data() {
@@ -26,13 +23,8 @@ export default {
 
       loading: false,
 
-      searchColumns: initColumns(SearchColumns),
-      params: {
-        isAsc: "",
-        reasonable: "",
-        orderByColumn: "",
-        ...initParams(SearchColumns),
-      },
+      searchColumns: SearchColumns,
+      params: initParams(SearchColumns),
 
       tableData: [],
       selectData: [],
@@ -44,6 +36,7 @@ export default {
     };
   },
   computed: {},
+  watch: {},
   created() {
     this.handleQueryList();
   },
@@ -53,11 +46,10 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await LIST({
-          pageNum,
-          pageSize,
-          ...params,
-        });
+        const { code, msg, rows, total } = await LIST(
+          { ...params },
+          { pageNum, pageSize, isAsc: "desc", orderByColumn: "createTime" }
+        );
         if (code === 200) {
           this.tableData = rows;
           this.page.total = total;
@@ -73,23 +65,26 @@ export default {
     },
     // 查询操作
     handleQueryList() {
-      this.fetchList(this.params, this.page);
+      const { date } = this.params;
+      this.params.endDate = date[1];
+      this.params.startDate = date[0];
+      this.fetchList({ ...this.params }, this.page);
     },
     // 重置操作
     handleResetList() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 页大小变
     handleSizeChange(prop) {
       this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 当前页变
     handleCurrentChange(prop) {
       this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 选择行
     handleSelectionChange(prop) {
@@ -115,7 +110,7 @@ export default {
     },
     // 退回请购
     async handleDocumentsReturn(prop) {
-      const { setVisible, beforeOpenDoSome } = this.$refs.DocumentsReturnDialog;
+      const { setVisible, beforeOpenDoSome } = this.$refs.DocReturnDialog;
       await setVisible(true);
       await beforeOpenDoSome(prop);
     },
@@ -129,16 +124,19 @@ export default {
     // 打开查看drawer
     async handleOpenSeeDrawer(prop) {
       const { id } = prop;
-      const { setVisible, beforeOpenDoSome } = this.$refs.SeeDrawerFef;
+      const { setVisible, beforeOpenDoSome } = this.$refs.SeeDialog;
       await setVisible(true);
       await beforeOpenDoSome(id);
     },
     // 打开首次直采drawer
     async handleOpenFristDirectDrawer(prop) {
-      const { setVisible, beforeOpenDoSome } = this.$refs.FirstDirectDrawerRef;
+      const { setVisible, beforeOpenDoSome } = this.$refs.FirstDirectDialog;
       await setVisible(true);
       await beforeOpenDoSome(prop);
     },
+    handleCCCC(prop, source) {
+      console.log("CCCCCC", prop, source);
+    },
   },
 };
 </script>
@@ -149,25 +147,28 @@ export default {
     style="width: calc(100% - 24px); height: 100%; margin: 10px"
     :body-style="{ padding: 0 }"
   >
-    <see-drawer ref="SeeDrawerFef"></see-drawer>
-    <first-direct-drawer ref="FirstDirectDrawerRef"></first-direct-drawer>
-    <documents-return-dialog
-      ref="DocumentsReturnDialog"
-    ></documents-return-dialog>
+    <see-dialog ref="SeeDialog"></see-dialog>
+    <first-direct-dialog ref="FirstDirectDialog"></first-direct-dialog>
+    <doc-return-dialog ref="DocReturnDialog"></doc-return-dialog>
     <modify-buyer-dialog ref="ModifyBuyerDialog"></modify-buyer-dialog>
-    <el-form :size="size" label-position="top" :model="params">
-      <el-row :gutter="24" style="padding: 0 20px">
+    <el-form
+      :size="size"
+      :model="params"
+      label-width="75px"
+      label-position="right"
+    >
+      <el-row :gutter="24" style="padding: 20px 20px">
         <el-col
           v-for="column in searchColumns"
           :key="column.title"
           :xl="4"
-          :lg="4"
-          :md="6"
+          :lg="6"
+          :md="8"
           :sm="12"
           :xs="24"
         >
           <el-form-item
-            v-if="column.type === 'Input'"
+            v-if="column.inputType === 'Input'"
             :prop="column.key"
             :label="column.title"
           >
@@ -177,7 +178,7 @@ export default {
             ></el-input>
           </el-form-item>
           <el-form-item
-            v-if="column.type === 'Select'"
+            v-if="column.inputType === 'Select'"
             :prop="column.key"
             :label="column.title"
           >
@@ -189,7 +190,7 @@ export default {
               style="width: 100%"
             >
               <el-option
-                v-for="item in dict.type[column.config.optionsName]"
+                v-for="item in dict.type[column.referName]"
                 :key="item.value"
                 :label="item.label"
                 :value="item.value"
@@ -198,46 +199,71 @@ export default {
             </el-select>
           </el-form-item>
           <el-form-item
-            v-if="column.type === 'DatePicker'"
+            v-if="column.inputType === 'DatePicker'"
             :prop="column.key"
             :label="column.title"
           >
             <el-date-picker
               v-model="params[column.key]"
-              :type="column.config.type"
+              :type="column.type"
               :placeholder="column.placeholder"
+              :value-format="column.valueFormat"
+              :unlink-panels="column.unlinkPanels"
+              :picker-options="column.pickerOptions"
+              :range-separator="column.rangeSeparator"
+              :end-placeholder="column.endPlaceholder"
+              :start-placeholder="column.startPlaceholder"
               style="width: 100%"
             >
             </el-date-picker>
           </el-form-item>
           <el-form-item
-            v-if="column.type === 'InputDialog'"
+            v-if="column.inputType === 'PopoverSelect'"
             :prop="column.key"
             :label="column.title"
           >
-            <dr-input-dialog
+            <dr-popover-select
               v-model="params[column.key]"
-              :placeholder="column.placeholder"
+              :source.sync="params"
               :title="column.title"
-              :type="column.config.componentName"
-              :data-mapping="column.config.dataMapping"
+              :type="column.referName"
+              :multiple="column.multiple"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
+              :query-params="column.queryParams(params)"
+              @change="handleCCCC"
+            >
+            </dr-popover-select>
+          </el-form-item>
+          <el-form-item
+            v-if="column.inputType === 'PopoverTreeSelect'"
+            :prop="column.key"
+            :label="column.title"
+          >
+            <dr-popover-tree-select
+              v-model="params[column.key]"
               :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :multiple="column.multiple"
+              :value-key="column.valueKey"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
+              :query-params="column.queryParams(params)"
             >
-            </dr-input-dialog>
+            </dr-popover-tree-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-button type="primary" :size="size" @click="handleQueryList">
+            搜 索
+          </el-button>
+          <el-button :size="size" @click="handleResetList"> 重 置 </el-button>
+        </el-col>
       </el-row>
     </el-form>
     <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="6">
-        <el-button type="primary" :size="size" @click="handleQueryList">
-          搜 索
-        </el-button>
-        <el-button :size="size" @click="handleResetList">
-          重 置
-        </el-button></el-col
-      >
-      <el-col :span="18" style="text-align: right">
+      <el-col :span="24">
         <el-button
           :size="size"
           :disabled="selectData.length !== 1"
@@ -275,7 +301,7 @@ export default {
       @row-dblclick="handleOpenSeeDrawer"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" align="center">
+      <el-table-column fixed width="55" align="center" type="selection">
       </el-table-column>
       <el-table-column
         v-for="(column, index) in tableColumns"
@@ -287,9 +313,10 @@ export default {
       >
         <template slot-scope="scope">
           <dict-tag
-            v-if="column.type === 'Select'"
+            v-if="column.referName"
+            :size="size"
             :value="scope.row[column.key]"
-            :options="dict.type[column.config.optionsName]"
+            :options="dict.type[column.referName]"
           />
           <span v-else>{{ scope.row[column.key] }}</span>
         </template>

+ 17 - 10
src/views/purchase/task/modify-buyer/index.vue

@@ -2,9 +2,7 @@
 import { MODEIFYBUYER } from "@/api/business/purchase/task";
 export default {
   name: "ModifyBuyerDialog",
-  components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
-  },
+  components: {},
   data() {
     return {
       size: "mini",
@@ -55,14 +53,23 @@ export default {
       style="margin-bottom: 10px"
     >
     </el-alert>
-    <dr-input-dialog
-      v-model="params.buyerName"
-      title="转派人员"
-      type="CONTACTS_PARAM"
-      :data-mapping="{ buyer: 'code', buyerName: 'name' }"
-      :source.sync="params"
+    <el-form
+      :size="size"
+      :model="params"
+      label-width="0px"
+      label-position="right"
     >
-    </dr-input-dialog>
+      <el-form-item prop="" label="">
+        <dr-popover-select
+          v-model="params.buyerName"
+          title="转派人员"
+          type="CONTACTS_PARAM"
+          :data-mapping="{ buyer: 'code', buyerName: 'name' }"
+          :source.sync="params"
+        >
+        </dr-popover-select>
+      </el-form-item>
+    </el-form>
     <span slot="footer">
       <el-button :size="size" @click="visible = false">取 消</el-button>
       <el-button :size="size" type="primary" @click="handleComfire(params)"

+ 0 - 514
src/views/purchase/task/see/column.js

@@ -1,514 +0,0 @@
-export const Columns = [
-  {
-    key: "puOrgName",
-    title: "采购组织",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
-    },
-    require: true,
-  },
-  { key: "code", title: "合同编码", type: "Input" },
-  {
-    key: "lastPuMoney",
-    title: "上年度采购额",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "buyerName",
-    title: "采购员",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        buyer: "userId",
-        buyerName: "userName",
-        puDept: "deptId",
-        puDeptName: "deptName",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "supplierName",
-    title: "供应商",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "contractType",
-    title: "合同类型",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_contract_type",
-    },
-  },
-  {
-    key: "puMoneyYear",
-    title: "本年度采购额",
-    type: "InputNumber",
-    require: true,
-  },
-  {
-    key: "puDeptName",
-    title: "采购部门",
-    type: "InputDialog",
-    config: {
-      componentName: "DEPT_PARAM",
-      dataMapping: {
-        puDept: "code",
-        puDeptName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "supplierTier",
-    title: "供应商层级",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_supplier_tier",
-    },
-  },
-  { key: "contractName", title: "合同名称", type: "Input", require: true },
-  {
-    key: "grossRateAverage",
-    title: "平均毛利率",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "approveFlow",
-    title: "审批流程",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_approve_flow",
-    },
-  },
-  {
-    key: "consumableClass",
-    title: "耗材类别",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_consumable_class",
-    },
-  },
-  {
-    key: "effectiveDate",
-    title: "合同生效日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "brandGrossRate",
-    title: "同类品牌及毛利率",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "contractFormat",
-    title: "合同格式",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "productName",
-    title: "产品类别&名称",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "endDate",
-    title: "合同终止日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "invoiceTax",
-    title: "发票税率",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        invoiceTax: "mattaxesname",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "emergencyDegree",
-    title: "紧急程度",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_emergency_degree",
-    },
-  },
-  { key: "project", title: "项目医院", type: "Input", require: true },
-  {
-    key: "signDate",
-    title: "合同签订日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "deliveryType",
-    title: "交货方式",
-    type: "Select",
-    config: {
-      optionsName: "purchase_contract_delivery_type",
-    },
-  },
-  {
-    key: "source",
-    title: "合同来源",
-    type: "Input",
-    value: "自制",
-    disabled: true,
-  },
-  {
-    key: "contractPartycName",
-    title: "合同丙方",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        contractPartyc: "code",
-        contractPartycName: "name",
-      },
-    },
-  },
-  {
-    key: "guaranteePeriodEnd",
-    title: "质保期限",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "freightMethods",
-    title: "运费承担方式",
-    type: "Select",
-    config: {
-      optionsName: "purchase_contract_freight_methods",
-    },
-  },
-  {
-    key: "signDate",
-    title: "合同创建时间",
-    type: "DatePicker",
-    disabled: true,
-  },
-  {
-    key: "isTarget",
-    title: "是否有指标",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_is_target",
-    },
-  },
-  {
-    key: "contractTarget",
-    title: "合同指标",
-    type: "Input",
-    require: true,
-    placeholder: '当【是否有指标】="有"时,必填',
-  },
-  {
-    key: "exemptionPostageCondtion",
-    title: "包邮条件",
-    type: "Input",
-    placeholder:
-      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
-    span: 12,
-  },
-  {
-    key: "isRebate",
-    title: "是否有返利",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_is_rebate",
-    },
-  },
-  {
-    key: "rebatePolicy",
-    title: "返利政策",
-    type: "Input",
-    placeholder: '当【是否有返利】="有"时,必填',
-    span: 18,
-  },
-  { key: "externalContract", title: "外部合同号", type: "Input" },
-  {
-    key: "rollbackPolicy",
-    title: "退换货政策",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "contractContent",
-    title: "合同主要内容",
-    type: "Textarea",
-    require: true,
-    span: 24,
-  },
-  { key: "refusalReasons", title: "拒绝理由", type: "Input", span: 24 },
-  { key: "enquiryCode", title: "询价单号", type: "Input" },
-  { key: "externalFile", title: "对外附件", type: "Upload", span: 24 },
-  { key: "puFile", title: "采购商盖章合同附件", type: "Upload", span: 24 },
-  {
-    key: "supplierFile",
-    title: "供应商盖章合同附件",
-    type: "Upload",
-    span: 24,
-  },
-  { key: "projectCode", title: "项目编号", type: "Input" },
-  { key: "projectName", title: "项目名称", type: "Input" },
-  { key: "area", title: "区域", type: "Input" },
-  { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
-  {
-    key: "paymentAgreementName",
-    title: "付款协议",
-    type: "InputDialog",
-    config: {
-      componentName: "PAYAGREEMENT_PARAM",
-      dataMapping: {
-        paymentAgreement: "code",
-        paymentAgreementName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "taxPrice",
-    title: "价税合计",
-    type: "InputNumber",
-  },
-  {
-    key: "currencyName",
-    title: "币种",
-    type: "InputDialog",
-    config: {
-      componentName: "CURRENCY_PARAM",
-      dataMapping: {
-        currency: "code",
-        currencyName: "name",
-      },
-    },
-    require: true,
-  },
-  { key: "guaranteePeriod", title: "质保期", type: "Input" },
-
-  // { key: "buyerName", title: "采购员名称" },
-  // { key: "supplierName", title: "供应商名称" },
-
-  // { key: "puDeptName", title: "采购部门名称" },
-
-  // { key: "contractPartycName", title: "合同丙方名称" },
-
-  // { key: "currencyName", title: "币种名称" },
-  // { key: "tenantId", title: "租户号" },
-  // { key: "revision", title: "乐观锁" },
-  // { key: "createByName", title: "创建人" },
-  // { key: "updateByName", title: "创建人名称" },
-  // { key: "delFlag", title: "删除标记" },
-];
-
-export const TabColumns = [
-  {
-    show: {
-      contractType: [1, 2],
-    },
-    title: "物料基本信息",
-    key: "contractItemList",
-    tableColumns: [
-      { title: "物料编码", key: "material", width: 200 },
-      {
-        title: "物料名称",
-        key: "materialName",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "规格",
-        key: "specification",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "品牌",
-        key: "brand",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "生产厂家", key: "manufacturer", type: "Input", width: 200 },
-      {
-        title: "采购单位",
-        key: "puUnit",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "税率%",
-        key: "tax",
-        type: "InputDialog",
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-        width: 200,
-      },
-      {
-        title: "采购数量",
-        key: "qty",
-        type: "InputNumber",
-
-        width: 200,
-      },
-      {
-        title: "含税单价",
-        key: "taxPrice",
-        type: "InputNumber",
-
-        width: 200,
-      },
-      { title: "含税金额合计", key: "taxMoney", width: 200 },
-      { title: "无税单价", key: "taxFreePrice" },
-      { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
-      {
-        title: "注册证号及备案凭证号",
-        key: "registration",
-        type: "Input",
-        width: 200,
-      },
-      {
-        title: "收货客户",
-        key: "customerName",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "SUPPLIER_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "备注", key: "remark", type: "Input", width: 200 },
-    ],
-  },
-  {
-    title: "合同条款",
-    key: "contractClauseList",
-    tableColumns: [
-      { title: "条款编码", key: "code", type: "Input" },
-      { title: "条款名称", key: "name", type: "Input" },
-      { title: "条款内容", key: "content", type: "Input" },
-      { title: "变量序号", key: "variableRowno" },
-      { title: "变量内容", key: "variableContent", type: "Input" },
-      { title: "备注", key: "remark", type: "Input" },
-    ],
-  },
-  {
-    title: "合同费用",
-    key: "contractExpenseList",
-    tableColumns: [
-      { title: "费用编码", key: "code", type: "Input" },
-      { title: "费用名称", key: "name", type: "Input" },
-      {
-        title: "费用金额",
-        key: "money",
-        type: "InputNumber",
-        width: 200,
-      },
-      { title: "备注", key: "remark", type: "Input" },
-    ],
-  },
-  {
-    title: "付款协议信息",
-    key: "contractAgreementList",
-    tableColumns: [
-      {
-        title: "付款阶段",
-        key: "satge",
-        type: "InputNumber",
-        width: 200,
-      },
-      {
-        title: "付款起点",
-        key: "origin",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "账期天数", key: "paymetDays", type: "Input", width: 200 },
-      { title: "付款比例%", key: "ratio", type: "Input", width: 200 },
-      { title: "付款金额", key: "money", type: "Input", width: 200 },
-      { title: "是否预付款", key: "isAdvance", width: 200 },
-      { title: "是否质保金", key: "isQuality", width: 200 },
-      { title: "结算方式", key: "paymentMeans", type: "Input", width: 200 },
-      { title: "备注", key: "remark", type: "Input", width: 200 },
-      { title: "需进度确认", key: "schedule", type: "Select", width: 200 },
-    ],
-  },
-  {
-    title: "合同执行组织范围",
-    key: "contractApplyOrgList",
-    tableColumns: [
-      { title: "组织名称", key: "orgName", type: "Input" },
-      { title: "组织编码", key: "org", type: "Input" },
-    ],
-  },
-];

+ 24 - 71
src/views/purchase/task/see/index.vue

@@ -1,24 +1,19 @@
 <script>
 import { TableColumns as Columns } from "../column";
 import { ITEM } from "@/api/business/purchase/task";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns);
+import { initDicts, initParams } from "@/utils/init";
 
 export default {
-  name: "SeeDrawer",
-  dicts: initDicts(NewColumns),
-  components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
-  },
+  name: "SeeDialog",
+  dicts: initDicts(Columns),
+  components: {},
   data() {
     return {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
-      params: initParams(NewColumns),
+      columns: Columns,
+      params: initParams(Columns),
     };
   },
   computed: {},
@@ -44,71 +39,29 @@ export default {
         this.loading = false;
       }
     },
-    // 取消
-    handleCancel() {
-      this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
-    },
-    // 保存
-    handleSava() {
-      this.setVisible(false);
-    },
-  },
-  created() {
-    console.log("ADD CREATED");
   },
+  created() {},
   mounted() {},
   destroyed() {},
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-  >
-    <el-form
-      v-loading="loading"
-      :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
+  <el-dialog :visible.sync="visible">
+    <el-descriptions :column="2" title="明细" border>
+      <el-descriptions-item
+        v-if="params[column.key]"
+        v-for="(column, index) in columns"
+        :key="index"
+        :label="column.title"
       >
-        <div
-          slot="header"
-          style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          "
-        >
-          <h3>查 看</h3>
-          <div style="text-align: right">
-            <el-button :size="size" @click="handleCancel">取 消</el-button>
-          </div>
-        </div>
-        <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
-            <el-form-item :prop="column.key" :label="column.title">
-              {{ params[column.key] }}
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-card>
-    </el-form>
-  </el-drawer>
+        <dict-tag
+          v-if="column.referName"
+          :size="size"
+          :value="params[column.key]"
+          :options="dict.type[column.referName]"
+        />
+        <span v-else>{{ params[column.key] }}</span>
+      </el-descriptions-item>
+    </el-descriptions>
+  </el-dialog>
 </template>

+ 56 - 36
src/views/purchase/transferOrder/add.vue

@@ -11,7 +11,7 @@
         </el-col>
         <el-col :span="1.5">
             <el-form-item label="订单类型">
-              <el-select v-model="basicForm.billType" size="small" style="width: 200px" clearable>
+              <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px" clearable>
                 <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -22,6 +22,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -32,6 +33,7 @@
               <el-date-picker
                 v-model="basicForm.billDate"
                 size="small"
+                :disabled="sonDisable"
                 type="date"
                 clearable
                 value-format="yyyy-MM-dd"
@@ -41,13 +43,10 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调拨方式">
-              <el-input
-                v-model="basicForm.allotType"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-              />
+              <el-select v-model="basicForm.allotType" :disabled="sonDisable" size="small" style="width: 200px" clearable>
+                <el-option v-for="dict in dict.type.sys_to_type" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
@@ -55,7 +54,7 @@
               <el-input
                 v-model="basicForm.deliveryCode"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -66,7 +65,7 @@
               <el-input
                 v-model="basicForm.storageCode"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -118,6 +117,7 @@
               <el-input
                 v-model="basicForm.onRouteAffilliation"
                 size="small"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -128,7 +128,7 @@
               <el-input
                 v-model="basicForm.qty"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -139,7 +139,7 @@
               <el-input
                 v-model="basicForm.accountPath"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -150,7 +150,7 @@
               <el-input
                 v-model="basicForm.customer"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -161,7 +161,7 @@
               <el-input
                 v-model="basicForm.storageWarehouse"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -172,7 +172,7 @@
               <el-input
                 v-model="basicForm.deliveryWarehouse"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -180,7 +180,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="物流项目组">
-              <el-select v-model="basicForm.materialProject" size="small" style="width: 200px" clearable>
+              <el-select v-model="basicForm.materialProject" :disabled="sonDisable" 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>
@@ -205,7 +205,7 @@
               <el-input
                 v-model="basicForm.remark"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -249,7 +249,7 @@
           <el-table-column label="产地" align="center" prop="originPlaceName"/>
           <el-table-column label="型号" align="center" prop="model"/>
           <el-table-column label="单位" align="center" prop="unitName"/>
-          <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/>
+          <!-- <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
           <el-table-column label="数量" align="center" prop="qty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -267,10 +267,22 @@
             </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="storageWarehouseName"/> -->
           <el-table-column label="批次号" align="center" prop="patchNo"/>
           <el-table-column label="产品批号" align="center" prop="producBatch"/>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
+          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-date-picker
+                  v-model="scope.row.manufactureDate"
+                  :readonly="sonDisable"
+                  type="date"
+                  size="small"
+                  value-format="yyyy-MM-dd">
+                </el-date-picker>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
           <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
           <el-table-column label="注册证号" align="center" prop="registration"/>
@@ -280,9 +292,16 @@
           <el-table-column label="调入调出结算规则明细" align="center" prop="ruleDetail"/>
           <el-table-column label="上市许可持有人" align="center" prop="marketingApprovalPersonal"/>
           <el-table-column label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production"/>
-          <el-table-column label="pi码" align="center" prop="pi"/>
+          <el-table-column label="pi码" align="center" prop="pi">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.pi"/>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
           <!-- <el-table-column label="备注" align="center" prop="code"/> -->
+          <el-table-column label="类别" align="center" prop="classify"/>
           <el-table-column label="客户物料码" align="center" prop="customerLogistic"/>
           <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
           <el-table-column
@@ -410,7 +429,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -421,7 +440,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -432,7 +451,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -443,7 +462,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -458,7 +477,7 @@
               <el-input
                 v-model="basicForm.createByName"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -469,7 +488,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -480,7 +499,7 @@
               <el-input
                 v-model="basicForm.updateByName"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -491,7 +510,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
-                placeholder=""
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -527,7 +546,7 @@ import popDialog from '@/components/PopDialog/index.vue'
 
 export default {
   name: 'addOder',
-  dicts: ['sys_allot_billtype', 'sys_project_group', 'sys_status'],
+  dicts: ['sys_allot_billtype', 'sys_project_group', 'sys_status', 'sys_to_type'],
   props: ['pageStu','row', 'disable'],
   components: {
     Refers,
@@ -653,10 +672,10 @@ export default {
       getOrderDetail(row.id).then(res => {
         if (res.code === 200) {
           this.basicForm = res.data
-          // this.materialInfo = res.data.stAllotMaterialList
-          // this.receiveInfo = res.data.stAllotReceiveDeliverList
-          // this.priceList = res.data.stAllotReceiveExecuteList
-          // this.resultList = res.data.stAllotReceiveExpenseList
+          this.materialInfo = res.data.stAllotMaterialList
+          this.receiveInfo = res.data.stAllotReceiveDeliverList
+          this.priceList = res.data.stAllotReceiveExecuteList
+          this.resultList = res.data.stAllotReceiveExpenseList
         }
       })
     },
@@ -678,9 +697,9 @@ export default {
         qty: null,
         mainUnit: null,
         mainUnitName: null,
-        equation: null,
+        equation: '1/1',
         mainQty: null,
-        rate: null,
+        rate: '0.00',
         storageWarehouseName: null,
         patchNo: null,
         producBatch: null,
@@ -695,6 +714,7 @@ export default {
         marketingApprovalPersonal: null,
         production: null,
         pi: null,
+        classify: null,
         customerLogistic: null,
         customerLogisticName: null
       }

+ 17 - 7
src/views/purchase/transferOrder/index.vue

@@ -96,9 +96,12 @@
           :data="tableList" 
           fit
           show-summary
+          highlight-current-row
           max-height="680"
+          ref="multipleTable"
+          @row-click="select"
         >
-          <el-table-column label="调出库存" align="center" prop="code"/>
+          <el-table-column label="调出库存" align="center" prop="deliveryInventoryOrgName"/>
           <el-table-column label="订单类型" align="center" prop="billType"/>
           <el-table-column label="单据号" align="center" prop="code"/>
           <el-table-column label="单据日期" align="center" prop="billDate"/>
@@ -162,20 +165,20 @@
             <el-table-column label="行号" align="center" prop="rowno"/>
             <el-table-column label="物料编码" align="center" prop="material"/>
             <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="model"/>
-            <el-table-column label="单位" align="center" prop="unit"/>
-            <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/>
+            <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="equation"/>
             <el-table-column label="主数量" align="center" prop="mainQty"/>
             <el-table-column label="税率" align="center" prop="rate"/>
-            <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/>
+            <!-- <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/> -->
             <el-table-column label="批次号" align="center" prop="patchNo"/>
             <el-table-column label="产品批号" align="center" prop="producBatch"/>
             <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
@@ -191,6 +194,7 @@
             <el-table-column label="pi码" align="center" prop="pi"/>
             <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
             <!-- <el-table-column label="备注" align="center" prop="code"/> -->
+            <el-table-column label="类别" align="center" prop="classify"/>
             <el-table-column label="客户物料码" align="center" prop="customerLogistic"/>
             <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
             </el-table>
@@ -360,6 +364,7 @@ export default {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total
+          this.materialInfo = res.rows[0].stAllotMaterialList
         }
       })
     },
@@ -380,6 +385,11 @@ export default {
       this.rowDetail = row
       this.disable = false
     },
+    // 选中某行
+    select(row) {
+      console.log('选中', row)
+      this.materialInfo = row.stAllotMaterialList
+    },
     // 行内删除
     deleteids(row) {
       console.log('row', row)