Pārlūkot izejas kodu

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!56
黄梓星 2 gadi atpakaļ
vecāks
revīzija
a00f7b1f44

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

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

+ 2 - 2
src/components/Refers/batchRefer.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();
     },
     // 表格选中数据

+ 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 - 200
src/components/popover-select/components/index.vue

@@ -1,200 +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) {
-        //
-      } 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) {
-      const { multiple } = this.$props;
-      if (multiple) {
-        [row].forEach((row) => {
-          this.$refs.multipleTable.toggleRowSelection(row);
-        });
-      } else {
-        this.multipleSelection = [row];
-      }
-    },
-    // double click select row data and confirm
-    handleDoubleClickSelect(row) {
-      this.confirm([row]);
-    },
-    // multiple select row data
-    handleMultipleSelect(prop) {
-      const { multiple } = this.$props;
-      if (multiple) {
-        this.multipleSelection = prop;
-      }
-    },
-    // confirm
-    confirm(prop) {
-      this.setVisible(false);
-      this.$emit("confirm", prop);
-    },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-dialog
-    :title="title"
-    :width="width"
-    :visible.sync="visible"
-    :close-on-click-modal="false"
-    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
-      ref="multipleTable"
-      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>

+ 242 - 89
src/components/popover-select/index.vue

@@ -1,4 +1,5 @@
 <script>
+import { refer } from "./api/index";
 export default {
   name: "PopoverSelect",
   props: {
@@ -15,16 +16,16 @@ export default {
     // 参照弹窗标题
     title: {
       type: String,
-      default: "TITLE",
+      dafault: () => {
+        return "TITEL";
+      },
     },
     // 作为 value 唯一标识的键名,绑定值
     valueKey: {
       type: String,
-      default: "name",
-    },
-    // 作为 value 唯一标识的键名,显示值
-    showKey: {
-      type: String,
+      dafault: () => {
+        return "code";
+      },
     },
     showKey: {
       type: String,
@@ -38,144 +39,298 @@ 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: "",
-      // 选中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: {
-    showValue() {
-      const { showKey, valueKey } = this.$props;
-      return this.data.length === 1 ? this.data[0][showKey || valueKey] : "";
+    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 = [];
-        }
+      handler: function (newProp) {
+        if (!newProp) this.selectData = [];
       },
       immediate: true,
     },
   },
   methods: {
-    // 打开弹窗
-    handleAsyncOpenDialog() {
-      this.$nextTick(() => {
-        const { setVisible } = this.$refs.TableDialog;
-        setVisible(true);
-      });
-    },
-    // 新增操作
-    handleAdd(prop) {
-      this.data = prop;
-      this.handleUpdate(this.data);
-    },
-    // 删除操作
-    handleDelete(prop) {
-      this.data.splice(prop, 1);
-      this.handleUpdate(this.data);
-    },
-    // 更新操作
-    handleUpdate(prop) {
-      const { source, multiple, valueKey, dataMapping } = this.$props;
-      console.log(this.$props, 'this.$props');
-      // 多选
-      if (multiple) {
-        const updateData = prop.map((item) => item[valueKey]);
-        this.$emit("input", updateData);
+    // 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) {
-        const updateData = prop[0][valueKey];
-        this.$emit("input", updateData);
-        // 更新映射数据
-        for (let key in dataMapping) {
-          source[key] = prop[0][dataMapping[key]];
-          console.log(source[key]);
-          console.log(prop[0][dataMapping[key]]);
-        }
-        console.log("prop", prop, source, this.$props);
-        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;
-    });
-  },
-  mounted() { },
-  destroyed() { },
+  created() {},
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
-  <div ref="PopoverSelect" style="position: relative">
-    <el-input v-model="showValue" :size="size" :disabled="disabled" :clearable="clearable" :placeholder="placeholder"
-      readonly style="width: 100%; cursor: pointer" @click.native.stop="handleAsyncOpenDialog">
-      <template #suffix>
-        <el-icon class="el-icon-more"></el-icon>
-      </template>
+  <div>
+    <el-input
+      v-model="innerValue"
+      :size="size"
+      :disabled="disabled"
+      :readonly="readonly"
+      :clearable="clearable"
+      :placeholder="placeholder"
+    >
+      <el-button
+        :disabled="disabled"
+        slot="append"
+        icon="el-icon-search"
+        @click="show()"
+      ></el-button>
     </el-input>
-    <div style="
+    <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
+      style="
         position: absolute;
         left: 10px;
         top: 50%;
         transform: translateY(-50%);
         padding-right: 30px;
         overflow: hidden;
-      ">
-      <div v-if="multiple && data.length > 1">
-        <el-popover :offset="-10" :width="width" :visible-arrow="false" title="" content="" trigger="click"
-          placement="bottom-start">
+      "
+    >
+      <div v-if="multiple && selectData.length">
+        <el-popover
+          :offset="-10"
+          :width="width"
+          :visible-arrow="false"
+          title=""
+          content=""
+          trigger="click"
+          placement="bottom-start"
+        >
           <el-tag slot="reference" :size="size" style="margin-right: 10px">
-            + {{ data.length }}
+            + {{ selectData.length }}
           </el-tag>
           <el-tag
-            v-for="(item, index) in data"
+            v-for="(tag, index) in selectData"
             :size="size"
             hit
             closable
@@ -183,17 +338,15 @@ export default {
               display: 'flex',
               justifyContent: 'space-between',
               alignItems: 'center',
-              margin: data.length - 1 === index ? '0' : '0 0 5px 0',
+              margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
             }"
-            @close="handleDelete(index)"
+            @close="deleteTag(index)"
           >
-            {{ item[showKey || valueKey] }}
+            {{ tag.name }}
           </el-tag>
         </el-popover>
       </div>
     </div>
-    <table-dialog v-model="data" ref="TableDialog" :type="type" :title="title" :multiple="multiple"
-      :queryParams="queryParams" @confirm="handleAdd"></table-dialog>
   </div>
 </template>
 <style scoped></style>

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

@@ -107,7 +107,7 @@ export default {
 </script>
 <template>
   <el-dialog
-    :title="title"
+    :title="`${title}(${multiple ? '多选' : '单选'})`"
     :width="width"
     :visible.sync="visible"
     :close-on-click-modal="false"

+ 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: '',

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

@@ -319,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

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

+ 50 - 33
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;
@@ -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,7 +68,7 @@ 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 });
         }
