Browse Source

申请单参照添加

黄梓星 2 years ago
parent
commit
ccdaa67851

+ 32 - 8
src/api/requisition/basic.js

@@ -39,11 +39,35 @@ export function delReq(id) {
   })
 }
 
-// 参照-四级分类
-// export function getMaterialClass(data) {
-//   return request({
-//     url: `/system/archival/queryMaterialClassify`,
-//     method: 'post',
-//     data: data
-//   })
-// }
+// 参照-计量单位
+export function getUnit(data) {
+  return request({
+    url: `/system/archival/queryUnit`,
+    method: 'post',
+    data: data
+  })
+}
+// 参照-产地
+export function getPlace(data) {
+  return request({
+    url: `/system/archival/queryOrigin`,
+    method: 'post',
+    data: data
+  })
+}
+// 参照-税类
+export function getTax(data) {
+  return request({
+    url: `/system/archival/queryTaxrate`,
+    method: 'post',
+    data: data
+  })
+}
+// 参照-采购员
+export function getStaff(data) {
+  return request({
+    url: `/system/archival/queryStaffInfo`,
+    method: 'post',
+    data: data
+  })
+}

+ 1 - 1
src/components/PopDialog/fourClass.vue

@@ -2,7 +2,7 @@
   <div>
     <el-dialog
       title="物料分类选择"
-      width="1000px"
+      width="500px"
       :close-on-click-modal="false"
       :append-to-body="true"
       v-dialogDrag

+ 269 - 0
src/components/PopDialog/place.vue

@@ -0,0 +1,269 @@
+<template>
+  <div>
+    <el-dialog
+      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="code">
+                <el-input
+                  size="small"
+                  v-model="searchForm.code"
+                  placeholder="编号"
+                  clearable
+                ></el-input>
+              </el-form-item>
+              <el-form-item prop="name">
+                <el-input
+                  size="small"
+                  v-model="searchForm.name"
+                  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"
+              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="left"
+                sortable="custom"
+                min-width="90"
+                label="id"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="name"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="90"
+                label="名称"
+              >
+              </el-table-column>
+              <!-- <el-table-column
+                prop="contractAmount"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="合同金额"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="oppositeCompany"
+                header-align="center"
+                align="center"
+                sortable="custom"
+                min-width="110"
+                label="对方单位"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="signDate"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="签订时间"
+              >
+              </el-table-column> -->
+            </el-table>
+            <el-pagination
+              @size-change="sizeChangeHandle"
+              @current-change="currentChangeHandle"
+              :current-page="pageNo"
+              :page-sizes="[5, 10, 15, 20]"
+              :page-size="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 { getPlace } from '@/api/requisition/basic'
+export default {
+  data() {
+    return {
+      searchForm: {
+        code: '',
+        name: ''
+      },
+      dataListAllSelections: [], // 所有选中的数据包含跨页数据
+      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+      dataList: [],
+      pageNo: 1,
+      pageSize: 10,
+      total: 0,
+      orders: [],
+      loading: false,
+      visible: false,
+    };
+  },
+  props: {
+    selectData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否启用单选
+    single: {
+      type: Boolean,
+      default: false
+    }
+  },
+  methods: {
+    init() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
+        this.resetSearch();
+      });
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      getPlace({
+        pageNo: 1,
+        size: this.pageSize
+      }).then(({ data }) => {
+        console.log('data',data)
+        this.dataList = data.tableBody;
+        this.total = data.tableBody.length;
+        this.pageNo = data.current;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.setSelectRow();
+        });
+      });
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      this.pageSize = val;
+      this.pageNo = 1;
+      this.refreshList();
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      this.pageNo = val;
+      this.refreshList();
+    },
+    // 排序
+    resetSearch() {
+      this.$refs.searchForm.resetFields();
+      this.refreshList();
+    },
+    // 选中数据
+    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>

+ 4 - 4
src/components/PopDialog/productFactory.vue

@@ -24,7 +24,7 @@
                 <el-input
                   size="small"
                   v-model="searchForm.code"
-                  placeholder="物料编号"
+                  placeholder="编号"
                   clearable
                 ></el-input>
               </el-form-item>
@@ -32,7 +32,7 @@
                 <el-input
                   size="small"
                   v-model="searchForm.name"
-                  placeholder="物料名称"
+                  placeholder="名称"
                   clearable
                 ></el-input>
               </el-form-item>
