浏览代码

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

002390 2 年之前
父节点
当前提交
9b4fbc01ad
共有 39 个文件被更改,包括 1124 次插入1286 次删除
  1. 2 1
      src/api/business/purchase/task.js
  2. 4 2
      src/components/DictTag/index.vue
  3. 0 145
      src/components/popover-multiple-select/index.vue
  4. 0 0
      src/components/popover-select/api/index.js
  5. 0 0
      src/components/popover-select/components/ALLOCATION_PARAM.js
  6. 0 0
      src/components/popover-select/components/BALATYPE_PARAM.js
  7. 0 0
      src/components/popover-select/components/CONTACTS_PARAM.js
  8. 0 0
      src/components/popover-select/components/CURRENCY_PARAM.js
  9. 0 0
      src/components/popover-select/components/CUSTOMERDEPT_PARAM.js
  10. 0 0
      src/components/popover-select/components/CUSTOMER_PARAM.js
  11. 0 0
      src/components/popover-select/components/DEPT_PARAM.js
  12. 0 0
      src/components/popover-select/components/MATERIAL_PARAM.js
  13. 0 0
      src/components/popover-select/components/OPERATING_PARAM.js
  14. 0 0
      src/components/popover-select/components/ORG_PARAM.js
  15. 0 0
      src/components/popover-select/components/PAYAGREEMENT_PARAM.js
  16. 0 0
      src/components/popover-select/components/PROCESSTYPE_PARAM.js
  17. 0 0
      src/components/popover-select/components/PROJECT_PARAM.js
  18. 0 0
      src/components/popover-select/components/PSNLICENSE_PARAM.js
  19. 0 0
      src/components/popover-select/components/RETREASON_PARAM.js
  20. 0 0
      src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js
  21. 0 0
      src/components/popover-select/components/SUPPLIER_PARAM.js
  22. 0 0
      src/components/popover-select/components/WAREHOUSE_PARAM.js
  23. 19 20
      src/components/popover-select/components/index.vue
  24. 210 0
      src/components/popover-select/index.vue
  25. 18 0
      src/components/popover-tree-select/api/index.js
  26. 22 0
      src/components/popover-tree-select/components/MATERIALCLASSIFY_PARAM.js
  27. 177 0
      src/components/popover-tree-select/components/index.vue
  28. 209 0
      src/components/popover-tree-select/index.vue
  29. 63 50
      src/main.js
  30. 11 31
      src/utils/init/index.js
  31. 33 0
      src/utils/init/setting.js
  32. 158 46
      src/views/purchase/task/column.js
  33. 0 105
      src/views/purchase/task/config/add.js
  34. 7 24
      src/views/purchase/task/first-direct/column.js
  35. 70 210
      src/views/purchase/task/first-direct/index.vue
  36. 80 57
      src/views/purchase/task/index.vue
  37. 17 10
      src/views/purchase/task/modify-buyer/index.vue
  38. 0 514
      src/views/purchase/task/see/column.js
  39. 24 71
      src/views/purchase/task/see/index.vue

+ 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,
   });
 }
 

+ 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 - 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/popover-multiple-select/api/index.js → src/components/popover-select/api/index.js


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


+ 0 - 0
src/components/popover-multiple-select/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"

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

@@ -0,0 +1,210 @@
+<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,
+  },
+  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 = "";
+        }
+      },
+      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);
+      }
+    },
+  },
+  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>

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

@@ -0,0 +1,18 @@
+import request from "@/utils/request";
+
+export function list(url, params) {
+  return request({
+    url: `/pu/contract/${url}/list`,
+    method: "get",
+    params: params,
+  });
+}
+
+export function refer(data, params) {
+  return request({
+    url: "/refer/query",
+    method: "POST",
+    data: data,
+    params: params,
+  });
+}

+ 22 - 0
src/components/popover-tree-select/components/MATERIALCLASSIFY_PARAM.js

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

+ 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>

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

@@ -0,0 +1,209 @@
+<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 = "";
+        }
+      },
+      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);
+      }
+    },
+  },
+  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];
+};

+ 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>

+ 80 - 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,13 +124,13 @@ 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);
     },
@@ -149,25 +144,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 +175,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 +187,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 +196,70 @@ 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)"
+            >
+            </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 +297,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 +309,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>