@@ -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"

+ 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: '',

+ 12 - 13
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: "需求人名称",
@@ -156,6 +156,12 @@ export const SearchColumns = [
     queryParams: () => ({}),
   },
   {
+    key: "status",
+    title: "状态",
+    inputType: "Select",
+    referName: "purchase_task_status",
+  },
+  {
     key: "date",
     title: "创建时间",
     inputType: "DatePicker",
@@ -174,22 +180,15 @@ export const SearchColumns = [
     inputType: "PopoverSelect",
     multiple: true,
     valueKey: "id",
-    showKey: "name",
     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: "请输入来源单据号,多个用,分隔",
-  // },
 ];

+ 6 - 2
src/views/purchase/task/documents-return/index.vue

@@ -30,8 +30,8 @@ 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 });
         }
@@ -41,6 +41,10 @@ export default {
         this.loading = false;
       }
     },
+    hide() {
+      this.params.baskCause = "";
+      this.params.documentIds = [];
+    },
   },
   created() {},
   mounted() {},
@@ -49,7 +53,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog :visible.sync="visible" title="请购退回">
+  <el-dialog :visible.sync="visible" title="退回需求" @close="hide">
     <el-alert
       title="请填写退单原因"
       type="info"

+ 103 - 68
src/views/purchase/task/index.vue

@@ -71,10 +71,10 @@ export default {
       this.fetchList({ ...prop, date: undefined }, page);
     },
     // 重置操作
-    handleResetList(prop, page) {
+    handleResetList() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.handleQueryList(prop, page);
+      this.handleQueryList(this.params, this.page);
     },
     // 页大小变
     handleSizeChange(prop) {
@@ -98,7 +98,7 @@ 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 });
         }
@@ -153,71 +153,102 @@ export default {
     <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" :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="6" :md="8" :sm="12" :xs="24">
-          <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"
-              :show-key="column.showKey"
-              :value-key="column.valueKey"
-              :placeholder="column.placeholder"
-              :data-mapping="column.dataMapping"
-              :query-params="column.queryParams(params)"
-            >
-            </dr-popover-select>
-          </el-form-item>
-          <el-form-item
-            v-if="column.inputType === 'PopoverTreeSelect'"
-            :prop="column.key"
-            :label="column.title"
+    <el-form
+      :size="size"
+      :inline="true"
+      :model="params"
+      label-width="75px"
+      label-position="right"
+      style="padding: 20px 20px 0"
+    >
+      <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-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"
-              :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-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-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">
@@ -227,7 +258,11 @@ export default {
         <el-button :size="size" :disabled="selectData.length !== 1" @click="handleModifyBuyer(selectData[0])">
           转 派
         </el-button>
-        <el-button :size="size" :disabled="!selectData.length" @click="handleDocumentsReturn(selectData)">
+        <el-button
+          :size="size"
+          :disabled="!selectData.length"
+          @click="handleDocumentsReturn(selectData)"
+        >
           退回需求
         </el-button>
         <!-- <el-button

+ 6 - 5
src/views/purchase/task/modify-buyer/index.vue

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

+ 2 - 2
src/views/purchase/transferOrder/add.vue

@@ -619,9 +619,9 @@ export default {
         warehouseCode: ''
       },
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
       tableIndex: null,
       chuOrgOptions: [],