Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

001295 2 лет назад
Родитель
Сommit
66468ab312
57 измененных файлов с 2670 добавлено и 2652 удалено
  1. 1 1
      src/api/business/purchase/apply.js
  2. 4 4
      src/api/business/purchase/contract.js
  3. 9 0
      src/api/business/purchase/task.js
  4. 8 0
      src/api/purchase/basic.js
  5. 1 1
      src/assets/styles/variables.scss
  6. 39 19
      src/components/FileUpload/index.vue
  7. 3 1
      src/components/PopDialog/index.vue
  8. 171 0
      src/components/Refers/batchRefer.vue
  9. 2 2
      src/components/Refers/refers.vue
  10. 0 189
      src/components/popover-select/components/index.vue
  11. 234 98
      src/components/popover-select/index.vue
  12. 4 3
      src/components/popover-tree-select/components/index.vue
  13. 27 27
      src/components/popover-tree-select/index.vue
  14. 59 34
      src/layout/components/Sidebar/SidebarItem.vue
  15. 61 45
      src/layout/components/Sidebar/index.vue
  16. 1 2
      src/utils/init/index.js
  17. 5 3
      src/utils/request.js
  18. 5 2
      src/views/marketing/dealer-authorization/index.vue
  19. 1 1
      src/views/purchase/DemandSummary/add.vue
  20. 2 2
      src/views/purchase/DemandSummary/index.vue
  21. 5 3
      src/views/purchase/MaterialClassDivision/add.vue
  22. 4 3
      src/views/purchase/MaterialClassDivision/index.vue
  23. 7 53
      src/views/purchase/PurchaseDemandList/add.vue
  24. 12 38
      src/views/purchase/PurchaseDemandList/index.vue
  25. 2 2
      src/views/purchase/apply/add/index.vue
  26. 23 17
      src/views/purchase/apply/column.js
  27. 3 3
      src/views/purchase/apply/edit/index.vue
  28. 52 35
      src/views/purchase/apply/index.vue
  29. 2 2
      src/views/purchase/apply/see/index.vue
  30. 2 2
      src/views/purchase/catalogue/add/index.vue
  31. 3 3
      src/views/purchase/catalogue/edit/index.vue
  32. 2 2
      src/views/purchase/catalogue/index.vue
  33. 2 2
      src/views/purchase/catalogue/see/index.vue
  34. 0 514
      src/views/purchase/contract/add/column.js
  35. 211 151
      src/views/purchase/contract/add/index.vue
  36. 465 62
      src/views/purchase/contract/column.js
  37. 203 77
      src/views/purchase/contract/edit/index.vue
  38. 37 53
      src/views/purchase/contract/index.vue
  39. 69 249
      src/views/purchase/contract/see/index.vue
  40. 4 4
      src/views/purchase/deliveryAddress/add.vue
  41. 4 4
      src/views/purchase/deliveryAddress/index.vue
  42. 1 1
      src/views/purchase/purchase-content/index.vue
  43. 1 1
      src/views/purchase/purchase-content/see-purchase-task.vue
  44. 191 201
      src/views/purchase/purchase-order/add/column.js
  45. 171 259
      src/views/purchase/purchase-order/add/index.vue
  46. 1 1
      src/views/purchase/purchase-order/column.js
  47. 28 24
      src/views/purchase/purchase-order/edit/index.vue
  48. 3 3
      src/views/purchase/purchase-order/index.vue
  49. 1 1
      src/views/purchase/purchase-order/see/index.vue
  50. 14 14
      src/views/purchase/task/column.js
  51. 8 4
      src/views/purchase/task/documents-return/index.vue
  52. 4 6
      src/views/purchase/task/first-direct/index.vue
  53. 128 167
      src/views/purchase/task/index.vue
  54. 7 2
      src/views/purchase/task/modify-buyer/index.vue
  55. 6 3
      src/views/purchase/task/see/index.vue
  56. 178 99
      src/views/purchase/transferOrder/add.vue
  57. 179 153
      src/views/purchase/transferOrder/index.vue

+ 1 - 1
src/api/business/purchase/apply.js

@@ -1,6 +1,6 @@
 import request from "@/utils/request";
 