@@ -71,12 +71,12 @@
               >
               </el-table-column>
               <el-table-column
-                prop="code"
+                prop="id"
                 header-align="center"
                 align="left"
                 sortable="custom"
                 min-width="90"
-                label="code"
+                label="id"
               >
               </el-table-column>
               <el-table-column

+ 269 - 0
src/components/PopDialog/staff.vue

@@ -0,0 +1,269 @@
+<template>
+  <div>
+    <el-dialog
+      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="code">
+                <el-input
+                  size="small"
+                  v-model="searchForm.code"
+                  placeholder="编号"
+                  clearable
+                ></el-input>
+              </el-form-item>
+              <el-form-item prop="name">
+                <el-input
+                  size="small"
+                  v-model="searchForm.name"
+                  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"
+              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="left"
+                sortable="custom"
+                min-width="90"
+                label="id"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="name"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="90"
+                label="名称"
+              >
+              </el-table-column>
+              <!-- <el-table-column
+                prop="contractAmount"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="合同金额"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="oppositeCompany"
+                header-align="center"
+                align="center"
+                sortable="custom"
+                min-width="110"
+                label="对方单位"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="signDate"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="签订时间"
+              >
+              </el-table-column> -->
+            </el-table>
+            <el-pagination
+              @size-change="sizeChangeHandle"
+              @current-change="currentChangeHandle"
+              :current-page="pageNo"
+              :page-sizes="[5, 10, 15, 20]"
+              :page-size="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 { getStaff } from '@/api/requisition/basic'
+export default {
+  data() {
+    return {
+      searchForm: {
+        code: '',
+        name: ''
+      },
+      dataListAllSelections: [], // 所有选中的数据包含跨页数据
+      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+      dataList: [],
+      pageNo: 1,
+      pageSize: 10,
+      total: 0,
+      orders: [],
+      loading: false,
+      visible: false,
+    };
+  },
+  props: {
+    selectData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否启用单选
+    single: {
+      type: Boolean,
+      default: false
+    }
+  },
+  methods: {
+    init() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
+        this.resetSearch();
+      });
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      getStaff({
+        pageNo: 1,
+        size: this.pageSize
+      }).then(({ data }) => {
+        console.log('data',data)
+        this.dataList = data.tableBody;
+        this.total = data.tableBody.length;
+        this.pageNo = data.current;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.setSelectRow();
+        });
+      });
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      this.pageSize = val;
+      this.pageNo = 1;
+      this.refreshList();
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      this.pageNo = val;
+      this.refreshList();
+    },
+    // 排序
+    resetSearch() {
+      this.$refs.searchForm.resetFields();
+      this.refreshList();
+    },
+    // 选中数据
+    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>

+ 269 - 0
src/components/PopDialog/tax.vue

@@ -0,0 +1,269 @@
+<template>
+  <div>
+    <el-dialog
+      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="code">
+                <el-input
+                  size="small"
+                  v-model="searchForm.code"
+                  placeholder="编号"
+                  clearable
+                ></el-input>
+              </el-form-item>
+              <el-form-item prop="name">
+                <el-input
+                  size="small"
+                  v-model="searchForm.name"
+                  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"
+              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="left"
+                sortable="custom"
+                min-width="90"
+                label="id"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="name"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="90"
+                label="名称"
+              >
+              </el-table-column>
+              <!-- <el-table-column
+                prop="contractAmount"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="合同金额"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="oppositeCompany"
+                header-align="center"
+                align="center"
+                sortable="custom"
+                min-width="110"
+                label="对方单位"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="signDate"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="签订时间"
+              >
+              </el-table-column> -->
+            </el-table>
+            <el-pagination
+              @size-change="sizeChangeHandle"
+              @current-change="currentChangeHandle"
+              :current-page="pageNo"
+              :page-sizes="[5, 10, 15, 20]"
+              :page-size="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 { getTax } from '@/api/requisition/basic'
+export default {
+  data() {
+    return {
+      searchForm: {
+        code: '',
+        name: ''
+      },
+      dataListAllSelections: [], // 所有选中的数据包含跨页数据
+      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+      dataList: [],
+      pageNo: 1,
+      pageSize: 10,
+      total: 0,
+      orders: [],
+      loading: false,
+      visible: false,
+    };
+  },
+  props: {
+    selectData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否启用单选
+    single: {
+      type: Boolean,
+      default: false
+    }
+  },
+  methods: {
+    init() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
+        this.resetSearch();
+      });
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      getTax({
+        pageNo: 1,
+        size: this.pageSize
+      }).then(({ data }) => {
+        console.log('data',data)
+        this.dataList = data.tableBody;
+        this.total = data.tableBody.length;
+        this.pageNo = data.current;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.setSelectRow();
+        });
+      });
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      this.pageSize = val;
+      this.pageNo = 1;
+      this.refreshList();
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      this.pageNo = val;
+      this.refreshList();
+    },
+    // 排序
+    resetSearch() {
+      this.$refs.searchForm.resetFields();
+      this.refreshList();
+    },
+    // 选中数据
+    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>

