002201 2 gadi atpakaļ
vecāks
revīzija
7a79c29010
31 mainītis faili ar 1013 papildinājumiem un 116 dzēšanām
  1. 17 6
      src/api/business/purchase/task.js
  2. 15 0
      src/components/input-dialog/components/CONTACTS_PARAM.js
  3. 21 0
      src/components/input-dialog/components/PSNLICENSE_PARAM.js
  4. 18 0
      src/components/popover-multiple-select/api/index.js
  5. 22 0
      src/components/popover-multiple-select/components/ALLOCATION_PARAM.js
  6. 21 0
      src/components/popover-multiple-select/components/BALATYPE_PARAM.js
  7. 15 0
      src/components/popover-multiple-select/components/CONTACTS_PARAM.js
  8. 30 0
      src/components/popover-multiple-select/components/CURRENCY_PARAM.js
  9. 22 0
      src/components/popover-multiple-select/components/CUSTOMERDEPT_PARAM.js
  10. 21 0
      src/components/popover-multiple-select/components/CUSTOMER_PARAM.js
  11. 14 0
      src/components/popover-multiple-select/components/DEPT_PARAM.js
  12. 14 0
      src/components/popover-multiple-select/components/MATERIAL_PARAM.js
  13. 21 0
      src/components/popover-multiple-select/components/OPERATING_PARAM.js
  14. 14 0
      src/components/popover-multiple-select/components/ORG_PARAM.js
  15. 14 0
      src/components/popover-multiple-select/components/PAYAGREEMENT_PARAM.js
  16. 21 0
      src/components/popover-multiple-select/components/PROCESSTYPE_PARAM.js
  17. 21 0
      src/components/popover-multiple-select/components/PROJECT_PARAM.js
  18. 21 0
      src/components/popover-multiple-select/components/PSNLICENSE_PARAM.js
  19. 21 0
      src/components/popover-multiple-select/components/RETREASON_PARAM.js
  20. 21 0
      src/components/popover-multiple-select/components/SUPPLIERCONTACTS_PARAM.js
  21. 14 0
      src/components/popover-multiple-select/components/SUPPLIER_PARAM.js
  22. 29 0
      src/components/popover-multiple-select/components/WAREHOUSE_PARAM.js
  23. 190 0
      src/components/popover-multiple-select/components/index.vue
  24. 145 0
      src/components/popover-multiple-select/index.vue
  25. 30 9
      src/views/purchase/task/column.js
  26. 71 0
      src/views/purchase/task/documents-return/index.vue
  27. 1 4
      src/views/purchase/task/first-direct/index.vue
  28. 69 92
      src/views/purchase/task/index.vue
  29. 75 0
      src/views/purchase/task/modify-buyer/index.vue
  30. 3 3
      src/views/purchase/task/see/index.vue
  31. 2 2
      vue.config.js

+ 17 - 6
src/api/business/purchase/task.js

@@ -1,6 +1,5 @@
 import request from "@/utils/request";
 
