Parcourir la source

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!50
黄梓星 il y a 2 ans
Parent
commit
395daf523b
37 fichiers modifiés avec 1512 ajouts et 297 suppressions
  1. 17 6
      src/api/business/purchase/task.js
  2. 1 2
      src/components/Refers/treeRefer.vue
  3. 15 0
      src/components/input-dialog/components/CONTACTS_PARAM.js
  4. 21 0
      src/components/input-dialog/components/PSNLICENSE_PARAM.js
  5. 18 0
      src/components/popover-multiple-select/api/index.js
  6. 22 0
      src/components/popover-multiple-select/components/ALLOCATION_PARAM.js
  7. 21 0
      src/components/popover-multiple-select/components/BALATYPE_PARAM.js
  8. 15 0
      src/components/popover-multiple-select/components/CONTACTS_PARAM.js
  9. 30 0
      src/components/popover-multiple-select/components/CURRENCY_PARAM.js
  10. 22 0
      src/components/popover-multiple-select/components/CUSTOMERDEPT_PARAM.js
  11. 21 0
      src/components/popover-multiple-select/components/CUSTOMER_PARAM.js
  12. 14 0
      src/components/popover-multiple-select/components/DEPT_PARAM.js
  13. 14 0
      src/components/popover-multiple-select/components/MATERIAL_PARAM.js
  14. 21 0
      src/components/popover-multiple-select/components/OPERATING_PARAM.js
  15. 14 0
      src/components/popover-multiple-select/components/ORG_PARAM.js
  16. 14 0
      src/components/popover-multiple-select/components/PAYAGREEMENT_PARAM.js
  17. 21 0
      src/components/popover-multiple-select/components/PROCESSTYPE_PARAM.js
  18. 21 0
      src/components/popover-multiple-select/components/PROJECT_PARAM.js
  19. 21 0
      src/components/popover-multiple-select/components/PSNLICENSE_PARAM.js
  20. 21 0
      src/components/popover-multiple-select/components/RETREASON_PARAM.js
  21. 21 0
      src/components/popover-multiple-select/components/SUPPLIERCONTACTS_PARAM.js
  22. 14 0
      src/components/popover-multiple-select/components/SUPPLIER_PARAM.js
  23. 29 0
      src/components/popover-multiple-select/components/WAREHOUSE_PARAM.js
  24. 190 0
      src/components/popover-multiple-select/components/index.vue
  25. 145 0
      src/components/popover-multiple-select/index.vue
  26. 0 1
      src/views/purchase/MaterialClassDivision/add.vue
  27. 129 41
      src/views/purchase/MaterialClassDivision/index.vue
  28. 22 6
      src/views/purchase/PurchaseDemandList/add.vue
  29. 108 44
      src/views/purchase/deliveryAddress/index.vue
  30. 30 9
      src/views/purchase/task/column.js
  31. 71 0
      src/views/purchase/task/documents-return/index.vue
  32. 1 4
      src/views/purchase/task/first-direct/index.vue
  33. 69 92
      src/views/purchase/task/index.vue
  34. 75 0
      src/views/purchase/task/modify-buyer/index.vue
  35. 3 3
      src/views/purchase/task/see/index.vue
  36. 239 87
      src/views/purchase/transferOrder/add.vue
  37. 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,
+  });
+}

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

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

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

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

@@ -388,7 +388,6 @@ export default {
     },
     selectionsToInput (selections) {
       console.log('父组件拿到的:', selections)
-      this.selectData = selections
       this.basicForm.material = selections[0].id
       this.basicForm.materialCode = selections[0].code
       this.basicForm.materialName = selections[0].name

+ 129 - 41
src/views/purchase/MaterialClassDivision/index.vue

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

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

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

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

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

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

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

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

+ 2 - 2
vue.config.js

@@ -37,14 +37,14 @@ 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.47:8000/drp-admin`, //石杨本地
-        target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
+        // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
         changeOrigin: true,
         pathRewrite: {