+ 269 - 0
src/components/PopDialog/unit.vue

@@ -0,0 +1,269 @@
+<template>
+  <div>
+    <el-dialog
+      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="code">
+                <el-input
+                  size="small"
+                  v-model="searchForm.code"
+                  placeholder="编号"
+                  clearable
+                ></el-input>
+              </el-form-item>
+              <el-form-item prop="name">
+                <el-input
+                  size="small"
+                  v-model="searchForm.name"
+                  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"
+              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="code"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="90"
+                label="code"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="name"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="90"
+                label="名称"
+              >
+              </el-table-column>
+              <!-- <el-table-column
+                prop="contractAmount"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="合同金额"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="oppositeCompany"
+                header-align="center"
+                align="center"
+                sortable="custom"
+                min-width="110"
+                label="对方单位"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="signDate"
+                header-align="center"
+                align="left"
+                sortable="custom"
+                min-width="110"
+                label="签订时间"
+              >
+              </el-table-column> -->
+            </el-table>
+            <el-pagination
+              @size-change="sizeChangeHandle"
+              @current-change="currentChangeHandle"
+              :current-page="pageNo"
+              :page-sizes="[5, 10, 15, 20]"
+              :page-size="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 { getUnit } from '@/api/requisition/basic'
+export default {
+  data() {
+    return {
+      searchForm: {
+        code: '',
+        name: ''
+      },
+      dataListAllSelections: [], // 所有选中的数据包含跨页数据
+      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+      dataList: [],
+      pageNo: 1,
+      pageSize: 10,
+      total: 0,
+      orders: [],
+      loading: false,
+      visible: false,
+    };
+  },
+  props: {
+    selectData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否启用单选
+    single: {
+      type: Boolean,
+      default: false
+    }
+  },
+  methods: {
+    init() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
+        this.resetSearch();
+      });
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      getUnit({
+        pageNo: 1,
+        size: this.pageSize
+      }).then(({ data }) => {
+        console.log('data',data)
+        this.dataList = data.tableBody;
+        this.total = data.tableBody.length;
+        this.pageNo = data.current;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.setSelectRow();
+        });
+      });
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      this.pageSize = val;
+      this.pageNo = 1;
+      this.refreshList();
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      this.pageNo = val;
+      this.refreshList();
+    },
+    // 排序
+    resetSearch() {
+      this.$refs.searchForm.resetFields();
+      this.refreshList();
+    },
+    // 选中数据
+    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>

+ 294 - 33
src/views/material/requisition/add.vue

@@ -91,16 +91,44 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="计量单位" prop="unitId">
-                <el-input :disabled="disable" v-model="basicForm.unitId">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
-                </el-input>
+                <el-select
+                    ref="units"
+                    v-model="basicForm.unitId"
+                    placeholder="计量单位"
+                    :disabled="disable"
+                    @focus="chooseUnit"
+                  >
+                    <el-option
+                      v-for="item in unitOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    />
+                </el-select>
+                <!-- <el-input :disabled="disable" v-model="basicForm.unitId">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseUnit"></el-button>
+                </el-input> -->
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="生产厂家/代理人" prop="manufacturerId">
-                <el-input :disabled="disable" v-model="basicForm.manufacturerId">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
-                </el-input>
+                <el-select
+                    ref="factoryOrman"
+                    v-model="basicForm.manufacturerId"
+                    placeholder="生产厂家/代理人"
+                    :disabled="disable"
+                    @focus="chooseFactory"
+                  >
+                    <el-option
+                      v-for="item in factoryOptions"
+                      :key="item.id"
+                      :label="item.manufactureName"
+                      :value="item.id"
+                    />
+                </el-select>
+                <!-- <el-input :disabled="disable" v-model="basicForm.manufacturerId">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseFactory"></el-button>
+                </el-input> -->
               </el-form-item>
             </el-col>
           </el-row>