-// 查询任务列表
 export function LIST(data) {
   return request({
     url: "/pu/order/generate/list",
@@ -9,15 +8,13 @@ export function LIST(data) {
   });
 }
 
-// 查询任务列表
-export function item(data) {
+export function ITEM(data) {
   return request({
     url: `/pu/order/generate/${data}`,
     method: "GET",
   });
 }
 
-// 查询任务列表
 export function FIRSTDIRECT(data) {
   return request({
     url: "/pu/order/generate/manualAgreement",
@@ -26,7 +23,6 @@ export function FIRSTDIRECT(data) {
   });
 }
 
-// 查询任务列表
 export function ADD(data) {
   return request({
     url: "/pu/order/create",
@@ -35,7 +31,6 @@ export function ADD(data) {
   });
 }
 
-// 查询任务列表
 export function SHUTDOWN(data) {
   return request({
     url: `/pu/demand/item/summary/shutDown/${data}`,
@@ -43,3 +38,19 @@ export function SHUTDOWN(data) {
     data: data,
   });
 }
+
+export function DOCUMENTSRETURN(data) {
+  return request({
+    url: "/pu/order/generate/documentsReturn",
+    method: "PUT",
+    data: data,
+  });
+}
+
+export function MODEIFYBUYER(data) {
+  return request({
+    url: "/pu/order/generate/modifyBuyer",
+    method: "PUT",
+    data: data,
+  });
+}

+ 15 - 0
src/components/input-dialog/components/CONTACTS_PARAM.js

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

+ 21 - 0
src/components/input-dialog/components/PSNLICENSE_PARAM.js

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

+ 18 - 0
src/components/popover-multiple-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-multiple-select/components/ALLOCATION_PARAM.js

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -0,0 +1,29 @@
+// 收货仓库
+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: "助记码",
+  },
+];

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

@@ -0,0 +1,190 @@
+<script>
+import { refer } from "../api/index";
+// import { initParams } from "@/utils/init";
+
+export default {
+  name: "TableDialog",
+  props: ["type", "title", "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",
+      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: "", isPage: true },
+      // searchColumns: SearchColumns,
+      // table
+      data: [],
+      multipleSelection: [],
+      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,
+            ...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.search = "";
+      this.params.isPage = true;
+      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
+    handleClick(row) {
+      this.currentData = row;
+    },
+    // double click select row data and confirm
+    handleDoubleClick(row) {
+      this.confirm(row);
+    },
+    // multiple
+    handleSelectionChange(prop) {
+      this.multipleSelection = prop;
+      this.$notify.success({ title: "success" });
+    },
+    //
+    confirm(prop) {
+      this.setVisible(false);
+      if (prop.length) this.$emit("confirm", prop);
+    },
+  },
+  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="handleClick"
+      @row-dblclick="handleDoubleClick"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center">
+      </el-table-column>
+      <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"
+    >
+      <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(multipleSelection)"
+        >确 定</el-button
+      >
+    </div>
+  </el-dialog>
+</template>
+<style scoped></style>

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

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

+ 30 - 9
src/views/purchase/task/column.js

@@ -1,7 +1,20 @@
 export const TableColumns = [
-  { key: "id", title: "主键" },
-  { key: "material", title: "物料", search: true, type: "Input" },
   { key: "materialName", title: "物料名称", search: true, type: "Input" },
+  { key: "material", title: "物料", search: true, type: "Input" },
+  { key: "materialDesc", title: "物料/物料描述", search: true, type: "Input" },
+  { key: "manufacturerName", title: "生产厂家名称" },
+  { key: "puQty", title: "采购数量" },
+  {
+    key: "priceType",
+    title: "价格类型",
+    type: "Select",
+    config: {
+      optionsName: "sys_price_type",
+    },
+  },
+  { key: "puUnitName", title: "采购单位名称" },
+
+  { key: "id", title: "主键" },
   {
     key: "status",
     title: "状态",
@@ -11,16 +24,25 @@ export const TableColumns = [
       optionsName: "purchase_task_status",
     },
   },
-  { key: "materialDesc", title: "物料/物料描述", search: true, type: "Input" },
   { key: "manufacturer", title: "生产厂家" },
-  { key: "manufacturerName", title: "生产厂家名称" },
-  { key: "priceType", title: "价格类型" },
   { key: "buyer", title: "采购员" },
   { key: "buyerName", title: "采购员名称", search: true, type: "Input" },
   { key: "supplier", title: "建议供应商" },
   { key: "supplierName", title: "建议供应商名称" },
   { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
+  {
+    key: "puOrgName",
+    title: "采购组织名称",
+    search: true,
+    type: "InputDialog",
+    config: {
+      componentName: "ORG_PARAM",
+      dataMapping: {
+        puOrg: "code",
+        puOrgName: "name",
+      },
+    },
+  },
   { key: "currency", title: "币种" },
   { key: "currencyName", title: "币种名称" },
   { key: "billYpe", title: "交易类型" },
@@ -28,9 +50,8 @@ export const TableColumns = [
   { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户名称" },
   { key: "puUnit", title: "采购单位" },
-  { key: "puUnitName", title: "采购单位名称" },
-  { key: "puQty", title: "采购数量" },
-  { key: "demandDate", title: "需求时间", search: true, type: "Input" },
+
+  { key: "demandDate", title: "需求时间", search: true, type: "DatePicker" },
   { key: "projectName", title: "项目名称" },
   { key: "demandPersonal", title: "需求人" },
   {

+ 71 - 0
src/views/purchase/task/documents-return/index.vue

@@ -0,0 +1,71 @@
+<script>
+import { DOCUMENTSRETURN } from "@/api/business/purchase/task";
+export default {
+  name: "DocumentsReturnDialog",
+  components: {},
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      params: { baskCause: "", documentIds: [] },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    beforeOpenDoSome(prop) {
+      const documentIds = prop.map((item) => item.demandItemId);
+      this.params.documentIds = documentIds;
+    },
+    async handleComfire(prop) {
+      try {
+        this.loading = true;
+        const { baskCause, documentIds } = prop;
+        const { code, msg } = await DOCUMENTSRETURN({
+          baskCause: baskCause,
+          documentIds: documentIds,
+        });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.visible = false;
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+  <el-dialog title="请购退回" width="30%" :visible.sync="visible">
+    <el-alert
+      title="请填写退单原因"
+      type="info"
+      show-icon
+      :closable="false"
+      style="margin-bottom: 10px"
+    >
+    </el-alert>
+    <el-input :size="size" v-model="params.baskCause"></el-input>
+    <span slot="footer">
+      <el-button :size="size" @click="visible = false">取 消</el-button>
+      <el-button :size="size" type="primary" @click="handleComfire(params)"
+        >确 定</el-button
+      >
+    </span>
+  </el-dialog>
+</template>
+
+<style scoped></style>

+ 1 - 4
src/views/purchase/task/first-direct/index.vue

@@ -13,9 +13,6 @@ export default {
 
       tableColumns: initColumns(TableColumns),
       data: [],
-      //   page: { pageNum: 1, pageSize: 25 },
-      //   total: 0,
-      //   pageSizes: [25, 50, 100],
     };
   },
   computed: {},
@@ -25,7 +22,7 @@ export default {
       this.visible = prop;
     },
     // 查询详细
-    async fetchItem(prop) {
+    async beforeOpenDoSome(prop) {
       try {
         this.loading = true;
         const { code, msg, data } = await FIRSTDIRECT(prop);

+ 69 - 92
src/views/purchase/task/index.vue

@@ -13,8 +13,12 @@ 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"),
+    ModifyBuyerDialog: () => import("./modify-buyer/index.vue"),
   },
   data() {
     return {
@@ -91,7 +95,7 @@ export default {
     handleSelectionChange(prop) {
       this.selectData = prop;
     },
-    // 行删除
+    // 行关闭
     async handleShutDown(prop) {
       try {
         this.loading = true;
@@ -99,6 +103,7 @@ export default {
         const { code, msg } = await SHUTDOWN(demandItemId);
         if (code === 200) {
           this.$notify.success({ title: msg });
+          await this.handleQueryList();
         } else {
           this.$notify.warning({ title: msg });
         }
@@ -108,18 +113,31 @@ export default {
         this.loading = false;
       }
     },
+    // 退回请购
+    async handleDocumentsReturn(prop) {
+      const { setVisible, beforeOpenDoSome } = this.$refs.DocumentsReturnDialog;
+      await setVisible(true);
+      await beforeOpenDoSome(prop);
+    },
+    // 转派
+    async handleModifyBuyer(prop) {
+      const { id } = prop;
+      const { setVisible, beforeOpenDoSome } = this.$refs.ModifyBuyerDialog;
+      await setVisible(true);
+      await beforeOpenDoSome(id);
+    },
     // 打开查看drawer
     async handleOpenSeeDrawer(prop) {
       const { id } = prop;
-      const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
+      const { setVisible, beforeOpenDoSome } = this.$refs.SeeDrawerFef;
       await setVisible(true);
-      await fetchItem(id);
+      await beforeOpenDoSome(id);
     },
     // 打开首次直采drawer
     async handleOpenFristDirectDrawer(prop) {
-      const { setVisible, fetchItem } = this.$refs.FirstDirectDrawerRef;
+      const { setVisible, beforeOpenDoSome } = this.$refs.FirstDirectDrawerRef;
       await setVisible(true);
-      await fetchItem(prop);
+      await beforeOpenDoSome(prop);
     },
   },
 };
@@ -133,6 +151,10 @@ export default {
   >
     <see-drawer ref="SeeDrawerFef"></see-drawer>
     <first-direct-drawer ref="FirstDirectDrawerRef"></first-direct-drawer>
+    <documents-return-dialog
+      ref="DocumentsReturnDialog"
+    ></documents-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-col
@@ -175,6 +197,34 @@ export default {
               </el-option>
             </el-select>
           </el-form-item>
+          <el-form-item
+            v-if="column.type === 'DatePicker'"
+            :prop="column.key"
+            :label="column.title"
+          >
+            <el-date-picker
+              v-model="params[column.key]"
+              :type="column.config.type"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item
+            v-if="column.type === 'InputDialog'"
+            :prop="column.key"
+            :label="column.title"
+          >
+            <dr-input-dialog
+              v-model="params[column.key]"
+              :placeholder="column.placeholder"
+              :title="column.title"
+              :type="column.config.componentName"
+              :data-mapping="column.config.dataMapping"
+              :source.sync="params"
+            >
+            </dr-input-dialog>
+          </el-form-item>
         </el-col>
       </el-row>
     </el-form>
@@ -191,23 +241,23 @@ export default {
         <el-button
           :size="size"
           :disabled="selectData.length !== 1"
-          @click="handleShutDown(selectData[0])"
+          @click="handleModifyBuyer(selectData[0])"
         >
-          分配
+          转 派
         </el-button>
         <el-button
           :size="size"
-          :disabled="selectData.length !== 1"
-          @click="handleShutDown(selectData[0])"
+          :disabled="!selectData.length"
+          @click="handleDocumentsReturn(selectData)"
         >
-          退回需求
+          退回请购
         </el-button>
         <el-button
           :size="size"
           :disabled="selectData.length !== 1"
           @click="handleShutDown(selectData[0])"
         >
-          行删除
+          行关闭
         </el-button>
         <el-button
           :size="size"
@@ -216,87 +266,6 @@ export default {
         >
           协议直采
         </el-button>
-        <!-- <el-button
-          size="mini"
-          type="danger"
-          style="margin: 0 10px 0 0"
-          @click="handleOpenAddDrawer"
-        >
-          新增
-        </el-button>
-        <el-dropdown placement="bottom-start">
-          <el-button size="mini" style="margin: 0 10px 0 0">
-            发布
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>发布寻源</el-dropdown-item>
-            <el-dropdown-item>发布委托</el-dropdown-item>
-            <el-dropdown-item>采购方案</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-
-        <el-dropdown placement="bottom-start">
-          <el-button
-            size="mini"
-            style="border-right: 0; border-radius: 3px 0 0 3px"
-          >
-            首次协议直采
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>首次协议直采</el-dropdown-item>
-            <el-dropdown-item>余量协议直采</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <el-dropdown placement="bottom-start">
-          <el-button size="mini" style="border-right: 0; border-radius: 0">
-            跟单采购
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>按合同(普通)取价</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <el-button size="mini" style="border-right: 0; border-radius: 0">
-          Excel导出
-        </el-button>
-        <el-button
-          size="mini"
-          style="margin: 0; border-right: 0; border-radius: 0"
-        >
-          退回请购
-        </el-button>
-        <el-dropdown placement="bottom-start">
-          <el-button size="mini" style="border-right: 0; border-radius: 0">
-            清单采购
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>商超匹配下单</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <el-button
-          size="mini"
-          disabled
-          style="margin: 0 10px 0 0; border-radius: 0 3px 3px 0"
-        >
-          一键合同下单
-        </el-button>
-        <el-button size="mini" style="margin: 0 10px 0 0">删除</el-button>
-        <el-dropdown placement="bottom-end">
-          <el-button size="mini">
-            更多
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>抢单</el-dropdown-item>
-            <el-dropdown-item>批量修改收货组织</el-dropdown-item>
-            <el-dropdown-item>批量退回</el-dropdown-item>
-            <el-dropdown-item>退回需求申请</el-dropdown-item>
-            <el-dropdown-item>刷新缓存</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown> -->
       </el-col>
     </el-row>
     <el-table
@@ -316,6 +285,14 @@ export default {
         :width="column.width || 180"
         :show-overflow-tooltip="column.showOverflowTooltip || true"
       >
+        <template slot-scope="scope">
+          <dict-tag
+            v-if="column.type === 'Select'"
+            :value="scope.row[column.key]"
+            :options="dict.type[column.config.optionsName]"
+          />
+          <span v-else>{{ scope.row[column.key] }}</span>
+        </template>
       </el-table-column>
     </el-table>
     <el-pagination

+ 75 - 0
src/views/purchase/task/modify-buyer/index.vue

@@ -0,0 +1,75 @@
+<script>
+import { MODEIFYBUYER } from "@/api/business/purchase/task";
+export default {
+  name: "ModifyBuyerDialog",
+  components: {
+    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+  },
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      params: { id: "", buyer: "", buyerName: "" },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    beforeOpenDoSome(prop) {
+      this.params.id = prop;
+    },
+    async handleComfire(prop) {
+      try {
+        this.loading = true;
+        const { code, msg } = await MODEIFYBUYER([prop]);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.visible = false;
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+  <el-dialog title="转派" width="30%" :visible.sync="visible">
+    <el-alert
+      title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"
+      type="info"
+      show-icon
+      :closable="false"
+      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"
+    >
+    </dr-input-dialog>
+    <span slot="footer">
+      <el-button :size="size" @click="visible = false">取 消</el-button>
+      <el-button :size="size" type="primary" @click="handleComfire(params)"
+        >确 定</el-button
+      >
+    </span>
+  </el-dialog>
+</template>
+
+<style scoped></style>

+ 3 - 3
src/views/purchase/task/see/index.vue

@@ -1,6 +1,6 @@
 <script>
 import { TableColumns as Columns } from "../column";
-import { item } from "@/api/business/purchase/task";
+import { ITEM } from "@/api/business/purchase/task";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
 
 const NewColumns = initColumns(Columns);
@@ -28,10 +28,10 @@ export default {
       this.visible = prop;
     },
     // 查询详细
-    async fetchItem(prop) {
+    async beforeOpenDoSome(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await item(prop);
+        const { code, msg, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
           this.$notify.success({ title: msg });

+ 2 - 2
vue.config.js

@@ -37,12 +37,12 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-        target: `http://test-sy.derom.com/drp-admin`, //测试
+        // target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
-        // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
+        target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地