-export function list(params) {
+export function LIST(params) {
   return request({
     url: "/pu/priceApply/list",
     method: "GET",

+ 4 - 4
src/api/business/purchase/contract.js

@@ -1,6 +1,6 @@
 import request from "@/utils/request";
 
-export function list(params) {
+export function LIST(params) {
   return request({
     url: "/pu/contract/list",
     method: "GET",
@@ -24,14 +24,14 @@ export function edit(data) {
   });
 }
 
-export function remove(data) {
+export function REMOVE(data) {
   return request({
     url: `/pu/contract/${data}`,
     method: "delete",
   });
 }
 
-export function item(data) {
+export function ITEM(data) {
   return request({
     url: `/pu/contract/${data}`,
     method: "GET",
@@ -45,7 +45,7 @@ export function generateCode() {
   });
 }
 
-export function itemTableList(params, name) {
+export function ITEMTABLELIST(params, name) {
   let url = "";
   if (name === "contractItemList") url = "/pu/contract/item/list";
   if (name === "contractClauseList") url = "/pu/contract/clause/list";

+ 9 - 0
src/api/business/purchase/task.js

@@ -55,3 +55,12 @@ export function MODEIFYBUYER(data) {
     data: data,
   });
 }
+
+export function EXPORT(data, params) {
+  return request({
+    url: "/pu/order/generate/export",
+    method: "POST",
+    data: data,
+    params: params,
+  });
+}

+ 8 - 0
src/api/purchase/basic.js

@@ -45,4 +45,12 @@ export function getRefer(data) {
     method: 'post',
     data: data
   })
+}
+// 查询批次号参照
+export function getBatchRefer(data) {
+  return request({
+    url: `/pu/allot/queryPatchCode?pageSize=${data.pageSize}&pageNum=${data.pageNo}`,
+    method: 'post',
+    data: data
+  })
 }

+ 1 - 1
src/assets/styles/variables.scss

@@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17;
 $base-sub-menu-hover:#001528;
 */
 
-$base-sidebar-width: 200px;
+$base-sidebar-width: 270px;
 
 // the :export directive is the magic sauce for webpack
 // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

+ 39 - 19
src/components/FileUpload/index.vue

@@ -19,20 +19,38 @@
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
-        <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
-        <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
+        <template v-if="fileSize">
+          大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
+        </template>
+        <template v-if="fileType">
+          格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
+        </template>
         的文件
       </div>
     </el-upload>
 
     <!-- 文件列表 -->
-    <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
-      <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
-        <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
+    <transition-group
+      class="upload-file-list el-upload-list el-upload-list--text"
+      name="el-fade-in-linear"
+      tag="ul"
+    >
+      <li
+        :key="file.url"
+        class="el-upload-list__item ele-upload-list__item-content"
+        v-for="(file, index) in fileList"
+      >
+        <el-link
+          :href="`${baseUrl}${file.url}`"
+          :underline="false"
+          target="_blank"
+        >
           <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
-          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+          <el-link :underline="false" @click="handleDelete(index)" type="danger"
+            >删除</el-link
+          >
         </div>
       </li>
     </transition-group>
@@ -65,15 +83,15 @@ export default {
     // 是否显示提示
     isShowTip: {
       type: Boolean,
-      default: true
-    }
+      default: true,
+    },
   },
   data() {
     return {
       number: 0,
       uploadList: [],
       baseUrl: process.env.VUE_APP_BASE_API,
-      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
+      uploadFileUrl: process.env.VUE_APP_BASE_API + "/pu/contract/upload", // 上传文件服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },
@@ -86,9 +104,9 @@ export default {
         if (val) {
           let temp = 1;
           // 首先将值转为数组
-          const list = Array.isArray(val) ? val : this.value.split(',');
+          const list = Array.isArray(val) ? val : this.value.split(",");
           // 然后将数组转为对象数组
-          this.fileList = list.map(item => {
+          this.fileList = list.map((item) => {
             if (typeof item === "string") {
               item = { name: item, url: item };
             }
@@ -101,8 +119,8 @@ export default {
         }
       },
       deep: true,
-      immediate: true
-    }
+      immediate: true,
+    },
   },
   computed: {
     // 是否显示提示
@@ -115,11 +133,13 @@ export default {
     handleBeforeUpload(file) {
       // 校检文件类型
       if (this.fileType) {
-        const fileName = file.name.split('.');
+        const fileName = file.name.split(".");
         const fileExt = fileName[fileName.length - 1];
         const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
         if (!isTypeOk) {
-          this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
+          this.$modal.msgError(
+            `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
+          );
           return false;
         }
       }
@@ -142,7 +162,7 @@ export default {
     // 上传失败
     handleUploadError(err) {
       this.$modal.msgError("上传文件失败,请重试");
-      this.$modal.closeLoading()
+      this.$modal.closeLoading();
     },
     // 上传成功回调
     handleUploadSuccess(res, file) {
@@ -187,9 +207,9 @@ export default {
       for (let i in list) {
         strs += list[i].url + separator;
       }
-      return strs != '' ? strs.substr(0, strs.length - 1) : '';
-    }
-  }
+      return strs != "" ? strs.substr(0, strs.length - 1) : "";
+    },
+  },
 };
 </script>
 

+ 3 - 1
src/components/PopDialog/index.vue

@@ -56,6 +56,7 @@ export default {
       searchForm: {
         code: '',
         name: '',
+        isSync: '',
         pageNo: 1,
         pageSize: 10,
       },
@@ -82,8 +83,9 @@ export default {
     }
   },
   methods: {
-    init() {
+    init(val) {
       this.visible = true;
+      this.searchForm.isSync = val
       this.$nextTick(() => {
         this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
         this.resetSearch();

+ 171 - 0
src/components/Refers/batchRefer.vue

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

+ 2 - 2
src/components/Refers/refers.vue

@@ -112,8 +112,8 @@ export default {
     },
     // 排序
     resetSearch() {
-      this.$refs['searchForm'].resetFields();
-      this.searchForm.pageNo = 1;
+      this.searchForm.pageNo = 1
+      this.searchForm.search = ''
       this.refreshList();
     },
     // 表格选中数据

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

@@ -1,189 +0,0 @@
-<script>
-import { refer } from "../api/index";
-
-export default {
-  name: "TableDialog",
-  props: ["type", "title", "multiple", "queryParams"],
-  components: {},
-  data() {
-    const { type } = this.$props;
-    const TableColumns = require(`./${type}`).default.filter(
-      (element) => element.key
-    );
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      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 },
-      // table
-      data: [],
-      multipleSelection: [],
-      tableColumns: TableColumns,
-    };
-  },
-  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
-    handleSelect(row) {
-      this.multipleSelection = [row];
-    },
-    // double click select row data and confirm
-    handleDoubleClickSelect(row) {
-      const { multiple } = this.$props;
-      if (!multiple) this.confirm([row]);
-    },
-    // multiple select row data
-    handleMultipleSelect(prop) {
-      this.multipleSelection = prop;
-    },
-    // confirm
-    confirm(prop) {
-      this.setVisible(false);
-      this.$emit("confirm", prop);
-    },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-dialog
-    :title="title"
-    :visible.sync="visible"
-    :width="width"
-    append-to-body
-    @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="handleSelect"
-      @row-dblclick="handleDoubleClickSelect"
-      @selection-change="handleMultipleSelect"
-    >
-      <el-table-column
-        v-if="multiple"
-        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>

+ 234 - 98
src/components/popover-select/index.vue

@@ -1,4 +1,5 @@
 <script>
+import { refer } from "./api/index";
 export default {
   name: "PopoverSelect",
   props: {
@@ -15,12 +16,20 @@ export default {
     // 参照弹窗标题
     title: {
       type: String,
-      default: "TITLE",
+      dafault: () => {
+        return "TITEL";
+      },
     },
-    // 作为 value 唯一标识的键名,绑定值为对象类型时必填
+    // 作为 value 唯一标识的键名,绑定值
     valueKey: {
       type: String,
-      default: "id",
+      dafault: () => {
+        return "code";
+      },
+    },
+    showKey: {
+      type: String,
+      default: "name",
     },
     // 默认查询参数
     queryParams: {
@@ -30,138 +39,274 @@ export default {
     // 组件大小
     size: {
       type: String,
-      default: "mini",
+      dafault: () => {
+        return "mini";
+      },
     },
     // 提示
     placeholder: {
       type: String,
-      default: "",
+      dafault: () => {
+        return "";
+      },
     },
     // 是否可读
     readonly: {
       type: Boolean,
-      default: false,
+      dafault: () => {
+        return false;
+      },
     },
     // 是否禁止
     disabled: {
       type: Boolean,
-      default: false,
+      dafault: () => {
+        return false;
+      },
     },
     // 是否清除
     clearable: {
       type: Boolean,
-      default: false,
+      dafault: () => {
+        return false;
+      },
     },
     // 是否多选
     multiple: {
       type: Boolean,
-      default: false,
+      dafault: () => {
+        return false;
+      },
     },
     // 需映射源数据
     source: Object,
     // 参照内外映射
     dataMapping: Object,
   },
-  emits: ["hide"],
-  components: {
-    TableDialog: () => import("./components/index.vue"),
-  },
+  components: {},
   data() {
     return {
-      // popover宽度
-      width: "",
-      // 显示value
-      showValue: "",
-      // 选中data
+      width: "50%",
+      page: { pageNum: 1, pageSize: 25, total: 0 },
+      layout: "total, prev, pager, next, sizes, jumper",
+      pageSizes: [25, 50, 100],
+      visible: false,
+      loading: false,
+      model: {
+        search: "",
+        isPage: true,
+      },
       data: [],
+      selectData: [],
     };
   },
-  computed: {},
+  computed: {
+    innerValue() {
+      const { value, multiple } = this.$props;
+      return multiple ? "" : value;
+    },
+    TableColumnTemp() {
+      const { type } = this.$props;
+      const documents = require(`./components/${type}`).default;
+      return documents.filter((document) => document.key);
+    },
+  },
   watch: {
     "$props.value": {
-      handler: function (newProp, oldProp) {
-        if (!newProp) {
-          this.data = [];
-          this.showValue = "";
-        } else {
-          this.showValue = newProp;
-        }
+      handler: function (newProp) {
+        if (!newProp) this.selectData = [];
       },
       immediate: true,
     },
   },
   methods: {
-    // 打开弹窗
-    handleAsyncOpenDialog() {
-      this.$nextTick(() => {
-        const { setVisible } = this.$refs.TableDialogFef;
-        setVisible(true);
-      });
-    },
-    // 新增操作
-    handleAdd(prop) {
-      this.data = prop;
-      this.handleUpdate(this.data);
-      this.$emit("hide", prop);
-    },
-    // 删除操作
-    handleDelete(prop) {
-      this.data.splice(prop, 1);
-      this.handleUpdate(this.data);
-    },
-    // 更新操作
-    handleUpdate(prop) {
-      const { source, multiple, valueKey, dataMapping } = this.$props;
-      // 多选
-      if (multiple) {
-        this.showValue = "";
-        this.$emit(
-          "input",
-          prop.map((item) => item[valueKey])
-        );
+    // show dialog
+    async show() {
+      this.visible = true;
+      await this.resetList();
+    },
+    // hide dialog
+    async hide() {
+      this.visible = false;
+    },
+    // fetch list
+    async fetchList(prop, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await refer(prop, {
+          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) {
+        //
+      } finally {
+        this.loading = false;
       }
+    },
+    // reset list
+    async resetList() {
+      const { type, queryParams } = this.$props;
+      this.model = { type, ...this.model, ...queryParams };
+      const { page, model } = this;
+      await this.fetchList(model, page);
+    },
+    // query list
+    async queryList() {
+      const { page, model } = this;
+      await this.fetchList(model, page);
+    },
+    // row click
+    rowClick(prop) {
+      const { multiple } = this.$props;
       // 单选
-      if (!multiple) {
-        this.showValue = prop[0].name;
-        this.$emit("input", prop[0][valueKey]);
-        // 更新映射数据
-        for (let key in dataMapping) {
-          source[key] = prop[0][dataMapping[key]];
-        }
-        this.$emit("update:source", source);
+      if (!multiple) this.$refs.multipleTable.clearSelection();
+      [prop].forEach((row) => this.$refs.multipleTable.toggleRowSelection(row));
+    },
+    // row double click
+    async rowDblclick(prop) {
+      const { multiple } = this.$props;
+      if (!multiple) await this.confirm(prop);
+    },
+    // selection change
+    selectionChange(prop) {
+      this.selectData = prop;
+    },
+    // page size change
+    async pageSizeChange(prop) {
+      this.page.pageSize = prop;
+      await this.queryList();
+    },
+    // page number change
+    async pageNumberChange(prop) {
+      this.page.pageNum = prop;
+      await this.queryList();
+    },
+    // confirm
+    async confirm(prop) {
+      const { multiple } = this.$props;
+      await this.hide();
+      await this.update(multiple ? prop : prop[0]);
+    },
+    // delete tag
+    deleteTag(prop) {
+      this.selectData.splice(prop, 1);
+      this.update(this.selectData);
+    },
+    // update
+    update(prop) {
+      const { source, multiple, valueKey, dataMapping } = this.$props;
+      // update v-model
+      const vModel = multiple
+        ? prop.map((item) => item[valueKey])
+        : prop[valueKey];
+      this.$emit("input", vModel);
+      // update data mapping
+      for (let key in dataMapping) {
+        source[key] = prop[dataMapping[key]];
       }
-      //
+      this.$emit("update:source", source);
+      // emit change
       this.$emit("change", prop, source);
     },
   },
-  created() {
-    this.$nextTick(() => {
-      const { clientWidth } = this.$refs.PopoverSelect;
-      this.width = clientWidth;
-    });
-  },
+  created() {},
   mounted() {},
   destroyed() {},
 };
 </script>
 <template>
-  <div ref="PopoverSelect" style="position: relative">
+  <div>
     <el-input
-      v-model="showValue"
+      v-model="innerValue"
       :size="size"
       :disabled="disabled"
+      :readonly="readonly"
       :clearable="clearable"
       :placeholder="placeholder"
-      readonly
-      style="width: 100%; cursor: pointer"
-      @click.native.stop="handleAsyncOpenDialog"
     >
-      <template #suffix>
-        <el-icon class="el-icon-more"></el-icon>
-      </template>
+      <el-button
+        :disabled="disabled"
+        slot="append"
+        icon="el-icon-search"
+        @click="show()"
+      ></el-button>
     </el-input>
+    <el-dialog
+      :title="`${title}(${multiple ? '多选' : '单选'})`"
+      :width="width"
+      :visible.sync="visible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+    >
+      <el-form
+        v-loading="loading"
+        :size="size"
+        :inline="true"
+        :model="model"
+        @submit.native.prevent
+      >
+        <el-form-item prop="search">
+          <el-input
+            v-model="model.search"
+            @change="queryList"
+            @keydown.enter="queryList"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button icon="el-icon-refresh" @click="resetList"></el-button>
+        </el-form-item>
+        <el-table
+          ref="multipleTable"
+          :data="data"
+          :size="size"
+          height="45vh"
+          highlight-current-row
+          style="width: 100%; margin-bottom: 20px"
+          @row-click="rowClick"
+          @row-dblclick="rowDblclick"
+          @selection-change="selectionChange"
+        >
+          <el-table-column width="55" type="selection" align="center">
+          </el-table-column>
+          <el-table-column
+            v-for="(column, index) in TableColumnTemp"
+            :key="index"
+            :prop="column.key"
+            :label="column.title"
+            :width="column.width"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+        </el-table>
+        <el-pagination
+          :layout="layout"
+          :total="page.total"
+          :page-sizes="pageSizes"
+          :small="size === 'mini'"
+          :page-size="page.pageSize"
+          :current-page="page.pageNum"
+          background
+          @size-change="pageSizeChange"
+          @current-change="pageNumberChange"
+        >
+        </el-pagination>
+      </el-form>
+      <div style="margin-top: 20px; text-align: right">
+        <el-button :size="size" @click="visible = false"> 取 消 </el-button>
+        <el-button :size="size" @click="confirm(selectData)"> 确 定 </el-button>
+      </div>
+    </el-dialog>
     <div
-      v-if="multiple && data.length"
       style="
         position: absolute;
         left: 10px;
@@ -171,7 +316,7 @@ export default {
         overflow: hidden;
       "
     >
-      <div style="width: 150px; display: flex">
+      <div v-if="multiple && selectData.length">
         <el-popover
           :offset="-10"
           :width="width"
@@ -182,35 +327,26 @@ export default {
           placement="bottom-start"
         >
           <el-tag slot="reference" :size="size" style="margin-right: 10px">
-            + {{ data.length }}
+            + {{ selectData.length }}
           </el-tag>
           <el-tag
-            v-for="(item, index) in data"
+            v-for="(tag, index) in selectData"
             :size="size"
             hit
             closable
-            style="
-              display: flex;
-              justify-content: space-between;
-              align-items: center;
-              margin: 0 0 5px 0;
-            "
-            @close="handleDelete(index)"
+            :style="{
+              display: 'flex',
+              justifyContent: 'space-between',
+              alignItems: 'center',
+              margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
+            }"
+            @close="deleteTag(index)"
           >
-            {{ item.name }}
+            {{ tag.name }}
           </el-tag>
         </el-popover>
       </div>
     </div>
-    <table-dialog
-      v-model="data"
-      ref="TableDialogFef"
-      :type="type"
-      :title="title"
-      :multiple="multiple"
-      :queryParams="queryParams"
-      @confirm="handleAdd"
-    ></table-dialog>
   </div>
 </template>
 <style scoped></style>

+ 4 - 3
src/components/popover-tree-select/components/index.vue

@@ -60,7 +60,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -107,9 +107,10 @@ export default {
 </script>
 <template>
   <el-dialog
-    :title="title"
-    :visible.sync="visible"
+    :title="`${title}(${multiple ? '多选' : '单选'})`"
     :width="width"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
     append-to-body
     destroy-on-close
     @open="beforeOpen"

+ 27 - 27
src/components/popover-tree-select/index.vue

@@ -17,10 +17,14 @@ export default {
       type: String,
       default: "TITLE",
     },
-    // 作为 value 唯一标识的键名,绑定值为对象类型时必填
+    // 作为 value 唯一标识的键名,绑定值
     valueKey: {
       type: String,
-      default: "id",
+      default: "name",
+    },
+    // 作为 value 唯一标识的键名,显示值
+    showKey: {
+      type: String,
     },
     // 默认查询参数
     queryParams: {
@@ -69,21 +73,21 @@ export default {
     return {
       // popover宽度
       width: "",
-      // 显示value
-      showValue: "",
       // 选中data
       data: [],
     };
   },
-  computed: {},
+  computed: {
+    showValue() {
+      const { showKey, valueKey } = this.$props;
+      return this.data.length === 1 ? this.data[0][showKey || valueKey] : "";
+    },
+  },
   watch: {
     "$props.value": {
       handler: function (newProp, oldProp) {
         if (!newProp) {
           this.data = [];
-          this.showValue = "";
-        } else {
-          this.showValue = newProp;
         }
       },
       immediate: true,
@@ -93,7 +97,7 @@ export default {
     // 打开弹窗
     handleAsyncOpenDialog() {
       this.$nextTick(() => {
-        const { setVisible } = this.$refs.TableDialogFef;
+        const { setVisible } = this.$refs.TableDialog;
         setVisible(true);
       });
     },
@@ -112,16 +116,13 @@ export default {
       const { source, multiple, valueKey, dataMapping } = this.$props;
       // 多选
       if (multiple) {
-        this.showValue = "";
-        this.$emit(
-          "input",
-          prop.map((item) => item[valueKey])
-        );
+        const updateData = prop.map((item) => item[valueKey]);
+        this.$emit("input", updateData);
       }
       // 单选
       if (!multiple) {
-        this.showValue = prop[0].name;
-        this.$emit("input", prop[0][valueKey]);
+        const updateData = prop[0][valueKey];
+        this.$emit("input", updateData);
         // 更新映射数据
         for (let key in dataMapping) {
           source[key] = prop[0][dataMapping[key]];
@@ -134,7 +135,7 @@ export default {
   },
   created() {
     this.$nextTick(() => {
-      const { clientWidth } = this.$refs.PopoverSelect;
+      const { clientWidth } = this.$refs.PopoverTreeSelect;
       this.width = clientWidth;
     });
   },
@@ -143,7 +144,7 @@ export default {
 };
 </script>
 <template>
-  <div ref="PopoverSelect" style="position: relative">
+  <div ref="PopoverTreeSelect" style="position: relative">
     <el-input
       v-model="showValue"
       :size="size"
@@ -159,7 +160,6 @@ export default {
       </template>
     </el-input>
     <div
-      v-if="multiple && data.length"
       style="
         position: absolute;
         left: 10px;
@@ -169,7 +169,7 @@ export default {
         overflow: hidden;
       "
     >
-      <div style="width: 150px; display: flex">
+      <div v-if="multiple && data.length">
         <el-popover
           :offset="-10"
           :width="width"
@@ -187,12 +187,12 @@ export default {
             :size="size"
             hit
             closable
-            style="
-              display: flex;
-              justify-content: space-between;
-              align-items: center;
-              margin: 0 0 5px 0;
-            "
+            :style="{
+              display: 'flex',
+              justifyContent: 'space-between',
+              alignItems: 'center',
+              margin: data.length - 1 === index ? '0' : '0 0 5px 0',
+            }"
             @close="handleDelete(index)"
           >
             {{ item.name }}
@@ -201,7 +201,7 @@ export default {
       </div>
     </div>
     <table-dialog
-      ref="TableDialogFef"
+      ref="TableDialog"
       :type="type"
       :title="title"
       :multiple="multiple"

+ 59 - 34
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,22 +1,47 @@
 <template>
   <div v-if="!item.hidden">
-    <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
-      <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
-          <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
+    <template
+      v-if="
+        hasOneShowingChild(item.children, item) &&
+        (!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
+        !item.alwaysShow
+      "
+    >
+      <app-link
+        v-if="onlyOneChild.meta"
+        :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
+      >
+        <el-menu-item
+          :index="resolvePath(onlyOneChild.path)"
+          :class="{ 'submenu-title-noDropdown': !isNest }"
+        >
+          <item
+            :icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)"
+            :title="onlyOneChild.meta.title"
+          />
         </el-menu-item>
       </app-link>
     </template>
 
-    <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
+    <el-submenu
+      v-else
+      ref="subMenu"
+      :index="resolvePath(item.path)"
+      popper-append-to-body
+    >
       <template slot="title">
-        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
+        <item
+          v-if="item.meta"
+          :icon="item.meta && item.meta.icon"
+          :title="item.meta.title"
+        />
       </template>
       <sidebar-item
         v-for="child in item.children"
         :key="child.path"
         :is-nest="true"
         :item="child"
+        :title="child.meta.title"
         :base-path="resolvePath(child.path)"
         class="nest-menu"
       />
@@ -25,76 +50,76 @@
 </template>
 
 <script>
-import path from 'path'
-import { isExternal } from '@/utils/validate'
-import Item from './Item'
-import AppLink from './Link'
-import FixiOSBug from './FixiOSBug'
+import path from "path";
+import { isExternal } from "@/utils/validate";
+import Item from "./Item";
+import AppLink from "./Link";
+import FixiOSBug from "./FixiOSBug";
 
 export default {
-  name: 'SidebarItem',
+  name: "SidebarItem",
   components: { Item, AppLink },
   mixins: [FixiOSBug],
   props: {
     // route object
     item: {
       type: Object,
-      required: true
+      required: true,
     },
     isNest: {
       type: Boolean,
-      default: false
+      default: false,
     },
     basePath: {
       type: String,
-      default: ''
-    }
+      default: "",
+    },
   },
   data() {
-    this.onlyOneChild = null
-    return {}
+    this.onlyOneChild = null;
+    return {};
   },
   methods: {
     hasOneShowingChild(children = [], parent) {
       if (!children) {
         children = [];
       }
-      const showingChildren = children.filter(item => {
+      const showingChildren = children.filter((item) => {
         if (item.hidden) {
-          return false
+          return false;
         } else {
           // Temp set(will be used if only has one showing child)
-          this.onlyOneChild = item
-          return true
+          this.onlyOneChild = item;
+          return true;
         }
-      })
+      });
 
       // When there is only one child router, the child router is displayed by default
       if (showingChildren.length === 1) {
-        return true
+        return true;
       }
 
       // Show parent if there are no child router to display
       if (showingChildren.length === 0) {
-        this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
-        return true
+        this.onlyOneChild = { ...parent, path: "", noShowingChildren: true };
+        return true;
       }
 
-      return false
+      return false;
     },
     resolvePath(routePath, routeQuery) {
       if (isExternal(routePath)) {
-        return routePath
+        return routePath;
       }
       if (isExternal(this.basePath)) {
-        return this.basePath
+        return this.basePath;
       }
       if (routeQuery) {
         let query = JSON.parse(routeQuery);
-        return { path: path.resolve(this.basePath, routePath), query: query }
+        return { path: path.resolve(this.basePath, routePath), query: query };
       }
-      return path.resolve(this.basePath, routePath)
-    }
-  }
-}
+      return path.resolve(this.basePath, routePath);
+    },
+  },
+};
 </script>

+ 61 - 45
src/layout/components/Sidebar/index.vue

@@ -1,26 +1,42 @@
 <template>
-    <div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
-        <logo v-if="showLogo" :collapse="isCollapse" />
-        <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
-            <el-menu
-                :default-active="activeMenu"
-                :collapse="isCollapse"
-                :background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
-                :text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
-                :unique-opened="true"
-                :active-text-color="settings.theme"
-                :collapse-transition="false"
-                mode="vertical"
-            >
-                <sidebar-item
-                    v-for="(route, index) in sidebarRouters"
-                    :key="route.path  + index"
-                    :item="route"
-                    :base-path="route.path"
-                />
-            </el-menu>
-        </el-scrollbar>
-    </div>
+  <div
+    :class="{ 'has-logo': showLogo }"
+    :style="{
+      backgroundColor:
+        settings.sideTheme === 'theme-dark'
+          ? variables.menuBackground
+          : variables.menuLightBackground,
+    }"
+  >
+    <logo v-if="showLogo" :collapse="isCollapse" />
+    <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
+      <el-menu
+        :default-active="activeMenu"
+        :collapse="isCollapse"
+        :background-color="
+          settings.sideTheme === 'theme-dark'
+            ? variables.menuBackground
+            : variables.menuLightBackground
+        "
+        :text-color="
+          settings.sideTheme === 'theme-dark'
+            ? variables.menuColor
+            : variables.menuLightColor
+        "
+        :unique-opened="true"
+        :active-text-color="settings.theme"
+        :collapse-transition="false"
+        mode="vertical"
+      >
+        <sidebar-item
+          v-for="(route, index) in sidebarRouters"
+          :key="route.path + index"
+          :item="route"
+          :base-path="route.path"
+        />
+      </el-menu>
+    </el-scrollbar>
+  </div>
 </template>
 
 <script>
@@ -30,28 +46,28 @@ import SidebarItem from "./SidebarItem";
 import variables from "@/assets/styles/variables.scss";
 
 export default {
-    components: { SidebarItem, Logo },
-    computed: {
-        ...mapState(["settings"]),
-        ...mapGetters(["sidebarRouters", "sidebar"]),
-        activeMenu() {
-            const route = this.$route;
-            const { meta, path } = route;
-            // if set path, the sidebar will highlight the path you set
-            if (meta.activeMenu) {
-                return meta.activeMenu;
-            }
-            return path;
-        },
-        showLogo() {
-            return this.$store.state.settings.sidebarLogo;
-        },
-        variables() {
-            return variables;
-        },
-        isCollapse() {
-            return !this.sidebar.opened;
-        }
-    }
+  components: { SidebarItem, Logo },
+  computed: {
+    ...mapState(["settings"]),
+    ...mapGetters(["sidebarRouters", "sidebar"]),
+    activeMenu() {
+      const route = this.$route;
+      const { meta, path } = route;
+      // if set path, the sidebar will highlight the path you set
+      if (meta.activeMenu) {
+        return meta.activeMenu;
+      }
+      return path;
+    },
+    showLogo() {
+      return this.$store.state.settings.sidebarLogo;
+    },
+    variables() {
+      return variables;
+    },
+    isCollapse() {
+      return !this.sidebar.opened;
+    },
+  },
 };
 </script>

+ 1 - 2
src/utils/init/index.js

@@ -12,7 +12,6 @@ export const initParams = (prop, key = "key", value = "value") =>
   Object.fromEntries(prop.map((item) => [item[key], item[value]]));
 // 初始化字典
 export const initDicts = (prop) =>
-
   prop.filter((column) => column.referName).map((column) => column.referName);
 // 初始化校验
 export const initRules = (prop) => {
@@ -38,4 +37,4 @@ export const initPageSizes = () => pageSizes;
 
 export const initLayout = () => layout;
 
-export const initPage = () => page;
+export const initPage = () => ({ pageNum: 1, pageSize: 25, total: 0 });

+ 5 - 3
src/utils/request.js

@@ -120,10 +120,12 @@ service.interceptors.response.use(
       }
       return Promise.reject("无效的会话,或者会话已过期,请重新登录。");
     } else if (code === 500) {
-      Message({ message: msg, type: "error" });
+      Notification.error({ title: "error", message: msg });
+      // Message({ message: msg, type: "error" });
       return Promise.reject(new Error(msg));
     } else if (code === 601) {
-      Message({ message: msg, type: "warning" });
+      Notification.warning({ title: "error", message: msg });
+      // Message({ message: msg, type: "warning" });
       return Promise.reject("error");
     } else if (code !== 200) {
       Notification.error({ title: msg });
@@ -152,7 +154,7 @@ export function download(url, params, filename, config) {
   downloadLoadingInstance = Loading.service({
     text: "正在下载数据,请稍候",
     spinner: "el-icon-loading",
-    background: "rgba(0, 0, 0, 0.7)",
+    background: "rgba(255, 255, 255, 0.7)",
   });
   return service
     .post(url, params, {

+ 5 - 2
src/views/marketing/dealer-authorization/index.vue

@@ -240,14 +240,17 @@ export default {
         // name:工号   nickName:名字
         const { name, nickName } = this.$store.state.user;
 
-        const { id, authorizedProductsCode } = row;
+        const { id, authorizedProductsCode,dealerName,authorizedProductsName,authorizedAreaName   } = row;
 
         let data = {
           authorizedProductsCode,
           id,
           createPerson: nickName,
           createBy: name,
-          date: new Date().Format()
+          date: new Date().Format(),
+          dealerName,
+          authorizedProductsName,
+          authorizedAreaName
         }
 
         this.loading = true;

+ 1 - 1
src/views/purchase/DemandSummary/add.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="checkDemandSummary">
     <el-card>
-      <span>采购需求汇总详情</span>
+      <span>采购需求处理详情</span>
       <div class="btn_grooup">
         <el-button type="primary" size="small" @click="editLine">编辑</el-button>
         <el-button type="success" size="small" v-if="!lineDisable" @click="saveLine">保存</el-button>

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

@@ -468,9 +468,9 @@ export default {
       lastAllocationOptions: [],
       orgOptions: [],
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
       referCondition: {
         type: '',

+ 5 - 3
src/views/purchase/MaterialClassDivision/add.vue

@@ -160,7 +160,7 @@
          <el-col :span="1.5">
             <el-form-item label="订单部门">
               <el-input
-                v-model="basicForm.orderDept"
+                v-model="basicForm.orderDeptName"
                 size="small"
                 disabled
                 style="width: 200px"
@@ -192,7 +192,7 @@
           <el-col :span="1.5">
             <el-form-item label="采购部门">
               <el-input
-                v-model="basicForm.puDept"
+                v-model="basicForm.puDeptName"
                 size="small"
                 disabled
                 style="width: 200px"
@@ -307,7 +307,9 @@ export default {
         remark: ''
       },
       options: [{
-        value: 0, label: '仓库1'
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
       }],
       referCondition: {
         type: '',

+ 4 - 3
src/views/purchase/MaterialClassDivision/index.vue

@@ -199,12 +199,11 @@
               导出<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
+              <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
               <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
 
-          <el-button type="primary" size="small">同步分配</el-button>
           <el-button type="primary" size="small">删除</el-button>
         </div>
         <el-table 
@@ -320,7 +319,9 @@ export default {
         pageSize: 5
       },
       options: [{
-        value: 0, label: '仓库1'
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
       }],
       staffOptions: [],
       staff2Options: [],

+ 7 - 53
src/views/purchase/PurchaseDemandList/add.vue

@@ -85,7 +85,7 @@
             <el-form-item label="需求日期">
               <el-date-picker
                 v-model="basicForm.demandDate"
-                disabled
+                :disabled="sonDisable"
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -104,22 +104,6 @@
             </el-form-item>
          </el-col>
 
-          <el-col :span="1.5">
-            <el-form-item label="供应仓库">
-              <el-select size="small" v-model="basicForm.warehouse" :disabled="sonDisable" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
-                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-         </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="供应货位">
-              <el-select size="small" v-model="basicForm.goodsAllocation" :disabled="sonDisable" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
-                <el-option v-for="item in goodsOptions" :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" :disabled="sonDisable" size="small" style="width: 200px">
@@ -151,20 +135,9 @@
          </el-col> -->
 
           <el-col :span="1.5">
-            <el-form-item label="是否月销量计算">
-              <el-input
-                v-model="basicForm.isMonthleyCalculate"
-                size="small"
-                disabled
-                style="width: 200px"
-              />
-            </el-form-item>
-         </el-col>
-
-          <el-col :span="1.5">
             <el-form-item label="备注">
               <el-input
-                v-model="basicForm.remark"
+                v-model.trim="basicForm.remark"
                 size="small"
                 :disabled="sonDisable"
                 clearable
@@ -584,9 +557,7 @@ export default {
         demandPersonal: '',
         demandDept: '',
         demandDate: '',
-        source: '1',
-        warehouse: '',
-        goodsAllocation: '',
+        source: '4',
         billType: '',
         isSpeical: '',
         isProcess: '',
@@ -595,9 +566,9 @@ export default {
         puDemandItemList: []
       },
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
       basicRules: {},
       tableList: [],
@@ -617,8 +588,6 @@ export default {
       personOptions: [],
       deptOptions: [],
       customerOptions: [],
-      houseOptions: [],
-      goodsOptions: []
     }
   },
   created() {
@@ -834,8 +803,6 @@ export default {
               if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
               if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
               if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
-              if(this.basicForm.warehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.warehouse) }
-              if(this.basicForm.goodsAllocation) { this.reBackRefer('ALLOCATION_PARAM', this.basicForm.goodsAllocation) }
             }
             console.log('111')
           })
@@ -866,12 +833,6 @@ export default {
         if (type == 'DEPT_PARAM') {
           this.deptOptions = res.rows
         }
-        if (type == 'WAREHOUSE_PARAM') {
-          this.houseOptions = res.rows
-        }
-        if (type == 'ALLOCATION_PARAM') {
-          this.goodsOptions = res.rows
-        }
       })
     },
     chooseOrg(type, isPage, title) {
@@ -902,14 +863,6 @@ export default {
         this.deptOptions = selection
         this.basicForm.demandDept = selection[0].id
       }
-      if(this.referCondition.type == 'WAREHOUSE_PARAM') {
-        this.houseOptions = selection
-        this.basicForm.warehouse = selection[0].id
-      }
-      if(this.referCondition.type == 'ALLOCATION_PARAM') {
-        this.goodsOptions = selection
-        this.basicForm.goodsAllocation = selection[0].id
-      }
       // if(this.referConditionMx.type == 'DEPT_PARAM') {
       //   this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].code
       //   this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].name
@@ -943,7 +896,8 @@ export default {
     chooseMaterial(index) {
       console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
       this.tableIndex = index
-      this.$refs.materialRefer.init()
+      // 传0只展示同步NC了的物料
+      this.$refs.materialRefer.init(0)
     },
     selectMaterial(selection) {
       console.log('选中的物料', selection)

+ 12 - 38
src/views/purchase/PurchaseDemandList/index.vue

@@ -6,29 +6,23 @@
           <el-col :span="1.5">
             <el-form-item label="单据编码">
               <el-input
-                v-model="queryParams.code"
+                v-model.trim="queryParams.code"
                 size="small"
+                clearable
                 style="width: 200px"
               />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
-            <el-form-item label="供应仓库">
-              <el-select size="small" v-model="queryParams.warehouse" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
-                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
             <el-form-item label="需求客户">
-              <el-select size="small" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+              <el-select clearable size="small" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
                 <el-option v-for="item in customerOptions" :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="queryParams.isProcess" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" clearable placeholder="请选择">
                 <el-option
                   v-for="item in options"
                   :key="item.value"
@@ -50,21 +44,14 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="需求人员">
-              <el-select size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+              <el-select clearable size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
                 <el-option v-for="item in personOptions" :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 size="small" v-model="queryParams.goodsAllocation" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
-                <el-option v-for="item in goodsOptions" :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="queryParams.source" size="small" style="width: 200px">
+              <el-select clearable v-model="queryParams.source" size="small" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -75,7 +62,7 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="queryParams.billType" size="small" style="width: 200px">
+              <el-select clearable v-model="queryParams.billType" size="small" style="width: 200px">
                 <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -83,7 +70,7 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-select clearable v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
                   v-for="item in deptOptions"
                   :key="item.id"
@@ -98,6 +85,7 @@
               <el-date-picker
                 v-model="queryParams.demandDate"
                 type="date"
+                clearable
                 value-format="yyyy-MM-dd"
                 size="small"
                 style="width: 200px"
@@ -108,7 +96,7 @@
           <el-col :span="1.5">
             <el-form-item label="备注">
             <el-input
-              v-model="queryParams.remark"
+              v-model.trim="queryParams.remark"
               size="small"
               clearable
               style="width: 200px"
@@ -271,11 +259,9 @@ export default {
       page: '',
       queryParams: {
         code: '',
-        warehouse: '',
         customer: '',
         isProcess: '',
         demandPersonal: '',
-        goodsAllocation: '',
         source: '',
         billType: '',
         demandDept: '',
@@ -290,14 +276,12 @@ export default {
         title: ''
       },
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
-      houseOptions: [],
       customerOptions: [],
       personOptions: [],
-      goodsOptions: [],
       deptOptions: [],
       tableList: [],
       total: 0,
@@ -359,11 +343,9 @@ export default {
     resetList() {
       this.queryParams = {
         code: '',
-        warehouse: '',
         customer: '',
         isProcess: '',
         demandPersonal: '',
-        goodsAllocation: '',
         source: '',
         billType: '',
         demandDept: '',
@@ -538,10 +520,6 @@ export default {
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
-      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
-        this.houseOptions = selection
-        this.queryParams.warehouse = selection[0].id
-      }
       if (this.referCondition.type == 'CUSTOMER_PARAM') {
         this.customerOptions = selection
         this.queryParams.customer = selection[0].id
@@ -550,10 +528,6 @@ export default {
         this.personOptions = selection
         this.queryParams.demandPersonal = selection[0].id
       }
-      if (this.referCondition.type == 'ALLOCATION_PARAM') {
-        this.goodsOptions = selection
-        this.queryParams.goodsAllocation = selection[0].id
-      }
       if (this.referCondition.type == 'DEPT_PARAM') {
         this.deptOptions = selection
         this.queryParams.demandDept = selection[0].id

+ 2 - 2
src/views/purchase/apply/add/index.vue

@@ -64,7 +64,7 @@ export default {
         this.loading = true;
         this.params.code = await generateCode();
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -109,7 +109,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }

+ 23 - 17
src/views/purchase/apply/column.js

@@ -6,27 +6,11 @@ export const TableColumns = [
   {
     key: "supplierName",
     title: "供应商名称",
-    search: true,
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
-    },
   },
   { key: "puOrg", title: "采购组织" },
   {
     key: "puOrgName",
     title: "采购组织名称",
-    search: true,
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
-    },
   },
   { key: "currency", title: "币种" },
   { key: "currencyName", title: "币种名称" },
@@ -47,4 +31,26 @@ export const TableColumns = [
   { key: "delFlag", title: "删除标记" },
 ];
 
-export const SearchColumns = TableColumns.filter((element) => element.search);
+export const SearchColumns = [
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    valueKey: "code",
+    dataMapping: {
+      supplier: "code",
+      supplierName: "name",
+    },
+  },
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+  },
+];

+ 3 - 3
src/views/purchase/apply/edit/index.vue

@@ -68,7 +68,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -85,7 +85,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -131,7 +131,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }

+ 52 - 35
src/views/purchase/apply/index.vue

@@ -1,13 +1,13 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
-import { list, remove } from "@/api/business/purchase/apply";
+import { LIST, remove } from "@/api/business/purchase/apply";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
   name: "PuchaseContract",
   components: {
-    AddDrawer: () => import("./add/index.vue"),
-    SeeDrawer: () => import("./see/index.vue"),
-    EditDrawer: () => import("./edit/index.vue"),
+    // AddDrawer: () => import("./add/index.vue"),
+    // SeeDrawer: () => import("./see/index.vue"),
+    // EditDrawer: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -24,18 +24,18 @@ export default {
   },
   computed: {},
   created() {
-    this.handleQueryList();
+    this.handleQueryList(this.params, this.page);
   },
   methods: {
     //
-    async fetchList(params, page) {
+    async fetchList(prop, page) {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list({
+        const { code, msg, rows, total } = await LIST({
           pageNum,
           pageSize,
-          ...params,
+          ...prop,
         });
         if (code === 200) {
           this.tableData = rows;
@@ -45,7 +45,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -55,10 +55,10 @@ export default {
       this.fetchList(this.params, this.page);
     },
     // 重置操作
-    handleResetList() {
+    handleResetList(prop, page) {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(prop, page);
     },
     // 删除操作
     async handleDeleteList(prop) {
@@ -68,12 +68,12 @@ export default {
         const { code, msg } = await remove(id);
         if (code === 200) {
           this.$notify.success({ title: msg });
-          this.fetchList(this.params, this.page);
+          this.handleQueryList(this.params, this.page);
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -81,12 +81,12 @@ export default {
     // 页大小变
     handleSizeChange(prop) {
       this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 当前页变
     handleCurrentChange(prop) {
       this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 打开新增drawer
     handleOpenAddDrawer() {
@@ -118,40 +118,57 @@ export default {
     style="width: calc(100% - 24px); height: 100%; margin: 10px"
     :body-style="{ padding: 0 }"
   >
-    <see-drawer ref="SeeDrawerFef"></see-drawer>
-    <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer>
-    <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer>
-    <el-form :size="size" label-position="top" :model="params">
-      <el-row :gutter="24" style="padding: 0 20px">
+    <!-- <see-drawer ref="SeeDrawerFef"></see-drawer> -->
+    <!-- <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer> -->
+    <!-- <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer> -->
+    <el-form
+      :size="size"
+      :model="params"
+      label-width="75px"
+      label-position="right"
+    >
+      <el-row :gutter="24" style="padding: 20px 20px">
         <el-col
           v-for="column in searchColumns"
           :key="column.title"
           :xl="4"
-          :lg="4"
+          :lg="6"
           :md="8"
           :sm="12"
           :xs="24"
         >
-          <el-form-item :prop="column.key" :label="column.title">
-            <el-input
+          <el-form-item
+            v-if="column.inputType === 'PopoverSelect'"
+            :prop="column.key"
+            :label="column.title"
+          >
+            <dr-popover-select
               v-model="params[column.key]"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :value-key="column.valueKey"
               :placeholder="column.placeholder"
-            ></el-input>
+            >
+            </dr-popover-select>
           </el-form-item>
         </el-col>
-        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24"> </el-col>
+        <el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
+          <el-button
+            circle
+            :size="size"
+            icon="el-icon-search"
+            @click="handleQueryList(params, page)"
+          ></el-button>
+          <el-button
+            circle
+            :size="size"
+            icon="el-icon-refresh"
+            @click="handleResetList(params, page)"
+          ></el-button>
+        </el-col>
       </el-row>
     </el-form>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="24">
-        <el-button :size="size" icon="el-icon-search" @click="handleQueryList"
-          >搜索</el-button
-        >
-        <el-button :size="size" icon="el-icon-refresh" @click="handleResetList"
-          >重置</el-button
-        >
-      </el-col>
-    </el-row>
     <el-table
       @row-dblclick="handleOpenSeeDrawer"
       :data="tableData"

+ 2 - 2
src/views/purchase/apply/see/index.vue

@@ -63,7 +63,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -80,7 +80,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 2 - 2
src/views/purchase/catalogue/add/index.vue

@@ -64,7 +64,7 @@ export default {
         this.loading = true;
         this.params.code = await generateCode();
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -109,7 +109,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }

+ 3 - 3
src/views/purchase/catalogue/edit/index.vue

@@ -68,7 +68,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -85,7 +85,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -131,7 +131,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }

+ 2 - 2
src/views/purchase/catalogue/index.vue

@@ -45,7 +45,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -73,7 +73,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 2 - 2
src/views/purchase/catalogue/see/index.vue

@@ -63,7 +63,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -80,7 +80,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 0 - 514
src/views/purchase/contract/add/column.js

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

+ 211 - 151
src/views/purchase/contract/add/index.vue

@@ -1,17 +1,11 @@
 <script>
-import { Columns, TabColumns } from "./column";
+import { Columns, TabColumns } from "../column";
 import { add, generateCode } from "@/api/business/purchase/contract";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
+import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
-  name: "AddDrawer",
-  dicts: initDicts(NewColumns),
+  name: "AddDialog",
+  dicts: initDicts(Columns),
 
   components: {},
   data() {
@@ -19,10 +13,10 @@ export default {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: Columns,
+      rules: initRules(Columns),
       params: {
-        ...initParams(NewColumns),
+        ...initParams(Columns),
         contractItemList: [],
         contractClauseList: [],
         contractExpenseList: [],
@@ -30,14 +24,14 @@ export default {
         contractApplyOrgList: [],
       },
 
-      tabColumns: NewTabColumns,
+      tabColumns: TabColumns,
       tabName: "contractItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
+      this.tabColumns = TabColumns.filter((element) =>
         newProp === "1" ? element.key !== "contractItemList" : element
       );
       this.tabName = this.tabColumns[0].key;
@@ -45,14 +39,15 @@ export default {
   },
   methods: {
     beforeOpen() {
-      const { deptName, deptId, name, id, orgName, orgId } =
-        this.$store.state.user;
-      this.params.puOrg = orgId;
-      this.params.puOrgName = orgName;
-      this.params.buyer = id;
-      this.params.buyerName = name;
-      this.params.puDept = deptId;
-      this.params.puDeptName = deptName;
+      // console.log(this.$store.state.user);
+      // const { deptName, deptId, name, id, orgName, orgId } =
+      //   this.$store.state.user;
+      // this.params.puOrg = orgId;
+      // this.params.puOrgName = orgName;
+      // this.params.buyer = id;
+      // this.params.buyerName = name;
+      // this.params.puDept = deptId;
+      // this.params.puDeptName = deptName;
       this.fetchCode();
     },
     setVisible(prop) {
@@ -63,7 +58,7 @@ export default {
         this.loading = true;
         this.params.code = await generateCode();
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -89,6 +84,8 @@ export default {
     },
     // 保存并新增
     async handleSubmit() {
+      console.log("this.params", this.params);
+      // return;
       try {
         const createById = this.params.buyer;
         const createByName = this.params.buyerName;
@@ -102,21 +99,19 @@ export default {
           ...this.params,
         });
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.setVisible(false);
+          this.$emit("after-submit");
+          this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
     },
 
-
-
-
     handleHide(PROP) {
       console.log(1233123123, PROP);
     },
@@ -124,131 +119,196 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  mounted() { },
-  destroyed() { },
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          ">
-          <h3>新增</h3>
-          <div style="text-align: right">
-            <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava">保 存</el-button>
-            <el-button :size="size" type="info" @click="handleSubmit">
-              新 增
-            </el-button>
-          </div>
-        </div>
-        <el-row>
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
-              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
-              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping" :source.sync="params">
-              </dr-popover-select>
-              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
-              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
-              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
-                <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
-                </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
-              </el-select>
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <!-- <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div> -->
-              </el-upload>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-card>
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
-        <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
-            <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column label="序号">
-                <template slot-scope="scope">
-                  {{ scope.$index + 1 }}
-                </template>
-              </el-table-column>
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width">
-                <template slot-scope="scope">
-                  <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span>
-                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%"></el-input>
-                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size" @hide="handleHide">
-                  </dr-popover-select>
-                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
-                    style="width: 100%"></el-input-number>
-                </template>
-              </el-table-column>
-              <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
-                  <el-button @click.native.prevent="
+  <el-dialog :visible.sync="visible" title="新增" @open="beforeOpen">
+    <el-form
+      v-loading="loading"
+      :size="size"
+      label-position="right"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-row>
+        <el-col
+          v-for="(column, index) in columns"
+          :key="index"
+          :span="column.span || 12"
+        >
+          <el-form-item :prop="column.key" :label="column.title">
+            <el-input
+              v-if="column.inputType === 'Input'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <dr-popover-select
+              v-if="column.inputType === 'PopoverSelect'"
+              v-model="params[column.key]"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :disabled="column.disabled"
+              :readonly="column.readonly"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
+            >
+            </dr-popover-select>
+            <el-input
+              v-if="column.inputType === 'Textarea'"
+              v-model="params[column.key]"
+              type="textarea"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <el-input-number
+              v-if="column.inputType === 'InputNumber'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :controls-position="column.controlsPosition"
+              style="width: 100%"
+            ></el-input-number>
+            <el-select
+              v-if="column.inputType === 'Select'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in dict.type[column.optionsName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <el-date-picker
+              v-if="column.inputType === 'DatePicker'"
+              v-model="params[column.key]"
+              :type="column.type"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :picker-options="column.pickerOptions"
+              style="width: 100%"
+            >
+            </el-date-picker>
+            <file-upload v-if="column.inputType === 'Upload'"></file-upload>
+            <!-- <el-upload
+              v-if="column.inputType === 'Upload'"
+              drag
+              multiple
+              action="https://sy.derom.com/document-center/fastdfs/upload"
+              :disabled="column.disabled"
+              :file-list="params[column.key]"
+            >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                将文件拖到此处,或<em>点击上传</em>
+              </div>
+            </el-upload> -->
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-tabs v-model="tabName" style="width: 100%">
+        <el-tab-pane
+          v-for="(column, index) in tabColumns"
+          :key="index"
+          :label="column.title"
+          :name="column.key"
+        >
+          <el-table :data="params[column.key]" style="width: 100%">
+            <el-table-column label="序号">
+              <template slot-scope="scope">
+                {{ scope.$index + 1 }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              v-for="(cColumn, cIndex) in column.tableColumns"
+              :key="cIndex"
+              :prop="cColumn.key"
+              :label="cColumn.title"
+              :width="cColumn.width"
+            >
+              <template slot-scope="scope">
+                <span v-if="!cColumn.type"> {{ scope.row[cColumn.key] }}</span>
+                <el-input
+                  v-if="cColumn.inputType === 'Input'"
+                  v-model="scope.row[cColumn.key]"
+                  :placeholder="cColumn.placeholder"
+                  :clearable="cColumn.clearable"
+                  :disabled="cColumn.disabled"
+                  :size="size"
+                  style="width: 100%"
+                ></el-input>
+                <dr-popover-select
+                  v-if="cColumn.inputType === 'InputDialog'"
+                  v-model="scope.row[cColumn.key]"
+                  :placeholder="cColumn.placeholder"
+                  :clearable="cColumn.clearable"
+                  :disabled="cColumn.disabled"
+                  :readonly="cColumn.readonly"
+                  :title="cColumn.title"
+                  :type="cColumn.referName"
+                  :data-mapping="cColumn.dataMapping"
+                  :source.sync="scope.row"
+                  :size="size"
+                  @hide="handleHide"
+                >
+                </dr-popover-select>
+                <el-input-number
+                  v-if="cColumn.inputType === 'InputNumber'"
+                  v-model="scope.row[cColumn.key]"
+                  :controls-position="cColumn.controlsPosition"
+                  :placeholder="cColumn.placeholder"
+                  :clearable="cColumn.clearable"
+                  :disabled="cColumn.disabled"
+                  :size="size"
+                  style="width: 100%"
+                ></el-input-number>
+              </template>
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" width="120">
+              <template slot="header" slot-scope="scope">
+                <el-button :size="size" @click="addTableRow(params[tabName])">
+                  增 行
+                </el-button>
+              </template>
+              <template slot-scope="scope">
+                <el-button
+                  @click.native.prevent="
                     delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
-                    删行
-                  </el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-tab-pane>
-        </el-tabs>
-        <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
-        </el-row>
-      </el-card>
+                  "
+                  type="text"
+                  size="small"
+                >
+                  删行
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-tab-pane>
+      </el-tabs>
     </el-form>
-  </el-drawer>
+
+    <div slot="footer">
+      <el-button :size="size" @click="handleCancel">取 消</el-button>
+      <el-button :size="size" @click="handleSava">保 存</el-button>
+      <el-button :size="size" @click="handleSubmit"> 新 增 </el-button>
+    </div>
+  </el-dialog>
 </template>

+ 465 - 62
src/views/purchase/contract/column.js

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

+ 203 - 77
src/views/purchase/contract/edit/index.vue

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

+ 37 - 53
src/views/purchase/contract/index.vue

@@ -1,13 +1,13 @@
 <script>
-import { TableColumns, SearchColumns } from "./column";
-import { list, remove } from "@/api/business/purchase/catalogue";
+import { Columns as TableColumns, SearchColumns } from "./column";
+import { LIST, REMOVE } from "@/api/business/purchase/contract";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
   name: "PuchaseContract",
   components: {
-    AddDrawer: () => import("./add/index.vue"),
-    SeeDrawer: () => import("./see/index.vue"),
-    EditDrawer: () => import("./edit/index.vue"),
+    AddDialog: () => import("./add/index.vue"),
+    SeeDialog: () => import("./see/index.vue"),
+    // EditDrawer: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -24,18 +24,18 @@ export default {
   },
   computed: {},
   created() {
-    this.handleQueryList();
+    this.handleQueryList(this.params, this.page);
   },
   methods: {
     //
-    async fetchList(params, page) {
+    async fetchList(prop, page) {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list({
+        const { code, msg, rows, total } = await LIST({
           pageNum,
           pageSize,
-          ...params,
+          ...prop,
         });
         if (code === 200) {
           this.tableData = rows;
@@ -45,39 +45,35 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
     // 查询操作
-    handleQueryList() {
-      this.fetchList(this.params, this.page);
+    handleQueryList(prop, page) {
+      this.fetchList(prop, page);
     },
     // 重置操作
-    handleResetList() {
+    handleResetList(prop, page) {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.fetchList(this.params, this.page);
-    },
-    // 刷新操作
-    handleRefreshList() {
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(prop, page);
     },
     // 删除操作
     async handleDeleteList(prop) {
       try {
         this.loading = true;
         const { id } = prop;
-        const { code, msg } = await remove(id);
+        const { code, msg } = await REMOVE(id);
         if (code === 200) {
           this.$notify.success({ title: msg });
-          this.fetchList(this.params, this.page);
+          this.handleQueryList(this.params, this.page);
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -85,23 +81,22 @@ export default {
     // 页大小变
     handleSizeChange(prop) {
       this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 当前页变
     handleCurrentChange(prop) {
       this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 打开新增drawer
     handleOpenAddDrawer() {
-      console.log(this.$refs.AddDrawerFef);
-      const { setVisible } = this.$refs.AddDrawerFef;
+      const { setVisible } = this.$refs.AddDialog;
       setVisible(true);
     },
     // 打开查看drawer
-    async handleOpenSeeDrawer(prop) {
+    async handleOpenSeeDialog(prop) {
       const { id } = prop;
-      const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
+      const { setVisible, fetchItem } = this.$refs.SeeDialog;
       await setVisible(true);
       await fetchItem(id);
     },
@@ -122,20 +117,23 @@ export default {
     style="width: calc(100% - 24px); height: 100%; margin: 10px"
     :body-style="{ padding: 0 }"
   >
-    <see-drawer ref="SeeDrawerFef"></see-drawer>
-    <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer>
-    <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer>
+    <see-dialog ref="SeeDialog"></see-dialog>
+    <add-dialog
+      ref="AddDialog"
+      @after-submit="handleResetList(params, page)"
+    ></add-dialog>
+    <!-- <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer> -->
     <el-form
       :size="size"
-      label-position="right"
-      label-width="85px"
       :model="params"
+      label-width="75px"
+      label-position="right"
     >
-      <el-row :gutter="24">
+      <el-row :gutter="24" style="padding: 20px 20px">
         <el-col
           v-for="column in searchColumns"
           :key="column.title"
-          :xl="6"
+          :xl="4"
           :lg="6"
           :md="8"
           :sm="12"
@@ -148,43 +146,29 @@ export default {
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+        <el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
           <el-button
             circle
             :size="size"
             icon="el-icon-search"
-            @click="handleQueryList"
+            @click="handleQueryList(params, page)"
           ></el-button>
           <el-button
             circle
             :size="size"
             icon="el-icon-refresh"
-            @click="handleResetList"
+            @click="handleResetList(params, page)"
           ></el-button>
         </el-col>
       </el-row>
     </el-form>
     <el-row :gutter="24" style="padding: 0 20px">
       <el-col :span="6">
-        <el-button
-          :size="size"
-          type="danger"
-          icon="el-icon-plus"
-          @click="handleOpenAddDrawer"
-        >
-          新增
-        </el-button>
-        <el-button
-          :size="size"
-          icon="el-icon-refresh-right"
-          @click="handleRefreshList"
-        >
-          刷新
-        </el-button>
+        <el-button :size="size" @click="handleOpenAddDrawer"> 新 增 </el-button>
       </el-col>
     </el-row>
     <el-table
-      @row-dblclick="handleOpenSeeDrawer"
+      @row-dblclick="handleOpenSeeDialog"
       :data="tableData"
       :size="size"
       style="width: 100%; margin: 20px 0 0 0"

+ 69 - 249
src/views/purchase/contract/see/index.vue

@@ -1,52 +1,31 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
-import { item, itemTableList } from "@/api/business/purchase/contract";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns, {
-    disabled: true,
-    readonly: true,
-  }),
-}));
+import { Columns, TabColumns } from "../column";
+import { initDicts, initParams } from "@/utils/init";
+import { ITEM, ITEMTABLELIST } from "@/api/business/purchase/contract";
 
 export default {
-  name: "SeeDrawer",
-  dicts: initDicts(NewColumns),
+  name: "SeeDialog",
+  dicts: initDicts(Columns),
   data() {
     return {
+      size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: Columns,
       params: {
-        ...initParams(NewColumns),
+        ...initParams(Columns),
         contractItemList: [],
         contractClauseList: [],
         contractExpenseList: [],
-        contractAgreementList: [],
         contractApplyOrgList: [],
+        contractAgreementList: [],
       },
-
-      tabColumns: NewTabColumns,
+      tabColumns: TabColumns,
       tabName: "contractItemList",
     };
   },
   computed: {},
-  watch: {
-    "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
-      );
-      this.tabName = this.tabColumns[0].key;
-    },
-    tabName: function (newProp) {
-      const { id } = this.params;
-      this.fetchTable(id, newProp);
-    },
-  },
+  watch: {},
   methods: {
     setVisible(prop) {
       this.visible = prop;
@@ -55,15 +34,16 @@ export default {
     async fetchItem(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 });
+          this.fetchTable(this.params.id, this.tabName);
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -72,7 +52,7 @@ export default {
     async fetchTable(prop, name) {
       try {
         this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
+        const { code, msg, rows } = await ITEMTABLELIST({ id: prop }, name);
         if (code === 200) {
           this.params[name] = rows;
           this.$notify.success({ title: msg });
@@ -80,7 +60,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -89,12 +69,13 @@ export default {
     handleCancel() {
       this.setVisible(false);
       this.params = initParams(Columns);
+      this.tabName = "contractItemList";
     },
     // 编辑操作
-    handleOpenEditDrawer(prop) {
-      this.setVisible(false);
-      this.$parent.$parent.handleOpenEditDrawer(prop);
-    },
+    // handleOpenEditDrawer(prop) {
+    //   this.setVisible(false);
+    //   this.$parent.$parent.handleOpenEditDrawer(prop);
+    // },
   },
   created() {},
   mounted() {},
@@ -102,216 +83,55 @@ export default {
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    destroy-on-close
-  >
-    <el-form
-      v-loading="loading"
-      size="mini"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
+  <el-dialog :visible.sync="visible" title="明细" @close="handleCancel">
+    <el-descriptions :column="2" border>
+      <el-descriptions-item
+        v-if="params[column.key]"
+        v-for="(column, index) in columns"
+        :key="index"
+        :label="column.title"
       >
-        <div
-          slot="header"
-          style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          "
-        >
-          <h3>查看</h3>
-          <div style="text-align: right">
-            <el-button size="mini" @click="handleOpenEditDrawer(params)"
-              >编 辑</el-button
-            >
-            <el-button size="mini" @click="handleCancel">取 消</el-button>
-          </div>
-        </div>
-        <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
-            <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-else-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-else-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
-                </el-option>
-              </el-select>
-              <el-date-picker
-                v-else-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
-              </el-date-picker>
-              <el-upload
-                v-else-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                drag
-                action="https://jsonplaceholder.typicode.com/posts/"
-                multiple
-              >
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div>
-              </el-upload>
-              <el-input
-                v-else
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
+        <dict-tag
+          v-if="column.referName && column.inputType === 'Select'"
+          :size="size"
+          :value="params[column.key]"
+          :options="dict.type[column.referName]"
+        />
+        <span v-else>{{ params[column.key] }}</span>
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-tabs
+      v-model="tabName"
+      style="width: 100%"
+      @tab-click="fetchTable(params.id, tabName)"
+    >
+      <el-tab-pane
+        v-for="(column, index) in tabColumns"
+        :key="index"
+        :name="column.key"
+        :label="column.title"
+        lazy
       >
-        <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
-            <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
-                <template slot-scope="scope">
-                  <el-tag v-if="cColumn.key === 'index'">
-                    {{ scope.$index + 1 }}
-                  </el-tag>
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    size="mini"
-                    style="width: 100%"
-                  ></el-input>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    size="mini"
-                    style="width: 100%"
-                  ></el-input-number>
-                  <el-input
-                    v-if="column.type === 'InputDialog'"
-                    v-model="params[column.key]"
-                    :placeholder="column.placeholder"
-                    :clearable="column.clearable"
-                    :disabled="column.disabled"
-                    :readonly="column.readonly"
-                    style="width: 100%; cursor: pointer"
-                    @click.native.stop="openAsyncInputDialog(column, params)"
-                  >
-                    <template #suffix>
-                      <el-icon class="el-icon-thumb"></el-icon>
-                    </template>
-                  </el-input>
-                </template>
-              </el-table-column>
-              <!-- <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
-                    删行
-                  </el-button>
-                </template>
-              </el-table-column> -->
-            </el-table>
-          </el-tab-pane>
-        </el-tabs>
-        <!-- <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button size="mini" @click="addTableRow(params[tabName])"
-            >增行</el-button
+        <el-table :data="params[column.key]" style="width: 100%">
+          <el-table-column
+            v-for="(cColumn, cIndex) in column.tableColumns"
+            :key="cIndex"
+            :prop="cColumn.key"
+            :label="cColumn.title"
+            :width="cColumn.width"
           >
-        </el-row> -->
-      </el-card>
-    </el-form>
-  </el-drawer>
+            <template slot-scope="scope">
+              <dict-tag
+                v-if="cColumn.referName && cColumn.inputType === 'Select'"
+                :size="size"
+                :value="scope.row[cColumn.key]"
+                :options="dict.type[cColumn.referName]"
+              />
+              <span v-else>{{ scope.row[cColumn.key] }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+    </el-tabs>
+  </el-dialog>
 </template>

+ 4 - 4
src/views/purchase/deliveryAddress/add.vue

@@ -191,14 +191,14 @@ export default {
         title: ''
       },
       options: [{
-        value: '0', label: '启用',
+        value: 'Y', label: '启用',
       }, {
-        value: '2', label: '停用'
+        value: 'N', label: '停用'
       }],
       options2: [{
-        value: '0', label: '已同步',
+        value: 'Y', label: '已同步',
       }, {
-        value: '2', label: '未同步'
+        value: 'N', label: '未同步'
       }],
       houseOptions: [],
       contactsOptions: [],

+ 4 - 4
src/views/purchase/deliveryAddress/index.vue

@@ -266,14 +266,14 @@ export default {
         pageSize: 5
       },
       options: [{
-        value: '0', label: '启用',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '停用'
+        value: 'N', label: '否'
       }],
       options2: [{
-        value: '0', label: '已同步',
+        value: 'Y', label: '已同步',
       }, {
-        value: '2', label: '未同步'
+        value: 'N', label: '未同步'
       }],
       referCondition: {
         type: '',

+ 1 - 1
src/views/purchase/purchase-content/index.vue

@@ -196,7 +196,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 1 - 1
src/views/purchase/purchase-content/see-purchase-task.vue

@@ -99,7 +99,7 @@ export default {
       try {
         // do something
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 191 - 201
src/views/purchase/purchase-order/add/column.js

@@ -1,29 +1,23 @@
 export const Columns = [
   {
-    key: "puOrgName",
+    key: "puOrg",
     title: "采购组织",
-    type: "PopoverSelect",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    showKey:'name',
+    referName: "ORG_PARAM",
+    dataMapping: {
+      // puOrg: "id",
+      puOrgName: "name",
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
     key: "billTypeName",
     title: "订单类型",
-    type: "Select",
-
-    config: {
-      optionsName: "sys_order_type", // 字典名
-      dataMapping: {
-        billType: "code",
-        billTypeName: "name",
-      },
-    },
+    inputType: "Select",
+    referName: "sys_order_type", // 字典名
   },
   // { key: "billTypeName", title: "订单类型名称", },
   { key: "oaDemandNo", title: "OA需求单号", type: "Input", },
@@ -31,99 +25,95 @@ export const Columns = [
   {
     key: "billDate",
     title: "订单日期",
-    type: "DatePicker",
-    config: { type: "date" },
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
+    width: 200,
   },
   {
-    key: "supplierName",
+    key: "supplier",
     title: "供应商",
-    type: "PopoverSelect",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      // supplier: "id",
+      supplierName: "name",
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
-    key: "paymentAgreementName",
+    key: "paymentAgreement",
     title: "付款协议",
-    type: "PopoverSelect",
-    config: {
-      componentName: "PAYAGREEMENT_PARAM",
-      dataMapping: {
-        paymentAgreement: "code",
-        paymentAgreementName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "PAYAGREEMENT_PARAM",
+    dataMapping: {
+      paymentAgreementName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   {
-    key: "finalTypeName",
+    key: "finalType",
     title: "结算方式",
-    type: "PopoverSelect",
-    config: {
-      componentName: "BALATYPE_PARAM",
-      dataMapping: {
-        finalType: "code",
-        finalTypeName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "BALATYPE_PARAM",
+    dataMapping: {
+      finalTypeName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
-    key: "currencyName",
+    key: "currency",
     title: "币种",
-    type: "PopoverSelect",
-    config: {
-      componentName: "CURRENCY_PARAM",
-      dataMapping: {
-        currency: "code",
-        currencyName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "CURRENCY_PARAM",
+    dataMapping: {
+      currencyName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   {
-    key: "buyerName",
+    key: "buyer",
     title: "采购员",
-    type: "PopoverSelect",
-    config: {
-      componentName: "CONTACTS_PARAM",
-      dataMapping: {
-        buyer: "code",
-        buyerName: "name",
-        // puDept: "deptId",
-        // puDeptName: "deptName",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyerName: 'name'
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
-    key: "puDeptName",
+    key: "puDept",
     title: "采购部门",
-    type: "PopoverSelect",
-    config: {
-      componentName: "DEPT_PARAM",
-      dataMapping: {
-        puDept: "code",
-        puDeptName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDeptName: 'name'
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
-    key: "customerName",
+    key: "customer",
     title: "收货客户",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     width: 200,
     require: true,
-    config: {
-      componentName: "CUSTOMER_PARAM",
-      dataMapping: {
-        customer: "code",
-        customerName: "name",
-      },
+    valueKey: "id",
+    referName: "CUSTOMER_PARAM",
+    dataMapping: {
+      customerName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
     key: "qty",
@@ -143,45 +133,49 @@ export const Columns = [
   {
     key: "status",
     title: "单据状态",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "sys_status", // 字典名
-    },
-
+    inputType: "Select",
+    referName: "sys_status", // 字典名
   },
   { key: "freezeCause", title: "冻结原因", type: "Checkbox", },
   { key: "isBack", title: "退货", type: "Input", type: "Checkbox", },
   { key: "isMarketing", title: "已协同生成销售订单", type: "Checkbox", },
   { key: "isMarketingSource", title: "由销售订单协同生成", type: "Checkbox", },
   {
-    key: "warehouseName",
+    key: "warehouse",
     title: "WMS入库仓库", // 收货仓库
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     require: true,
-    config: {
-      componentName: "WAREHOUSE_PARAM",
-      dataMapping: {
-        warehouse: "code",
-        warehouseName: "name",
-      }
+    valueKey: "id",
+    referName: "WAREHOUSE_PARAM",
+    dataMapping: {
+      warehouseName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
-    key: "goodsAllocationName",
+    key: "goodsAllocation",
     title: "货位",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     require: true,
-    config: {
-      componentName: "ALLOCATION_PARAM",
-      dataMapping: {
-        goodsAllocation: "code",
-        goodsAllocationName: "name",
-      },
-      queryParams: {
-        pkOrg: 'puOrg',
-      }
+    valueKey: "id",
+    referName: "ALLOCATION_PARAM",
+    dataMapping: {
+      goodsAllocationName: 'name'
     },
+    queryParams: () => ({
+      pkOrg: 'puOrg',
+    }),
+
+    // config: {
+    //   componentName: "ALLOCATION_PARAM",
+    //   dataMapping: {
+    //     goodsAllocation: "code",
+    //     goodsAllocationName: "name",
+    //   },
+    //   queryParams: {
+    //     pkOrg: 'puOrg',
+    //   }
+    // },
     width: 200,
   },
   { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
@@ -192,30 +186,29 @@ export const Columns = [
   { key: "address", title: "收货地址", type: "Input", },
   { key: "contacts", title: "收货联系人", type: "Input", },
   {
-    key: "customerDeptName",
+    key: "customerDept",
     title: "客户部门",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     width: 200,
-    config: {
-      componentName: "CUSTOMERDEPT_PARAM",
-      dataMapping: {
-        customerDept: "code",
-        customerDeptName: "name",
-      },
+    valueKey: "id",
+    referName: "CUSTOMERDEPT_PARAM",
+    dataMapping: {
+      customerDeptName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   {
-    key: "supplierContactsName",
+    key: "supplierContacts",
     title: "供应商业务联系人",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     require: true,
-    config: {
-      componentName: "SUPPLIERCONTACTS_PARAM",
-      dataMapping: {
-        supplierContacts: "code",
-        supplierContactsName: "name",
-      },
+    valueKey: "id",
+    referName: "SUPPLIERCONTACTS_PARAM",
+    dataMapping: {
+      supplierContactsName: 'name'
     },
+    queryParams: () => ({}),
     width: 200,
   },
   { key: "isUrgency", title: "紧急程度", type: "Checkbox", },
@@ -223,82 +216,78 @@ export const Columns = [
   // { key: "agent", title: "代理人", type: "Input", }, // 建议删除
   // { key: "agentName", title: "代理人名称", },
   { key: "isClose", title: "最终关闭", type: "Checkbox", },
-  { key: "closeTime", title: "最终关闭日期", type: "Input", },
+  {
+    key: "closeTime",
+    title: "最终关闭日期",
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
+  },
   { key: "applyPaymentMoney", title: "累计付款申请金额", type: "Input", },
   { key: "paymentMoney", title: "累计付款金额", type: "Input", },
   { key: "invoiceMoney", title: "发票金额", type: "Input", },
-  // {
-  //   key: "supplierPersonal",
-  //   title: "供应商业务员",
-  //   type: "Input",
-  //   // type: "PopoverSelect",
-  // },
   {
-    key: "supplierPersonalName",
-    title: "供应商业务员名称",
-    type: "PopoverSelect",
-    config: {
-      componentName: "SUPPLIERCONTACTS_PARAM",
-      dataMapping: {
-        supplierPersonal: "code",
-        supplierPersonalName: "name",
-      },
+    key: "supplierPersonal",
+    title: "供应商业务员",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIERCONTACTS_PARAM",
+    dataMapping: {
+      supplierPersonalName: 'name'
     },
+    queryParams: () => ({}),
     require: true,
   },
   { key: "isDeliver", title: "是否发货", type: "Checkbox", },
   {
-    key: "retReasonName",
+    key: "retReason",
     title: "退换原因",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     require: true,
-    config: {
-      componentName: "RETREASON_PARAM",
-      dataMapping: {
-        retReason: "code",
-        retReasonName: "name",
-      },
+    valueKey: "id",
+    referName: "RETREASON_PARAM",
+    dataMapping: {
+      retReasonName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
-    key: "processTypeName",
+    key: "processType",
     title: "处理方式",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     require: true,
-    config: {
-      componentName: "PROCESSTYPE_PARAM",
-      dataMapping: {
-        processType: "code",
-        processTypeName: "name",
-      },
+    valueKey: "id",
+    referName: "PROCESSTYPE_PARAM",
+    dataMapping: {
+      processTypeName: 'name'
     },
+    queryParams: () => ({}),
   },
   { key: "isEnd", title: "整单关闭标识", type: "Input", },
   {
-    key: "projectNowName",
+    key: "projectNow",
     title: "在建工程项目",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     require: true,
-    config: {
-      componentName: "PROJECT_PARAM",
-      dataMapping: {
-        projectNow: "code",
-        projectNowName: "name",
-      },
+    valueKey: "id",
+    referName: "PROJECT_PARAM",
+    dataMapping: {
+      projectNowName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
-    key: "operatingItemsName",
+    key: "operatingItems",
     title: "经营性项目",
-    type: "PopoverSelect",
+    inputType: "PopoverSelect",
     require: true,
-    config: {
-      componentName: "OPERATING_PARAM",
-      dataMapping: {
-        operatingItems: "code",
-        operatingItemsName: "name",
-      },
+    valueKey: "id",
+    referName: "OPERATING_PARAM",
+    dataMapping: {
+      operatingItemsName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
   { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
@@ -311,14 +300,16 @@ export const Columns = [
   {
     key: "approverFinishTime",
     title: "审批时间",
-    type: "DatePicker",
-    config: { type: "date" },
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
   },
   {
     key: "approveTime",
     title: "提交时间",
-    type: "DatePicker",
-    config: { type: "date" },
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
   },
 
 ];
@@ -333,20 +324,25 @@ export const TabColumns = [
       { key: "rowNo", title: "行号", type: "Input", },
       { key: "orderId", title: "采购订单ID", type: "Input", width: 180 },
       // {key: "material",title: "物料",type: "Input",   },
-      { key: "materialName", title: "物料", type: "Input", width: 180 },
+      {
+        key: "materialName",
+        title: "物料",
+        inputType: "PopoverSelect",
+        width: 180,
+        valueKey: "id",
+        referName: "MATERIAL_PARAM",
+        queryParams: () => ({}),
+        dataMapping: {
+          material: "id",
+          materialName: "name",
+          materialCode: "code",
+        },
+      },
       {
         key: "materialCode",
         title: "物料编码",
-        type: "PopoverSelect",
+        type: "Input",
         width: 180,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "id",
-            materialName: "name",
-            materialCode: "code",
-          },
-        },
       },
       { key: "materialClassify", title: "物料分类", type: "Input", width: 180 },
       { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", width: 180 },
@@ -371,16 +367,15 @@ export const TabColumns = [
       { key: "isPayment", title: "付款关闭", type: "Input", },
       { key: "isGift", title: "赠品", type: "Input", width: 180 },
       {
-        key: "warehouseName",
+        key: "warehouse",
         title: "收货仓库", //WMS入库仓库
-        type: "PopoverSelect",
-        config: {
-          componentName: "WAREHOUSE_PARAM",
-          dataMapping: {
-            warehouse: "code",
-            warehouseName: "name",
-          }
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "WAREHOUSE_PARAM",
+        dataMapping: {
+          warehouseName: 'name'
         },
+        queryParams: () => ({}),
         width: 200,
       },
       { key: "place", title: "收货地点", type: "Input", width: 180 },
@@ -394,19 +389,16 @@ export const TabColumns = [
       {
         key: "storageCondition",
         title: "存储条件",
-        type: "Select",
-        config: {
-          optionsName: "sys_storage_condition",
-        },
+        inputType: "Select",
+        referName: "sys_storage_condition", // 字典名
         width: 180
       },
       {
         key: "carriageCondition",
         title: "运输条件",
-        type: "Select",
-        config: {
-          optionsName: "sys_conditions_carriage",
-        },
+        inputType: "Select",
+        referName: "sys_conditions_carriage", // 字典名
+
         width: 180
       },
 
@@ -428,10 +420,8 @@ export const TabColumns = [
       {
         key: "priceType",
         title: "价格类型",
-        type: "Select",
-        config: {
-          optionsName: "sys_price_type",
-        },
+        inputType: "Select",
+        referName: "sys_price_type", // 字典名
       },
       { key: "isDistributionPrice", title: "配送价", type: "Input", },
       { key: "createByName", title: "创建人名称", type: "Input", },
@@ -452,7 +442,7 @@ export const TabColumns = [
       {
         key: "materialName",
         title: "物料",
-        type: "PopoverSelect",
+        inputType: "PopoverSelect",
         config: {
           componentName: "MATERIAL_PARAM",
           dataMapping: {

+ 171 - 259
src/views/purchase/purchase-order/add/index.vue

@@ -9,12 +9,13 @@ const NewTabColumns = TabColumns.map((element) => ({
   tableColumns: initColumns(element.tableColumns),
 }));
 
-const SelectColumns = NewColumns.filter((column) => column.type === "Select");
+const SelectColumns = NewColumns.filter((column) => column.inputType === "Select");
 NewTabColumns.forEach((column) => {
   SelectColumns.push(
-    ...column.tableColumns.filter((cColumn) => cColumn.type === "Select")
+    ...column.tableColumns.filter((cColumn) => cColumn.inputType === "Select")
   );
 });
+console.log(SelectColumns, 'SelectColumns');
 
 export default {
   name: "AddPurchaseOrderDrawer",
@@ -43,7 +44,6 @@ export default {
     "params.puOrderItemList": {
       handler(nVal, oVal) {
         this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
-        console.log("params", this.params);
       },
       deep: true,
     },
@@ -53,17 +53,34 @@ export default {
       },
       deep: true,
     },
+    "params.puOrgName": {
+      handler(nVal, oVal) {
+        console.log(nVal, 'nVal', oVal, 'oVal');
+        for (const key in this.params) {
+          if (Array.isArray(this.params[key])) {
+            this.params[key] = [];
+          }
+          else if (key != 'puOrg' && key != 'puOrgName'
+            && key != 'buyer' && key != 'buyerName'
+            && key != 'puDept' && key != 'puDeptName') {
+            this.params[key] = '';
+          }
+          else { }
+        }
+      },
+      deep: true,
+    }
   },
   methods: {
     beforeOpen() {
-      const { deptName, deptId, name, nickName, orgName, orgId } =
-        this.$store.state.user;
+      const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
       this.params.puOrg = orgId;
       this.params.puOrgName = orgName;
       this.params.buyer = name;
       this.params.buyerName = nickName;
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
+
     },
     setVisible(prop) {
       this.visible = prop;
@@ -83,6 +100,10 @@ export default {
           "rowNo" in rowData &&
             (rowData["rowNo"] = this.params[key].length + 1);
 
+          // 是否完成询价,新增明细行需默认明细为false
+          rowData['whetherCompleteInquiry'] = false;
+          console.log(rowData, 'rowData*******************');
+
           this.params[key].push(rowData);
         }
       }
@@ -104,7 +125,7 @@ export default {
     // 同步子表物料
     handleSynchronousMaterial(key1, key2) {
       // this.params[key1]-- -> this.params[key2]
-      this.params[key1].forEach((item, index) => {
+      this.params[key1] && this.params[key1].forEach((item, index) => {
         this.params[key2][index].material = item.material;
         this.params[key2][index].materialName = item.materialName;
         this.params[key2][index].materialCode = item.materialCode;
@@ -130,7 +151,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
@@ -141,205 +162,140 @@ export default {
       // });
     },
     // 保存并新增
-    handleSubmit() {
-      this.$refs["orderAddForm"].validate(async (valid) => {
-        if (valid) {
-          try {
-            const createById = this.params.buyer;
-            const createByName = this.params.buyerName;
-            const updateById = this.$store.state.user.id;
-            const updateByName = this.$store.state.user.name;
-            const { code, msg } = await orderApi.create({
-              createById,
-              createByName,
-              updateById,
-              updateByName,
-              ...this.params,
-            });
-            if (code === 200) {
-              this.$notify.success({ title: msg });
-              this.setVisible(false);
-            } else {
-              this.$notify.warning({ title: msg });
-            }
-          } catch (err) {
-            this.$notify.error({ title: "error", message: err });
-          } finally {
-            // this.setVisible(false);
-          }
+    async handleSubmit() {
+      // this.$refs["orderAddForm"].validate(async (valid) => {
+      //   if (valid) {
+      try {
+        const createById = this.params.buyer;
+        const createByName = this.params.buyerName;
+        const updateById = this.$store.state.user.id;
+        const updateByName = this.$store.state.user.name;
+        const { code, msg } = await orderApi.create({
+          createById,
+          createByName,
+          updateById,
+          updateByName,
+          ...this.params,
+        });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
         } else {
-          console.log("error submit!!");
-          return false;
+          this.$notify.warning({ title: msg });
         }
-      });
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+      //   } else {
+      //     console.log("error submit!!");
+      //     return false;
+      //   }
+      // });
+    },
+    handleReferChange(val, source) {
+      console.log(val, 'val');
+      console.log(source, 'source');
+      let parmas = {
+        ...this.params
+      }
+      console.log(parmas, 'parmas---------------');
+      this.handleGetPrice(parmas);
+    },
+    // 询价 getPrice
+    async handleGetPrice(data) {
+      try {
+        // let { puOrg, priceType, customer, assignSupplier, material, } = data;
+        await orderApi.getPrice(data).then(res => {
+          console.log(res, 'res------------------');
+        })
+        if (code == 200) {
+
+        }
+      } catch (error) {
+
+      } finally {
+
+      }
     },
+
   },
   created() {
-    console.log("ADD CREATED", this.params);
+    console.log("ADD CREATED", this.params)
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
-    <el-form
-      size="mini"
-      label-position="right"
-      ref="orderAddForm"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
-      >
-        <div
-          slot="header"
-          style="
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form size="mini" label-position="right" ref="orderAddForm" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          "
-        >
+          ">
           <h3>新增</h3>
           <div style="text-align: right">
             <el-button size="mini" @click="handleCancel">取消</el-button>
-            <el-button size="mini" type="danger" @click="handleSava"
-              >保存</el-button
-            >
+            <el-button size="mini" type="danger" @click="handleSava">保存</el-button>
             <el-button size="mini" type="info" @click="handleSubmit">
               保存并新增
             </el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <dr-popover-select
-                v-if="column.type === 'PopoverSelect'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :title="column.title"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :query-params="column.config.queryParams"
-                :source.sync="params"
-              >
+
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+              </el-input>
+              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]"
+                :value-key="column.valueKey" :show-key="column.showKey" :source.sync="params" :title="column.title"
+                :type="column.referName" :multiple="column.multiple" :placeholder="column.placeholder"
+                :data-mapping="column.dataMapping" :query-params="column.queryParams(params)">
               </dr-popover-select>
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
+              </el-input>
+
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in dict.type[column.config.optionsName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
+                :clearable="column.clearable" :placeholder="column.placeholder" style="width: 100%">
+                <el-option v-for="item in dict.type[column.referName]" :key="item.value" :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
-              <el-select
-                v-if="column.type === 'TagSelect'"
-                v-model="params[column.key]"
-                multiple
-                clearable
-                collapse-tags
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-              >
+              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                style="width: 100%">
                 <template #prefix>
-                  <el-icon
-                    class="el-icon-view"
-                    style="cursor: pointer"
-                    @click.stop="$message.info(234)"
-                  ></el-icon>
+                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker
-                v-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
+              <el-date-picker v-if="column.inputType === 'DatePicker'" v-model="params[column.key]" :type="column.type"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-checkbox
-                v-else-if="column.type === 'Checkbox'"
-                v-model="params[column.key]"
-                true-label="Y"
-                false-label="N"
-              ></el-checkbox>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                drag
-                action="https://jsonplaceholder.typicode.com/posts/"
-                multiple
-              >
+              <el-checkbox v-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
+                false-label="N"></el-checkbox>
+              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+                action="https://jsonplaceholder.typicode.com/posts/" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -353,101 +309,59 @@ export default {
         </el-row>
       </el-card>
 
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane
-            v-for="(column, index) in tabColumns"
-            :key="index"
-            :label="column.title"
-            :name="column.key"
-          >
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
             <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width || 80"
-              >
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width || 80">
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}
                   </el-tag>
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    size="mini"
-                    style="width: 100%"
-                  ></el-input>
-                  <dr-popover-select
-                    v-if="cColumn.type === 'PopoverSelect'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
-                    :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
-                    :source.sync="scope.row"
-                    size="mini"
-                  >
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    size="mini" style="width: 100%"></el-input>
+
+                  <!--  -->
+                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
+                    :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
+                    :show-key="cColumn.showKey" :type="cColumn.referName" :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams(scope.row)" @change="handleReferChange">
                   </dr-popover-select>
-                  <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
-                    v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    size="mini"
-                    style="width: 100%"
-                  >
+
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini" style="width: 100%">
                   </el-input-number>
-                  <el-select
-                    v-if="cColumn.type === 'Select'"
-                    v-model="params[cColumn.key]"
-                    :placeholder="column.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    style="width: 100%"
-                  >
-                    <el-option
-                      v-for="item in dict.type[cColumn.config.optionsName]"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
+
+                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
+                    style="width: 100%">
+                    <el-option v-for="item in dict.type[cColumn.referName]" :key="item.value" :label="item.label"
+                      :value="item.value">
                     </el-option>
                   </el-select>
-                  <el-checkbox
-                    v-else-if="cColumn.type === 'Checkbox'"
-                    v-model="params[cColumn.key]"
-                    true-label="Y"
-                    false-label="N"
-                  ></el-checkbox>
+
+
+                  <el-checkbox v-if="cColumn.type === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
+                    false-label="N">
+                  </el-checkbox>
+
                 </template>
               </el-table-column>
+
               <el-table-column fixed="right" label="操作" width="80">
                 <template slot-scope="scope">
-                  <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
-                    type="text"
-                    size="small"
-                  >
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -456,9 +370,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button size="mini" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+          <el-button size="mini" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

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

@@ -2,7 +2,7 @@ export const TableColumns = [
   // { key: "id", title: "主键" },
   // { key: "puOrg", title: "采购组织" },
   { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
-  { key: "billType", title: "订单类型" },
+  { key: "billTypeName", title: "订单类型" },
   { key: "code", title: "订单编号", search: true, type: "Input" },
   { key: "billDate", title: "订单日期" },
   // { key: "supplier", title: "供应商" },

+ 28 - 24
src/views/purchase/purchase-order/edit/index.vue

@@ -9,9 +9,9 @@ const NewTabColumns = TabColumns.map((element) => ({
   tableColumns: initColumns(element.tableColumns),
 }));
 // 
-const SelectColumns = NewColumns.filter(column => column.type === 'Select')
+const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
 NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === 'Select'))
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
 });
 
 export default {
@@ -51,14 +51,14 @@ export default {
     },
     'params.puOrderItemList': {
       handler(nVal, oVal) {
-        this.handleSynchronousMaterial('puOrderItemList', 'puOrderExecuteList');
+        this.params.source == 3 && this.handleSynchronousMaterial('puOrderItemList', 'puOrderExecuteList');
       },
       deep: true,
       immediate: true
     },
     'params.puOrderExecuteList': {
       handler(nVal, oVal) {
-        this.handleSynchronousMaterial('puOrderExecuteList', 'puOrderItemList');
+        this.params.source == 3 && this.handleSynchronousMaterial('puOrderExecuteList', 'puOrderItemList');
       },
       deep: true,
       immediate: true
@@ -72,7 +72,7 @@ export default {
     // 同步子表物料
     handleSynchronousMaterial(key1, key2) {
       // this.params[key1]-- -> this.params[key2]
-      this.params[key1].forEach((item, index) => {
+      this.params[key1] && this.params[key1].forEach((item, index) => {
         this.params[key2][index].material = item.material;
         this.params[key2][index].materialName = item.materialName;
         this.params[key2][index].materialCode = item.materialCode;
@@ -91,7 +91,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -153,7 +153,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -166,6 +166,7 @@ export default {
     },
     beforeOpen() {
     },
+    handleReferChange(val, source) { },
     // 判断修订还是编辑
     handleIsRevise(status) {
       return status == '2';
@@ -206,10 +207,10 @@ export default {
               <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input>
-              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :readonly="column.readonly" :query-params="column.config.queryParams" :title="column.title"
-                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :source.sync="params">
+              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]"
+                :value-key="column.valueKey" :show-key="column.showKey" :source.sync="params" :title="column.title"
+                :type="column.referName" :multiple="column.multiple" :placeholder="column.placeholder"
+                :data-mapping="column.dataMapping" :query-params="column.queryParams(params)">
               </dr-popover-select>
               <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
@@ -219,9 +220,9 @@ export default {
                 :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input-number>
-              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+              <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
+                :clearable="column.clearable" :placeholder="column.placeholder" style="width: 100%">
+                <el-option v-for="item in dict.type[column.referName]" :key="item.value" :label="item.label"
                   :value="item.value">
                 </el-option>
               </el-select>
@@ -234,11 +235,11 @@ export default {
                 <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+              <el-date-picker v-if="column.inputType === 'DatePicker'" v-model="params[column.key]" :type="column.type"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
+              <el-checkbox v-if="column.type === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
                 true-label="Y" false-label="N">
               </el-checkbox>
               <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
@@ -278,19 +279,22 @@ export default {
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :size="size" style="width: 100%">
                   </el-input>
-                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
+                    :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
+                    :show-key="cColumn.showKey" :type="cColumn.referName" :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams(scope.row)" @change="handleReferChange">
                   </dr-popover-select>
-                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
-                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+
+                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
                     style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+                    <el-option v-for="item in dict.type[cColumn.referName]" :key="item.value" :label="item.label"
                       :value="item.value">
                     </el-option>
                   </el-select>
-                  <el-checkbox v-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
+
+                  <el-checkbox v-if="cColumn.type === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
                     false-label="N">
                   </el-checkbox>
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"

+ 3 - 3
src/views/purchase/purchase-order/index.vue

@@ -167,7 +167,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -238,7 +238,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.loading = false;
       }
@@ -257,7 +257,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 1 - 1
src/views/purchase/purchase-order/see/index.vue

@@ -56,7 +56,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 14 - 14
src/views/purchase/task/column.js

@@ -34,11 +34,11 @@ export const TableColumns = [
   { key: "source", title: "需求来源" },
   // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户名称" },
-  { key: "puUnit", title: "采购单位" },
+  // { key: "puUnit", title: "采购单位" },
 
   { key: "demandDate", title: "需求时间" },
   { key: "projectName", title: "项目名称" },
-  { key: "demandPersonal", title: "需求人" },
+  // { key: "demandPersonal", title: "需求人" },
   {
     key: "demandPersonalName",
     title: "需求人名称",
@@ -124,7 +124,7 @@ export const SearchColumns = [
     key: "classIds",
     title: "物料分类",
     inputType: "PopoverTreeSelect",
-    multiple: false,
+    multiple: true,
     valueKey: "id",
     referName: "MATERIALCLASSIFY_PARAM",
     readonly: true,
@@ -156,6 +156,12 @@ export const SearchColumns = [
     queryParams: () => ({}),
   },
   {
+    key: "status",
+    title: "状态",
+    inputType: "Select",
+    referName: "purchase_task_status",
+  },
+  {
     key: "date",
     title: "创建时间",
     inputType: "DatePicker",
@@ -174,21 +180,15 @@ export const SearchColumns = [
     inputType: "PopoverSelect",
     multiple: true,
     valueKey: "id",
-    referName: "PSNLICENSE_PARAM",
+    referName: "CONTACTS_PARAM",
     readonly: true,
     dataMapping: {},
     queryParams: () => ({}),
   },
   {
-    key: "status",
-    title: "状态",
-    inputType: "Select",
-    referName: "purchase_task_status",
+    key: "documentsCodes",
+    title: "需求来源",
+    inputType: "Input",
+    placeholder: "请输入来源单据号,多个用,分隔",
   },
-  // {
-  //   key: "documentsCodes",
-  //   title: "需求来源",
-  //   inputType: "Input",
-  //   placeholder: "请输入来源单据号,多个用,分隔",
-  // },
 ];

+ 8 - 4
src/views/purchase/task/documents-return/index.vue

@@ -18,7 +18,7 @@ export default {
       this.visible = prop;
     },
     beforeOpenDoSome(prop) {
-      const documentIds = prop.map((item) => item.demandItemId);
+      const documentIds = prop.map((item) => item.id);
       this.params.documentIds = documentIds;
     },
     async handleComfire(prop) {
@@ -30,17 +30,21 @@ export default {
           documentIds: documentIds,
         });
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.visible = false;
+          this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
+    hide() {
+      this.params.baskCause = "";
+      this.params.documentIds = [];
+    },
   },
   created() {},
   mounted() {},
@@ -49,7 +53,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog title="请购退回" width="30%" :visible.sync="visible">
+  <el-dialog :visible.sync="visible" title="退回需求" @close="hide">
     <el-alert
       title="请填写退单原因"
       type="info"

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

@@ -33,7 +33,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -61,22 +61,20 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
     },
   },
-  created() {
-    console.log("initColumns(TableColumns)", initColumns(TableColumns));
-  },
+  created() {},
   mounted() {},
   destroyed() {},
 };
 </script>
 
 <template>
-  <el-dialog :with-header="false" :visible.sync="visible">
+  <el-dialog :visible.sync="visible" title="首次协议直采">
     <div
       v-for="(item, index) in data"
       :key="index"

+ 128 - 167
src/views/purchase/task/index.vue

@@ -1,6 +1,6 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
-import { LIST, SHUTDOWN } from "@/api/business/purchase/task";
+import { LIST, SHUTDOWN, EXPORT } from "@/api/business/purchase/task";
 import {
   initPage,
   initLayout,
@@ -38,16 +38,16 @@ export default {
   computed: {},
   watch: {},
   created() {
-    this.handleQueryList();
+    this.handleQueryList(this.params, this.page);
   },
   methods: {
     //
-    async fetchList(params, page) {
+    async fetchList(prop, page) {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
         const { code, msg, rows, total } = await LIST(
-          { ...params },
+          { ...prop },
           { pageNum, pageSize, isAsc: "desc", orderByColumn: "createTime" }
         );
         if (code === 200) {
@@ -58,17 +58,17 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
     // 查询操作
-    handleQueryList() {
-      const { date } = this.params;
-      this.params.endDate = date[1];
-      this.params.startDate = date[0];
-      this.fetchList({ ...this.params }, this.page);
+    handleQueryList(prop, page) {
+      const { date } = prop;
+      prop.endDate = date[1];
+      prop.startDate = date[0];
+      this.fetchList({ ...prop, date: undefined }, page);
     },
     // 重置操作
     handleResetList() {
@@ -98,17 +98,17 @@ export default {
         const { code, msg } = await SHUTDOWN(demandItemId);
         if (code === 200) {
           this.$notify.success({ title: msg });
-          await this.handleQueryList();
+          await this.handleQueryList(this.params, this.page);
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
-    // 退回请购
+    // 退回需求
     async handleDocumentsReturn(prop) {
       const { setVisible, beforeOpenDoSome } = this.$refs.DocReturnDialog;
       await setVisible(true);
@@ -121,6 +121,15 @@ export default {
       await setVisible(true);
       await beforeOpenDoSome(id);
     },
+    // 导出
+    async handleExport(prop, page) {
+      const { pageNum, pageSize } = page;
+      this.download(
+        "pu/order/generate/export",
+        { ...prop, pageNum, pageSize },
+        `KONG_${new Date().getTime()}.xlsx`
+      );
+    },
     // 打开查看drawer
     async handleOpenSeeDrawer(prop) {
       const { id } = prop;
@@ -134,141 +143,119 @@ export default {
       await setVisible(true);
       await beforeOpenDoSome(prop);
     },
-    handleCCCC(prop, source) {
-      console.log("CCCCCC", prop, source);
-    },
   },
 };
 </script>
 
 <template>
-  <el-card
-    v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
-    :body-style="{ padding: 0 }"
-  >
+  <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
     <see-dialog ref="SeeDialog"></see-dialog>
     <first-direct-dialog ref="FirstDirectDialog"></first-direct-dialog>
     <doc-return-dialog ref="DocReturnDialog"></doc-return-dialog>
     <modify-buyer-dialog ref="ModifyBuyerDialog"></modify-buyer-dialog>
     <el-form
       :size="size"
+      :inline="true"
       :model="params"
       label-width="75px"
       label-position="right"
+      style="padding: 20px 20px 0"
     >
-      <el-row :gutter="24" style="padding: 20px 20px">
-        <el-col
-          v-for="column in searchColumns"
-          :key="column.title"
-          :xl="4"
-          :lg="6"
-          :md="8"
-          :sm="12"
-          :xs="24"
+      <el-form-item
+        v-for="column in searchColumns"
+        :key="column.title"
+        :prop="column.key"
+        :label="column.title"
+      >
+        <el-input
+          v-if="column.inputType === 'Input'"
+          v-model="params[column.key]"
+          :disabled="column.disabled"
+          :clearable="column.clearable"
+          :placeholder="column.placeholder"
+          style="width: 100%"
+        ></el-input>
+        <el-select
+          v-if="column.inputType === 'Select'"
+          v-model="params[column.key]"
+          :disabled="column.disabled"
+          :clearable="column.clearable"
+          :placeholder="column.placeholder"
+          style="width: 100%"
         >
-          <el-form-item
-            v-if="column.inputType === 'Input'"
-            :prop="column.key"
-            :label="column.title"
-          >
-            <el-input
-              v-model="params[column.key]"
-              :placeholder="column.placeholder"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            v-if="column.inputType === 'Select'"
-            :prop="column.key"
-            :label="column.title"
-          >
-            <el-select
-              v-model="params[column.key]"
-              :disabled="column.disabled"
-              :clearable="column.clearable"
-              :placeholder="column.placeholder"
-              style="width: 100%"
-            >
-              <el-option
-                v-for="item in dict.type[column.referName]"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item
-            v-if="column.inputType === 'DatePicker'"
-            :prop="column.key"
-            :label="column.title"
-          >
-            <el-date-picker
-              v-model="params[column.key]"
-              :type="column.type"
-              :placeholder="column.placeholder"
-              :value-format="column.valueFormat"
-              :unlink-panels="column.unlinkPanels"
-              :picker-options="column.pickerOptions"
-              :range-separator="column.rangeSeparator"
-              :end-placeholder="column.endPlaceholder"
-              :start-placeholder="column.startPlaceholder"
-              style="width: 100%"
-            >
-            </el-date-picker>
-          </el-form-item>
-          <el-form-item
-            v-if="column.inputType === 'PopoverSelect'"
-            :prop="column.key"
-            :label="column.title"
-          >
-            <dr-popover-select
-              v-model="params[column.key]"
-              :source.sync="params"
-              :title="column.title"
-              :type="column.referName"
-              :multiple="column.multiple"
-              :placeholder="column.placeholder"
-              :data-mapping="column.dataMapping"
-              :query-params="column.queryParams(params)"
-              @change="handleCCCC"
-            >
-            </dr-popover-select>
-          </el-form-item>
-          <el-form-item
-            v-if="column.inputType === 'PopoverTreeSelect'"
-            :prop="column.key"
-            :label="column.title"
+          <el-option
+            v-for="item in dict.type[column.referName]"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
           >
-            <dr-popover-tree-select
-              v-model="params[column.key]"
-              :source.sync="params"
-              :title="column.title"
-              :type="column.referName"
-              :multiple="column.multiple"
-              :value-key="column.valueKey"
-              :placeholder="column.placeholder"
-              :data-mapping="column.dataMapping"
-              :query-params="column.queryParams(params)"
-            >
-            </dr-popover-tree-select>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-button type="primary" :size="size" @click="handleQueryList">
-            搜 索
-          </el-button>
-          <el-button :size="size" @click="handleResetList"> 重 置 </el-button>
-        </el-col>
-      </el-row>
+          </el-option>
+        </el-select>
+        <el-date-picker
+          v-if="column.inputType === 'DatePicker'"
+          v-model="params[column.key]"
+          :type="column.type"
+          :placeholder="column.placeholder"
+          :value-format="column.valueFormat"
+          :unlink-panels="column.unlinkPanels"
+          :picker-options="column.pickerOptions"
+          :range-separator="column.rangeSeparator"
+          :end-placeholder="column.endPlaceholder"
+          :start-placeholder="column.startPlaceholder"
+          style="width: 100%"
+        >
+        </el-date-picker>
+        <dr-popover-select
+          v-if="column.inputType === 'PopoverSelect'"
+          v-model="params[column.key]"
+          :size="size"
+          :source.sync="params"
+          :title="column.title"
+          :type="column.referName"
+          :multiple="column.multiple"
+          :readonly="column.readonly"
+          :value-key="column.valueKey"
+          :placeholder="column.placeholder"
+          :data-mapping="column.dataMapping"
+          :query-params="column.queryParams(params)"
+        >
+        </dr-popover-select>
+        <dr-popover-tree-select
+          v-if="column.inputType === 'PopoverTreeSelect'"
+          v-model="params[column.key]"
+          :source.sync="params"
+          :title="column.title"
+          :type="column.referName"
+          :multiple="column.multiple"
+          :show-key="column.showKey"
+          :value-key="column.valueKey"
+          :placeholder="column.placeholder"
+          :data-mapping="column.dataMapping"
+          :query-params="column.queryParams(params)"
+        >
+        </dr-popover-tree-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          circle
+          :size="size"
+          icon="el-icon-search"
+          @click="handleQueryList(params, page)"
+        ></el-button>
+        <el-button
+          circle
+          :size="size"
+          icon="el-icon-refresh"
+          @click="handleResetList"
+        ></el-button>
+      </el-form-item>
     </el-form>
     <el-row :gutter="24" style="padding: 0 20px">
       <el-col :span="24">
-        <el-button
-          :size="size"
-          :disabled="selectData.length !== 1"
-          @click="handleModifyBuyer(selectData[0])"
-        >
+        <el-button :size="size" @click="handleExport(params, page)">
+          导 出
+        </el-button>
+        <el-button :size="size" :disabled="selectData.length !== 1" @click="handleModifyBuyer(selectData[0])">
           转 派
         </el-button>
         <el-button
@@ -276,62 +263,36 @@ export default {
           :disabled="!selectData.length"
           @click="handleDocumentsReturn(selectData)"
         >
-          退回请购
+          退回需求
         </el-button>
-        <el-button
+        <!-- <el-button
           :size="size"
           :disabled="selectData.length !== 1"
           @click="handleShutDown(selectData[0])"
         >
           行关闭
-        </el-button>
-        <el-button
-          :size="size"
-          :disabled="!selectData.length"
-          @click="handleOpenFristDirectDrawer(selectData)"
-        >
+        </el-button> -->
+        <el-button :size="size" :disabled="!selectData.length" @click="handleOpenFristDirectDrawer(selectData)">
           协议直采
         </el-button>
       </el-col>
     </el-row>
-    <el-table
-      :data="tableData"
-      size="mini"
-      style="width: 100%; margin: 20px 0 0 0"
-      @row-dblclick="handleOpenSeeDrawer"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table :data="tableData" size="mini" style="width: 100%; margin: 20px 0 0 0" @row-dblclick="handleOpenSeeDrawer"
+      @selection-change="handleSelectionChange">
       <el-table-column fixed width="55" align="center" type="selection">
       </el-table-column>
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
-      >
+      <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
+        :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
         <template slot-scope="scope">
-          <dict-tag
-            v-if="column.referName"
-            :size="size"
-            :value="scope.row[column.key]"
-            :options="dict.type[column.referName]"
-          />
+          <dict-tag v-if="column.referName" :size="size" :value="scope.row[column.key]"
+            :options="dict.type[column.referName]" />
           <span v-else>{{ scope.row[column.key] }}</span>
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :total="page.total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper"
-    >
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
+      :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
+      layout="total, prev, pager, next, sizes, jumper">
     </el-pagination>
   </el-card>
 </template>

+ 7 - 2
src/views/purchase/task/modify-buyer/index.vue

@@ -31,11 +31,16 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
+    hide() {
+      this.params.id = "";
+      this.params.buyer = "";
+      this.params.buyerName = "";
+    },
   },
   created() {},
   mounted() {},
@@ -44,7 +49,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog title="转派" width="30%" :visible.sync="visible">
+  <el-dialog :visible.sync="visible" title="转派" @close="hide">
     <el-alert
       title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"
       type="info"

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

@@ -34,7 +34,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -46,8 +46,11 @@ export default {
 };
 </script>
 <template>
-  <el-dialog :visible.sync="visible">
-    <el-descriptions :column="2" title="明细" border>
+  <el-dialog
+    :visible.sync="visible"
+    title="明细"
+  >
+    <el-descriptions :column="2" border>
       <el-descriptions-item
         v-if="params[column.key]"
         v-for="(column, index) in columns"

+ 178 - 99
src/views/purchase/transferOrder/add.vue

@@ -43,7 +43,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调拨方式">
-              <el-select v-model="basicForm.allotType" :disabled="sonDisable" size="small" style="width: 200px" clearable>
+              <el-select v-model="basicForm.allotType" disabled size="small" style="width: 200px" clearable>
                 <el-option v-for="dict in dict.type.sys_to_type" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -117,7 +117,7 @@
               <el-input
                 v-model="basicForm.onRouteAffilliation"
                 size="small"
-                :disabled="sonDisable"
+                disabled
                 clearable
                 style="width: 200px"
               />
@@ -158,24 +158,16 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-input
-                v-model="basicForm.storageWarehouse"
-                size="small"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库')" style="width: 200px">
+                <el-option v-for="item in ruHouseOptions" :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.deliveryWarehouse"
-                size="small"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="basicForm.deliveryWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库')" style="width: 200px">
+                <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
@@ -224,7 +216,7 @@
       <el-tabs style="margin-top: 10px;" type="border-card">
         <el-tab-pane label="物料信息">
           <div class="btn_grooup">
-            <el-button type="primary" size="small" @click="addLine">增行</el-button>
+            <el-button type="primary" size="small" v-if="!sonDisable" @click="addLine">增行</el-button>
           </div>
           <el-table
           :data="materialInfo" 
@@ -241,11 +233,11 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="物料名称" align="center" prop="materialName"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
+          <el-table-column label="物料名称" align="center" prop="materialName" width="200px"/>
+          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="200px"/>
+          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="200px"/>
           <el-table-column label="规格" align="center" prop="specification"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
+          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="200px"/>
           <el-table-column label="产地" align="center" prop="originPlaceName"/>
           <el-table-column label="型号" align="center" prop="model"/>
           <el-table-column label="单位" align="center" prop="unitName"/>
@@ -268,8 +260,16 @@
           </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"/>
-          <el-table-column label="产品批号" align="center" prop="producBatch"/>
+          <el-table-column label="批次号" align="center" prop="patchNo" width="150px"/>
+          <el-table-column label="产品批号" align="center" prop="producBatch" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input readonly size="small" v-model="scope.row.producBatch">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseBatch(scope.$index)"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column label="生产日期" align="center" prop="manufactureDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -283,15 +283,15 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-          <el-table-column label="注册证号" align="center" prop="registration"/>
-          <el-table-column label="商品名" align="center" prop="productCode"/>
-          <el-table-column label="通用名" align="center" prop="commonCode"/>
+          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="200px"/>
+          <el-table-column label="注册证号" align="center" prop="registration" width="200px"/>
+          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
           <el-table-column label="剂型" align="center" prop="drug"/>
-          <el-table-column label="调入调出结算规则明细" align="center" prop="ruleDetail"/>
-          <el-table-column label="上市许可持有人" align="center" prop="marketingApprovalPersonal"/>
-          <el-table-column label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production"/>
+          <el-table-column label="调入调出结算规则明细" align="center" prop="ruleDetail" width="200px"/>
+          <el-table-column label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="200px"/>
+          <el-table-column label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
           <el-table-column label="pi码" align="center" prop="pi">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -301,9 +301,9 @@
           </el-table-column>
           <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
           <!-- <el-table-column label="备注" align="center" prop="code"/> -->
-          <el-table-column label="类别" align="center" prop="classify"/>
-          <el-table-column label="客户物料码" align="center" prop="customerLogistic"/>
-          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
+          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
+          <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           <el-table-column
             fixed="right"
             label="操作"
@@ -323,34 +323,34 @@
           max-height="480"
           >
           <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-          <el-table-column label="产地" align="center" prop="originPlace"/>
-          <el-table-column label="类别" align="center" prop="classify"/>
-          <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/>
-          <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/>
+          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+          <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
+          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
+          <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
+          <el-table-column label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
           <!-- <el-table-column label="收货利润中心" align="center" prop="code"/>
           <el-table-column label="发货利润中心" align="center" prop="code"/> -->
-          <el-table-column label="调入业务员" align="center" prop="businessPersonalName"/>
-          <el-table-column label="产品批号" align="center" prop="productBatch"/>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-          <el-table-column label="注册证号" align="center" prop="registration"/>
-          <el-table-column label="商品名" align="center" prop="productCode"/>
-          <el-table-column label="通用名" align="center" prop="commonCode"/>
-          <el-table-column label="剂型" align="center" prop="drug"/>
-          <el-table-column label="收货客户" align="center" prop="customerName"/>
-          <el-table-column label="收货地址" align="center" prop="addressaddress"/>
-          <el-table-column label="收货地区" align="center" prop="area"/>
-          <el-table-column label="收货地点" align="center" prop="place"/>
-          <el-table-column label="计划发货日期" align="center" prop="deliveryDate"/>
-          <el-table-column label="计划到货日期" align="center" prop="strageDate"/>
-          <el-table-column label="运输方式" align="center" prop="transportation"/>
-          <el-table-column label="备注" align="center" prop="remark"/>
-          <el-table-column label="客户物料编码" align="center" prop="customerLogistic"/>
-          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
+          <el-table-column label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
+          <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
+          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+          <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
+          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
+          <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
+          <el-table-column label="收货客户" align="center" prop="customerName" width="150px"/>
+          <el-table-column label="收货地址" align="center" prop="addressaddress" width="150px"/>
+          <el-table-column label="收货地区" align="center" prop="area" width="150px"/>
+          <el-table-column label="收货地点" align="center" prop="place" width="150px"/>
+          <el-table-column label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
+          <el-table-column label="计划到货日期" align="center" prop="strageDate" width="150px"/>
+          <el-table-column label="运输方式" align="center" prop="transportation" width="150px"/>
+          <el-table-column label="备注" align="center" prop="remark" width="150px"/>
+          <el-table-column label="客户物料编码" align="center" prop="customerLogistic" width="150px"/>
+          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           </el-table>
         </el-tab-pane>
 
@@ -361,30 +361,30 @@
           max-height="480"
           >
           <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-          <el-table-column label="产地" align="center" prop="originPlace"/>
-          <el-table-column label="类别" align="center" prop="classify"/>
+          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+          <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
+          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
           <!-- <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="productBatch"/>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-          <el-table-column label="注册证号" align="center" prop="registration"/>
-          <el-table-column label="商品名" align="center" prop="productCode"/>
-          <el-table-column label="通用名" align="center" prop="commonCode"/>
-          <el-table-column label="剂型" align="center" prop="drug"/>
+          <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
+          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+          <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
+          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
+          <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
           <!-- <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="code"/> -->
           <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
           <!-- <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 label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           </el-table>
         </el-tab-pane>
 
@@ -395,19 +395,19 @@
           max-height="480"
           >
           <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-          <el-table-column label="产地" align="center" prop="originPlace"/>
-          <el-table-column label="类别" align="center" prop="classify"/>
-          <el-table-column label="产品批号" align="center" prop="productBatch	"/>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-          <el-table-column label="注册证号" align="center" prop="registration"/>
-          <el-table-column label="商品名" align="center" prop="productCode"/>
-          <el-table-column label="通用名" align="center" prop="commonCode"/>
-          <el-table-column label="剂型" align="center" prop="drug"/>
+          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+          <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
+          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
+          <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
+          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+          <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
+          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
+          <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
           <!-- <el-table-column label="已调出主数量" align="center" prop="code"/>
           <el-table-column label="已调入主数量" align="center" prop="code"/> -->
           <!-- <el-table-column label="调拨在途主数量" align="center" prop="code"/> -->
@@ -416,8 +416,8 @@
           <!-- <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="customerLogistic"/>
-          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
+          <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           </el-table>
         </el-tab-pane>
       </el-tabs>
@@ -427,7 +427,7 @@
         <el-col :span="1.5">
             <el-form-item label="制单人">
               <el-input
-                v-model="basicForm.code"
+                v-model="basicForm.createByName"
                 size="small"
                 disabled
                 clearable
@@ -438,7 +438,7 @@
         <el-col :span="1.5">
             <el-form-item label="制单日期">
               <el-input
-                v-model="basicForm.code"
+                v-model="basicForm.createTime"
                 size="small"
                 disabled
                 clearable
@@ -446,7 +446,7 @@
               />
             </el-form-item>
           </el-col>
-        <el-col :span="1.5">
+        <!-- <el-col :span="1.5">
             <el-form-item label="审批人">
               <el-input
                 v-model="basicForm.code"
@@ -467,7 +467,7 @@
                 style="width: 200px"
               />
             </el-form-item>
-          </el-col>
+          </el-col> -->
       </el-row>
 
       <el-divider content-position="left">审计信息</el-divider>
@@ -486,7 +486,7 @@
         <el-col :span="1.5">
             <el-form-item label="创建时间">
               <el-input
-                v-model="basicForm.code"
+                v-model="basicForm.createTime"
                 size="small"
                 disabled
                 clearable
@@ -508,7 +508,7 @@
         <el-col :span="1.5">
             <el-form-item label="最后修改时间">
               <el-input
-                v-model="basicForm.code"
+                v-model="basicForm.updateTime"
                 size="small"
                 disabled
                 clearable
@@ -534,15 +534,20 @@
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
     <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
     <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+    <batchRefers ref="batchRefer" @doSubmit="selectBatch" :single="true"/>
   </div>
 </template>
 
 <script>
 import {addOrder, getOrderDetail, editOrder} from '@/api/purchase/transferOrder.js'
 import Refers from '@/components/Refers/refers.vue'
+// 用于回显参照框数据
+import { getRefer } from '@/api/purchase/basic.js'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 // 明细行选择物料参照
 import popDialog from '@/components/PopDialog/index.vue'
+// 明细行选择批次号
+import batchRefers from '@/components/Refers/batchRefer.vue'
 
 export default {
   name: 'addOder',
@@ -551,7 +556,8 @@ export default {
   components: {
     Refers,
     TreeRefers,
-    popDialog
+    popDialog,
+    batchRefers
   },
   model: {
     prop: 'isList',
@@ -606,10 +612,16 @@ export default {
         isPage: true,
         title: '',
       },
+      referConditionMx: {
+        orgCode: '',
+        materialCode: '',
+        unitCode: '',
+        warehouseCode: ''
+      },
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
       tableIndex: null,
       chuOrgOptions: [],
@@ -617,6 +629,8 @@ export default {
       manOptions: [],
       deptOptions: [],
       currencyOptions: [],
+      ruHouseOptions: [],
+      chuHouseOptions: [],
       liacenterOptions: [],
       basicRules: {},
       materialInfo: [],
@@ -676,6 +690,43 @@ export default {
           this.receiveInfo = res.data.stAllotReceiveDeliverList
           this.priceList = res.data.stAllotReceiveExecuteList
           this.resultList = res.data.stAllotReceiveExpenseList
+          if(this.basicForm.deliveryInventoryOrg) { this.reBackRefer('ORG_PARAM', this.basicForm.deliveryInventoryOrg, '调出库存组织') }
+          if(this.basicForm.storageInventoryOrg) { this.reBackRefer('ORG_PARAM', this.basicForm.storageInventoryOrg, '调入库存组织') }
+          if(this.basicForm.businessPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.businessPersonal) }
+          if(this.basicForm.deliveryDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.deliveryDept) }
+          if(this.basicForm.currency) { this.reBackRefer('CURRENCY_PARAM', this.basicForm.currency) }
+          if(this.basicForm.storageWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.storageWarehouse, '调入仓库') }
+          if(this.basicForm.deliveryWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.deliveryWarehouse, '调出仓库') }
+          if(this.basicForm.liacenter) { this.reBackRefer('LIACENTER_PARAM', this.basicForm.liacenter) }
+        }
+      })
+    },
+    // 回显参照框
+    reBackRefer(type, id, title) {
+      getRefer({ type: type, id: id, title: title }).then(res => {
+        if (type == 'ORG_PARAM' && title == '调出库存组织') {
+          this.chuOrgOptions = res.rows
+        }
+        if (type == 'ORG_PARAM' && title == '调入库存组织') {
+          this.ruOrgOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM') {
+          this.manOptions = res.rows
+        }
+        if (type == 'DEPT_PARAM') {
+          this.deptOptions = res.rows
+        }
+        if (type == 'CURRENCY_PARAM') {
+          this.currencyOptions = res.rows
+        }
+        if (type == 'LIACENTER_PARAM') {
+          this.liacenterOptions = res.rows
+        }
+        if (type == 'WAREHOUSE_PARAM' && title == '调入仓库') {
+          this.ruHouseOptions = res.rows
+        }
+        if (type == 'WAREHOUSE_PARAM' && title == '调出仓库') {
+          this.chuHouseOptions = res.rows
         }
       })
     },
@@ -741,6 +792,12 @@ export default {
         this.basicForm.storageInventoryOrg = selection[0].id
         this.basicForm.storageInventoryOrgName = selection[0].name
         this.basicForm.onRouteAffilliation = selection[0].name
+        // 选择调入库存组织时判断调拨方式
+        if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
+          this.basicForm.allotType = '4'
+        } else {
+          this.basicForm.allotType = '2'
+        }
       }
       if (this.referCondition.title == '调出业务员') {
         this.manOptions = selection
@@ -757,6 +814,16 @@ export default {
         this.basicForm.currency = selection[0].id
         this.basicForm.currencyName = selection[0].name
       }
+      if (this.referCondition.title == '调入仓库') {
+        this.ruHouseOptions = selection
+        this.basicForm.storageWarehouse = selection[0].id
+        this.basicForm.storageWarehouseName = selection[0].name
+      }
+      if (this.referCondition.title == '调出仓库') {
+        this.chuHouseOptions = selection
+        this.basicForm.deliveryWarehouse = selection[0].id
+        this.basicForm.deliveryWarehouseName = selection[0].name
+      }
     },
     chooseTreeRefer(type, isPage, title) {
       this.referCondition.type = type
@@ -791,6 +858,18 @@ export default {
       this.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant
       this.materialInfo[this.tableIndex].production = selection[0].productionPermit
     },
+    // 明细行选择批次号
+    chooseBatch(index) {
+      this.tableIndex = index
+      this.referConditionMx.orgCode = this.basicForm.deliveryInventoryOrg
+      this.referConditionMx.materialCode = this.materialInfo[this.tableIndex].material
+      this.referConditionMx.unitCode = this.materialInfo[this.tableIndex].unit
+      this.referConditionMx.warehouseCode = this.basicForm.deliveryWarehouse
+      this.$refs.batchRefer.init(this.referConditionMx)
+    },
+    selectBatch(selection) {
+      console.log('选中的批次号', selection)
+    },
   }
 }
 </script>

+ 179 - 153
src/views/purchase/transferOrder/index.vue

@@ -5,58 +5,47 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="调出库存组织">
-              <el-input
-              v-model="queryParams.dckczz"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-              />
+              <el-select clearable size="small" v-model="queryParams.deliveryInventoryOrg" @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-date-picker
                style="width: 240px"
+               size="small"
+               clearable
+               value-format="yyyy-MM-dd"
                 v-model="queryParams.billDate"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期">
+                type="date">
               </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
-            <el-form-item label="交易类型">
-              <el-input
-              v-model="queryParams.jylx"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-              />
+            <el-form-item label="订单类型">
+              <el-select v-model="queryParams.billType" size="small" style="width: 200px" clearable>
+                <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
-            <el-form-item label="出货库存组织">
-              <el-input
-              v-model="queryParams.chkczz"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-              />
+            <el-form-item label="调入库存组织">
+              <el-select clearable size="small" v-model="queryParams.storageInventoryOrg" @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="" 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>
 
-        <CollapseTransition>
+        <!-- <CollapseTransition>
         <div v-show="expanded">
           <el-row :gutter="10">
             <el-col :span="1.5">
@@ -83,9 +72,9 @@
             </el-col>
           </el-row>
         </div>
-        </CollapseTransition>
+        </CollapseTransition> -->
       </el-form>
-      <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+      <!-- <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider> -->
 
       <el-card>
         <div class="btn_grooup">
@@ -101,37 +90,35 @@
           ref="multipleTable"
           @row-click="select"
         >
-          <el-table-column label="调出库存" align="center" prop="deliveryInventoryOrgName"/>
-          <el-table-column label="订单类型" align="center" prop="billType"/>
-          <el-table-column label="单据号" align="center" prop="code"/>
-          <el-table-column label="单据日期" align="center" prop="billDate"/>
-          <el-table-column label="调拨方式" align="center" prop="allotType"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
-          <el-table-column label="调拨入库组织" align="center" prop="storageInventoryOrgName"/>
-          <el-table-column label="调出业务员" align="center" prop="businessPersonalName"/>
-          <el-table-column label="调出部门" align="center" prop="deliveryDeptName"/>
+          <el-table-column label="调出库存" align="center" prop="deliveryInventoryOrgName" width="150px"/>
+          <el-table-column label="订单类型" align="center" prop="billType" width="150px"/>
+          <el-table-column label="单据号" align="center" prop="code" width="150px"/>
+          <el-table-column label="单据日期" align="center" prop="billDate" width="150px"/>
+          <el-table-column label="调拨方式" align="center" prop="allotType" width="150px"/>
+          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column label="调拨入库组织" align="center" prop="storageInventoryOrgName" width="150px"/>
+          <el-table-column label="调出业务员" align="center" prop="businessPersonalName" width="150px"/>
+          <el-table-column label="调出部门" align="center" prop="deliveryDeptName" width="150px"/>
           <el-table-column label="币种" align="center" prop="currencyName"/>
           <el-table-column label="折本汇率" align="center" prop="rate"/>
-          <el-table-column label="在途归属" align="center" prop="onRouteAffilliation"/>
+          <el-table-column label="在途归属" align="center" prop="onRouteAffilliation" width="150px"/>
           <el-table-column label="总数量" align="center" prop="qty"/>
-          <el-table-column label="结算路径" align="center" prop="accountPath"/>
-          <el-table-column label="客户" align="center" prop="customerName"/>
-          <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/>
-          <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/>
-          <el-table-column label="物流项目组" align="center" prop="code"/>
-          <el-table-column label="利润中心" align="center" prop="code"/>
-          <el-table-column label="已同步WMS" 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="code"/>
-          <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="code"/>
-          <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="accountPath" width="150px"/>
+          <el-table-column label="客户" align="center" prop="customerName" width="150px"/>
+          <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName" width="180px"/>
+          <el-table-column label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
+          <el-table-column label="物流项目组" align="center" prop="materialProject" width="150px"/>
+          <el-table-column label="利润中心" align="center" prop="liacenterName" width="150px"/>
+          <el-table-column label="已同步WMS" align="center" prop="isSendWms" width="150px"/>
+          <el-table-column label="备注" align="center" prop="remark" width="150px"/>
+          <el-table-column label="单据状态" align="center" prop="status" width="150px"/>
+          <el-table-column label="制单人" align="center" prop="createByName" width="150px"/>
+          <el-table-column label="制单日期" align="center" prop="createTime" width="150px"/>
+          <!-- <el-table-column label="审批人" align="center" prop="code" width="150px"/> -->
+          <!-- <el-table-column label="审批日期" align="center" prop="code" width="150px"/> -->
+          <el-table-column label="最后修改人" align="center" prop="updateByName" width="150px"/>
+          <el-table-column label="最后修改时间" align="center" prop="updateTime" width="150px"/>
           <el-table-column
           fixed="right"
           label="操作"
@@ -155,7 +142,7 @@
           :total=total>
         </el-pagination>
 
-        <el-tabs style="margin-top: 10px;" type="border-card">
+        <el-tabs style="margin-top: 10px;">
           <el-tab-pane label="物料信息">
             <el-table
             :data="materialInfo" 
@@ -163,40 +150,40 @@
             max-height="380"
             >
             <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="物料编码" align="center" prop="material"/>
-            <el-table-column label="物料名称" align="center" prop="materialName"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
+            <el-table-column label="物料编码" align="center" prop="material" width="150px"/>
+            <el-table-column label="物料名称" align="center" prop="materialName" width="150px"/>
+            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
             <el-table-column label="规格" align="center" prop="specification"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-            <el-table-column label="产地" align="center" prop="originPlace"/>
-            <el-table-column label="型号" align="center" prop="model"/>
-            <el-table-column label="单位" align="center" prop="unitName"/>
+            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column label="型号" align="center" prop="model" width="150px"/>
+            <el-table-column label="单位" align="center" prop="unitName" width="150px"/>
             <!-- <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
-            <el-table-column label="数量" align="center" prop="qty"/>
-            <el-table-column label="主单位" align="center" prop="mainUnit"/>
-            <el-table-column label="换算率" align="center" prop="equation"/>
-            <el-table-column label="主数量" align="center" prop="mainQty"/>
-            <el-table-column label="税率" align="center" prop="rate"/>
+            <el-table-column label="数量" align="center" prop="qty" width="150px"/>
+            <el-table-column label="主单位" align="center" prop="mainUnit" width="150px"/>
+            <el-table-column label="换算率" align="center" prop="equation" width="150px"/>
+            <el-table-column label="主数量" align="center" prop="mainQty" width="150px"/>
+            <el-table-column label="税率" align="center" prop="rate" width="150px"/>
             <!-- <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/> -->
-            <el-table-column label="批次号" align="center" prop="patchNo"/>
-            <el-table-column label="产品批号" align="center" prop="producBatch"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-            <el-table-column label="注册证号" align="center" prop="registration"/>
-            <el-table-column label="商品名" align="center" prop="productCode"/>
-            <el-table-column label="通用名" align="center" prop="commonCode"/>
-            <el-table-column label="剂型" align="center" prop="drug"/>
-            <el-table-column label="调入调出结算规则明细" align="center" prop="ruleDetail"/>
-            <el-table-column label="上市许可持有人" align="center" prop="marketingApprovalPersonal"/>
-            <el-table-column label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production"/>
-            <el-table-column label="pi码" align="center" prop="pi"/>
+            <el-table-column label="批次号" align="center" prop="patchNo" width="150px"/>
+            <el-table-column label="产品批号" align="center" prop="producBatch" width="150px"/>
+            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
+            <el-table-column label="调入调出结算规则明细" align="center" prop="ruleDetail" width="150px"/>
+            <el-table-column label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="150px"/>
+            <el-table-column label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
+            <el-table-column label="pi码" align="center" prop="pi" width="150px"/>
             <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
             <!-- <el-table-column label="备注" align="center" prop="code"/> -->
-            <el-table-column label="类别" align="center" prop="classify"/>
-            <el-table-column label="客户物料码" align="center" prop="customerLogistic"/>
-            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
+            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
+            <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
 
@@ -207,34 +194,34 @@
             max-height="380"
             >
             <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-            <el-table-column label="产地" align="center" prop="originPlace"/>
-            <el-table-column label="类别" align="center" prop="classify"/>
-            <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/>
-            <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/>
+            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
+            <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
+            <el-table-column label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
             <!-- <el-table-column label="收货利润中心" align="center" prop="code"/>
             <el-table-column label="发货利润中心" align="center" prop="code"/> -->
-            <el-table-column label="调入业务员" align="center" prop="businessPersonalName"/>
-            <el-table-column label="产品批号" align="center" prop="productBatch"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-            <el-table-column label="注册证号" align="center" prop="registration"/>
-            <el-table-column label="商品名" align="center" prop="productCode"/>
-            <el-table-column label="通用名" align="center" prop="commonCode"/>
-            <el-table-column label="剂型" align="center" prop="drug"/>
-            <el-table-column label="收货客户" align="center" prop="customerName"/>
-            <el-table-column label="收货地址" align="center" prop="addressaddress"/>
-            <el-table-column label="收货地区" align="center" prop="area"/>
-            <el-table-column label="收货地点" align="center" prop="place"/>
-            <el-table-column label="计划发货日期" align="center" prop="deliveryDate"/>
-            <el-table-column label="计划到货日期" align="center" prop="strageDate"/>
-            <el-table-column label="运输方式" align="center" prop="transportation"/>
-            <el-table-column label="备注" align="center" prop="remark"/>
-            <el-table-column label="客户物料编码" align="center" prop="customerLogistic"/>
-            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
+            <el-table-column label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
+            <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
+            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
+            <el-table-column label="收货客户" align="center" prop="customerName" width="150px"/>
+            <el-table-column label="收货地址" align="center" prop="addressaddress" width="150px"/>
+            <el-table-column label="收货地区" align="center" prop="area" width="150px"/>
+            <el-table-column label="收货地点" align="center" prop="place" width="150px"/>
+            <el-table-column label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
+            <el-table-column label="计划到货日期" align="center" prop="strageDate" width="150px"/>
+            <el-table-column label="运输方式" align="center" prop="transportation" width="150px"/>
+            <el-table-column label="备注" align="center" prop="remark" width="150px"/>
+            <el-table-column label="客户物料编码" align="center" prop="customerLogistic" width="150px"/>
+            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
 
@@ -245,30 +232,30 @@
             max-height="380"
             >
             <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-            <el-table-column label="产地" align="center" prop="originPlace"/>
-            <el-table-column label="类别" align="center" prop="classify"/>
+            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
             <!-- <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="productBatch"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-            <el-table-column label="注册证号" align="center" prop="registration"/>
-            <el-table-column label="商品名" align="center" prop="productCode"/>
-            <el-table-column label="通用名" align="center" prop="commonCode"/>
-            <el-table-column label="剂型" align="center" prop="drug"/>
+            <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
+            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
             <!-- <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="code"/> -->
             <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
             <!-- <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 label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
 
@@ -279,19 +266,19 @@
             max-height="380"
             >
             <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-            <el-table-column label="产地" align="center" prop="originPlace"/>
-            <el-table-column label="类别" align="center" prop="classify"/>
-            <el-table-column label="产品批号" align="center" prop="productBatch	"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode"/>
-            <el-table-column label="注册证号" align="center" prop="registration"/>
-            <el-table-column label="商品名" align="center" prop="productCode"/>
-            <el-table-column label="通用名" align="center" prop="commonCode"/>
-            <el-table-column label="剂型" align="center" prop="drug"/>
+            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
+            <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
+            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
             <!-- <el-table-column label="已调出主数量" align="center" prop="code"/>
             <el-table-column label="已调入主数量" align="center" prop="code"/> -->
             <!-- <el-table-column label="调拨在途主数量" align="center" prop="code"/> -->
@@ -300,8 +287,8 @@
             <!-- <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="customerLogistic"/>
-            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName"/>
+            <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
         </el-tabs>
@@ -309,18 +296,22 @@
     </div>
 
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>
 </template>
 
 <script>
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+import Refers from '@/components/Refers/refers.vue'
 import {getOrderList, delOrder} from '@/api/purchase/transferOrder.js'
 export default {
   name: 'transferOrder',
+  dicts: ['sys_allot_billtype'],
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers
   },
   data() {
     return {
@@ -330,20 +321,25 @@ export default {
       // 页面状态
       page: '',
       queryParams: {
-        dckczz: '',
+        deliveryInventoryOrg: '',
         billDate: '',
-        jylx: '',
-        chkczz: '',
-        code: '',
+        billType: '',
         storageInventoryOrg: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
+      },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: '',
       },
       options: [{
         value: '1', label: '是',
       }, {
         value: '0', label: '否'
       }],
+      chuOrgOptions: [],
+      ruOrgOptions: [],
       tableList: [],
       total: 0,
       materialInfo: [],
@@ -359,6 +355,20 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        deliveryInventoryOrg: '',
+        billDate: '',
+        billType: '',
+        storageInventoryOrg: '',
+        pageNum: 1,
+        pageSize: 5
+      }
+      this.getList(this.queryParams)
+    },
     getList(params){
       getOrderList(params).then(res => {
         if (res.code === 200) {
@@ -414,7 +424,23 @@ 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.title == '调出库存组织') {
+        this.chuOrgOptions = selection
+        this.queryParams.deliveryInventoryOrg = selection[0].id
+      }
+      if (this.referCondition.title == '调入库存组织') {
+        this.ruOrgOptions = selection
+        this.queryParams.storageInventoryOrg = selection[0].id
+      }
+    },
   }
 
 }