@@ -112,9 +140,23 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="产地" prop="originPlace">
-                <el-input :disabled="disable" v-model="basicForm.originPlace">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
-                </el-input>
+                <el-select
+                    ref="places"
+                    v-model="basicForm.originPlace"
+                    placeholder="产地"
+                    :disabled="disable"
+                    @focus="choosePlace"
+                  >
+                    <el-option
+                      v-for="item in placeOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    />
+                </el-select>
+                <!-- <el-input :disabled="disable" v-model="basicForm.originPlace">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
+                </el-input> -->
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -307,9 +349,23 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="物料税类" prop="materialRate">
-                <el-input :disabled="disable" v-model="basicForm.materialRate">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
-                </el-input>
+                <el-select
+                    ref="taxs"
+                    v-model="basicForm.materialRate"
+                    placeholder="物料税类"
+                    :disabled="disable"
+                    @focus="chooseTax"
+                  >
+                    <el-option
+                      v-for="item in taxOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    />
+                </el-select>
+                <!-- <el-input :disabled="disable" v-model="basicForm.materialRate">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
+                </el-input> -->
               </el-form-item>
             </el-col>
           </el-row>
@@ -333,9 +389,23 @@
           <el-row :gutter="20">
             <el-col :span="8">
               <el-form-item label="采购员" prop="puPersonnelId">
-                <el-input :disabled="disable" v-model="basicForm.puPersonnelId">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
-                </el-input>
+                <el-select
+                    ref="staffs"
+                    v-model="basicForm.puPersonnelId"
+                    placeholder="采购员"
+                    :disabled="disable"
+                    @focus="chooseStaff"
+                  >
+                    <el-option
+                      v-for="item in staffOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.code"
+                    />
+                </el-select>
+                <!-- <el-input :disabled="disable" v-model="basicForm.puPersonnelId">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
+                </el-input> -->
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -380,7 +450,7 @@
             <el-col :span="8">
               <el-form-item label="业务线" prop="businessLine">
                 <el-input :disabled="disable" v-model="basicForm.businessLine">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
                 </el-input>
               </el-form-item>
             </el-col>
@@ -509,7 +579,7 @@
             <el-col :span="8">
               <el-form-item label="剂型" prop="dosageFrom">
                 <el-input :disabled="disable" v-model="basicForm2.dosageFrom">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
                 </el-input>
               </el-form-item>
             </el-col>
@@ -663,8 +733,8 @@
     />
 
     <factory
-      ref="contractSelect2"
-      @doSubmit="selectionsToInput2"
+      ref="factory"
+      @doSubmit="acceptFactory"
       :selectData="selectData2"
       :single="true"
     />
@@ -676,7 +746,33 @@
       :single="true"
     />
 
+    <unit
+      ref="unit"
+      @doSubmit="acceptUnit"
+      :selectData="selectData4"
+      :single="true"
+    />
 
+    <place
+      ref="place"
+      @doSubmit="acceptPlace"
+      :selectData="selectData5"
+      :single="true"
+    />
+
+    <tax
+      ref="tax"
+      @doSubmit="acceptTax"
+      :selectData="selectData6"
+      :single="true"
+    />
+
+    <staff
+      ref="staff"
+      @doSubmit="acceptStaff"
+      :selectData="selectData7"
+      :single="true"
+    />
   </div>
 </template>
 
@@ -684,16 +780,29 @@
 import popDialog from '@/components/PopDialog/index.vue'
 import factory from '@/components/PopDialog/productFactory.vue'
 import fourClass from '@/components/PopDialog/fourClass.vue'
+import unit from '@/components/PopDialog/unit.vue'
+import place from '@/components/PopDialog/place.vue'
+import tax from '@/components/PopDialog/tax.vue'
+import staff from '@/components/PopDialog/staff.vue'
 import { addReq, getReqDetail, editReq } from '@/api/requisition/basic'
 // 调用物料分类详情接口用于数据回显
 import { getDetail } from '@/api/classify/basic';
+// 生产厂商/代理人调用用于回显
+import { getProductFactory } from '@/api/changeApply/basic'
+// 计量单位,产地调用用于回显
+import { getUnit, getPlace, getTax, getStaff} from '@/api/requisition/basic'
+
 export default {
   name: 'requisition_add',
   dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
   components: {
     popDialog,
     factory,
-    fourClass
+    fourClass,
+    unit,
+    place,
+    tax,
+    staff
   },
   props: ['pageStu', 'row', 'disable'],
   model: {
@@ -703,6 +812,11 @@ export default {
   data() {
     return{
       testOptions: [],
+      factoryOptions: [],
+      unitOptions: [],
+      placeOptions: [],
+      taxOptions: [],
+      staffOptions: [],
       tabValue: 'first',
       basicForm: {
         billCode: '',
@@ -802,6 +916,10 @@ export default {
       selectData: [],
       selectData2: [],
       selectData3: [],
+      selectData4: [],
+      selectData5: [],
+      selectData6: [],
+      selectData7: []
     }
   },
   // watch: {
@@ -838,14 +956,58 @@ export default {
         console.log('数据', this.row)
         this.getDetails(this.row)
         // 获取树形详情
-        this.getTreeDetails(this.row.classifyId)
+        if (this.row.classifyId) {
+          this.getTreeDetails(this.row.classifyId)
+        }
+        // 生产厂家代理人用于回显
+        if (this.row.manufacturerId) {
+          this.getFactoryDetails(this.row.manufacturerId)
+        }
+        // 计量单位回显
+        if (this.row.unitId) {
+          this.getUnitDetails(this.row.unitId)
+        }
+        // 产地回显
+        if (this.row.originPlace) {
+          this.getPlaceDetails(this.row.originPlace)
+        }
+        // 物料税类回显
+        if (this.row.materialRate) {
+          this.getTaxDetails(this.row.materialRate)
+        }
+        // 物料税类回显
+        if (this.row.puPersonnelId) {
+          this.getStaffDetails(this.row.puPersonnelId)
+        }
       } else if (this.pageStu == 'edit') {
         // alert('修改页面')
         console.log('页面状态',this.pageStu)
         console.log('数据', this.row)
         this.getDetails(this.row)
         // 获取树形详情
-        this.getTreeDetails(this.row.classifyId)
+        if (this.row.classifyId) {
+          this.getTreeDetails(this.row.classifyId)
+        }
+        // 生产厂家代理人用于回显
+        if (this.row.manufacturerId) {
+          this.getFactoryDetails(this.row.manufacturerId)
+        }
+        // 计量单位回显
+        if (this.row.unitId) {
+          this.getUnitDetails(this.row.unitId)
+        }
+        // 产地回显
+        if (this.row.originPlace) {
+          this.getPlaceDetails(this.row.originPlace)
+        }
+        // 物料税类回显
+        if (this.row.materialRate) {
+          this.getTaxDetails(this.row.materialRate)
+        }
+        // 物料税类回显
+        if (this.row.puPersonnelId) {
+          this.getStaffDetails(this.row.puPersonnelId)
+        }
       } else if(this.pageStu == 'add') {
         // alert('新增页面')
         console.log('页面状态',this.pageStu)
@@ -868,12 +1030,61 @@ export default {
         }
       })
     },
+    // 生产厂家/代理人用于回显
+    getFactoryDetails(id) {
+       getProductFactory({id:id}).then(res => {
+        if(res.code === 200) {
+          this.factoryOptions = res.data.tableBody
+        }
+       })
+    },
+    // 计量单位回显
+    getUnitDetails(id) {
+      getUnit({id:id}).then(res => {
+        console.log('计量单位回显', res)
+        if (res.code === 200 ) {
+          this.unitOptions = res.data.tableBody
+          console.log('1111',this.unitOptions)
+        }
+      })
+    },
+    // 产地回显
+    getPlaceDetails(id) {
+      getPlace({id:id}).then(res => {
+        console.log('产地', res)
+        if (res.code === 200 ) {
+          this.placeOptions = res.data.tableBody
+        }
+      })
+    },
+    // 物料税类回显
+    getTaxDetails(id) {
+      getTax({id:id}).then(res => {
+        console.log('物料税类', res)
+        if (res.code === 200 ) {
+          this.taxOptions = res.data.tableBody
+        }
+      })
+    },
+    // 采购员回显
+    getStaffDetails(id) {
+      getStaff({id:id}).then(res => {
+        console.log('采购员', res)
+        if (res.code === 200 ) {
+          this.staffOptions = res.data.tableBody
+        }
+      })
+    },
     // 如果是详情进入,则调用详情接口
     getDetails(row) {
       getReqDetail(row.id).then(res => {
         console.log('res',res)
         if(res.code === 200) {
           this.basicForm = res.data
+          if(res.data.unitId) {
+            this.basicForm.unitId = res.data.unitId.toString()
+            this.basicForm.manufacturerId = res.data.manufacturerId.toString()
+          }
           if(res.data.sysMaterialMedcineApply) {
             this.basicForm2 = res.data.sysMaterialMedcineApply
           }
@@ -1002,10 +1213,23 @@ export default {
         }
       })
     },
-    selectionsToInput2 (selections) {
+    test01() {
+      console.log('测试点击')
+      this.$refs.contractSelect.init()
+    },
+    // 选择生产厂家/代理人
+    acceptFactory (selections) {
       console.log('选择的数据',selections)
-      this.basicForm.manufacturerId = selections[0].code
+      this.factoryOptions = selections
+      this.basicForm.manufacturerId = selections[0].id
+      this.getFactoryDetails(selections[0].id)
     },
+    // 生产厂家/代理人显示列表
+    chooseFactory() {
+      this.$refs.factoryOrman.blur()
+      this.$refs.factory.init()
+    },
+    // 选择四级分类
     acceptFourClass (selections) {
       console.log('父组件收到的数据',selections)
       this.testOptions.push(selections)
@@ -1013,20 +1237,57 @@ export default {
       this.basicForm.classifyId = selections.id
       this.getTreeDetails(selections.id)
     },
+    // 四级分类显示列表
     chooseFourClass() {
-      console.log('1111')
       this.$refs.fourTag.blur()
       this.$refs.fourClass.init()
     },
-    // 显示列表
-    test01() {
-      console.log('测试点击')
-      this.$refs.contractSelect.init()
+    // 选择计量单位
+    acceptUnit (selections) {
+      console.log('父组件收到的数据',selections)
+      this.unitOptions = selections
+      console.log('绑定的数组',this.unitOptions)
+      this.basicForm.unitId = selections[0].id
+      this.getUnitDetails(selections[0].id)
+    },
+    // 计量单位显示列表
+    chooseUnit () {
+      this.$refs.units.blur()
+      this.$refs.unit.init()
+    },
+    // 选择产地
+    acceptPlace (selections) {
+      this.placeOptions = selections
+      this.basicForm.originPlace = selections[0].id
+      this.getPlaceDetails(selections[0].id)
+    },
+    // 产地显示列表
+    choosePlace () {
+      this.$refs.places.blur()
+      this.$refs.place.init()
+    },
+    // 选择物料税类
+    acceptTax (selections) {
+      this.taxOptions = selections
+      this.basicForm.materialRate = selections[0].id
+      this.getTaxDetails(selections[0].id)
+    },
+    // 物料税类显示列表
+    chooseTax () {
+      this.$refs.taxs.blur()
+      this.$refs.tax.init()
+    },
+    // 选择采购员
+    acceptStaff (selections) {
+      this.staffOptions = selections
+      this.basicForm.puPersonnelId = selections[0].code
+      this.getStaffDetails(selections[0].id)
+    },
+    // 采购员显示列表
+    chooseStaff () {
+      this.$refs.staffs.blur()
+      this.$refs.staff.init()
     },
-    test02() {
-      console.log('测试弹窗2');
-      this.$refs.contractSelect2.init()
-    }
   }
 }
 </script>

+ 0 - 4
src/views/material/requisition/index.vue

@@ -74,15 +74,11 @@
         <el-table-column label="序号" align="center" prop="sort" />
         <el-table-column label="申请组织" align="center" prop="orgId" />
         <el-table-column label="单据编码" align="center" width="200" prop="code" />
-        <el-table-column label="目的组织" align="center" prop="orgId" />
         <el-table-column label="申请人" align="center" prop="createBy" />
         <el-table-column label="申请时间" align="center" width="150" prop="applicationTime" />
         <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug" />
-        <el-table-column label="启用状态" align="center" prop="status" />
         <el-table-column label="物料编码" align="center" width="150" prop="materialCode" />
         <el-table-column label="物料名称" align="center" prop="materialName" />
-        <el-table-column label="最后审批人" align="center" width="120" prop="approver" />
-        <el-table-column label="最后审核时间" align="center" width="150" prop="approvalTime" />
         <el-table-column label="创建人" align="center" prop="createBy" />
         <el-table-column label="创建时间" align="center" width="150" prop="createTime" />
         <el-table-column label="最后修改人" align="center" width="120" prop="updateBy" />