Bläddra i källkod

联调查询列表接口、详情接口;
新增货位、客户、仓库参照弹窗;
为新增页面参照弹窗项进行配置

002390 2 år sedan
förälder
incheckning
95643c7ede

+ 11 - 12
src/api/business/purchase/purchase-order.js

@@ -3,16 +3,16 @@ import request from "@/utils/request";
 // 采购订单修订列表
 const orderList = (data) => {
   return request({
-    url: `/pu/order`,
+    url: `/pu/order/list`,
     method: "post",
     data,
   });
 }
 
 // 采购订单详情
-const orderDetails = (params) => {
+const orderDetails = (id, params) => {
   return request({
-    url: `/pu/order/${params.id}`,
+    url: `/pu/order/${id}`,
     method: "get",
     params,
   });
@@ -27,17 +27,16 @@ const orderCreate = (data) => {
   });
 }
 
-// 参照查询
-const referQuery = (data) => {
-  return request({
-    url: `/refer/query`,
-    method: "post",
-    data,
-  });
-}
+// // 参照查询
+// const referQuery = (data) => {
+//   return request({
+//     url: `/refer/query`,
+//     method: "post",
+//     data,
+//   });
+// }
 
 export default {
-  referQuery,
   orderList,
   orderDetails,
   orderCreate,

+ 172 - 0
src/views/common-dialog/allocation.vue

@@ -0,0 +1,172 @@
+<!-- 货位 -->
+<script>
+import { list, refer } from "./api/index";
+import { initParams } from "@/utils/init-something";
+
+export default {
+  name: "AllocationInputDialog",
+  props: ["title", "value"],
+  components: {},
+  data() {
+    // tree
+    const columns = [
+      // {
+      //   key: "deptId",
+      //   title: "仓库编码",
+      //   type: "Input",
+      //   search: true,
+      // },
+      // {
+      //   key: "deptName",
+      //   title: "仓库名称",
+      //   type: "Input",
+      //   search: true,
+      // },
+    ];
+    const initTableColumns = () => columns.filter((column) => column.key);
+    const initSearchColumns = () => columns.filter((column) => column.search);
+    return {
+      // global
+      size: "mini",
+      width: "50%",
+      page: { pageNum: 1, pageSize: 25, total: 0 },
+      pageSizes: [25, 50],
+      layout: "prev, pager, next, jumper",
+      api: "puOrg",
+      showKey: "deptName",
+      // dialog
+      visible: false,
+      loading: false,
+      // search
+      searchColumns: initSearchColumns(),
+      params: initParams(initSearchColumns()),
+      // table
+      tableColumns: initTableColumns(),
+      data: [],
+      currentData: null,
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    // set dialog visible
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // do something before dialog open
+    beforeOpen() {
+      const { value } = this.$props;
+      this.params[this.showKey] = value;
+      this.fetchList(this.params, this.page);
+    },
+    // fetch table data
+    async fetchList(prop, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await refer({
+          pageNum,
+          pageSize,
+          isPage: true,
+          type: "ALLOCATION_PARAM",
+        });
+        // const { code, msg, rows, total } = await list(this.api, {
+        //   ...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) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+        this.setCurrentData(
+          this.data.find(
+            (column) => column[this.showKey] === this.currentData[this.showKey]
+          )
+        );
+      }
+    },
+    // 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 = initParams(this.searchColumns);
+      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);
+    },
+    // select row data
+    selectCurrentData(row) {
+      this.currentData = row;
+    },
+    // set row data highlight
+    setCurrentData(row) {
+      this.$refs.singleTable.setCurrentRow(row);
+    },
+    //
+    confirm() {
+      if (this.currentData) {
+        this.$emit("confirm", this.currentData);
+      }
+      this.setVisible(false);
+    },
+  },
+  created() { },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-dialog :title="title" :visible.sync="visible" :width="width" append-to-body @open="beforeOpen">
+    <el-form :size="size" :inline="true" :model="params">
+      <el-form-item v-for="(column, index) in searchColumns" :key="index" :label="column.title">
+        <el-input v-model="params[column.key]" @change="queryList"> </el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-refresh" @click="resetList"></el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="data" :size="size" ref="singleTable" height="45vh" highlight-current-row
+      style="width: 100%; margin-bottom: 20px" @row-click="selectCurrentData">
+      <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">
+      <p>
+        <span style="font-size: 12px">已选择 :</span>
+        <el-tag v-if="currentData" :size="size">{{
+          currentData[showKey]
+        }}</el-tag>
+        <span v-else>无</span>
+      </p>
+      <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">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+<style scoped></style>

+ 1 - 1
src/views/common-dialog/api/index.js

@@ -10,7 +10,7 @@ export function list(url, params) {
 
 export function refer(data) {
   return request({
-    url: `/refer/query`,
+    url: `/refer/query?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
     method: "POST",
     data: data,
   });

+ 171 - 0
src/views/common-dialog/customer.vue

@@ -0,0 +1,171 @@
+<!-- 客户 -->
+<script>
+import { list, refer } from "./api/index";
+import { initParams } from "@/utils/init-something";
+
+export default {
+  name: "CustomerInputDialog",
+  props: ["title", "value"],
+  components: {},
+  data() {
+    const columns = [
+      {
+        key: "deptId",
+        title: "客户编码",
+        type: "Input",
+        search: true,
+      },
+      {
+        key: "deptName",
+        title: "客户名称",
+        type: "Input",
+        search: true,
+      },
+    ];
+    const initTableColumns = () => columns.filter((column) => column.key);
+    const initSearchColumns = () => columns.filter((column) => column.search);
+    return {
+      // global
+      size: "mini",
+      width: "50%",
+      page: { pageNum: 1, pageSize: 25, total: 0 },
+      pageSizes: [25, 50],
+      layout: "prev, pager, next, jumper",
+      api: "puOrg",
+      showKey: "deptName",
+      // dialog
+      visible: false,
+      loading: false,
+      // search
+      searchColumns: initSearchColumns(),
+      params: initParams(initSearchColumns()),
+      // table
+      tableColumns: initTableColumns(),
+      data: [],
+      currentData: null,
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    // set dialog visible
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // do something before dialog open
+    beforeOpen() {
+      const { value } = this.$props;
+      this.params[this.showKey] = value;
+      this.fetchList(this.params, this.page);
+    },
+    // fetch table data
+    async fetchList(prop, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await refer({
+          pageNum,
+          pageSize,
+          isPage: true,
+          type: "CUSTOMER_PARAM",
+        });
+        // const { code, msg, rows, total } = await list(this.api, {
+        //   ...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) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+        this.setCurrentData(
+          this.data.find(
+            (column) => column[this.showKey] === this.currentData[this.showKey]
+          )
+        );
+      }
+    },
+    // 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 = initParams(this.searchColumns);
+      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);
+    },
+    // select row data
+    selectCurrentData(row) {
+      this.currentData = row;
+    },
+    // set row data highlight
+    setCurrentData(row) {
+      this.$refs.singleTable.setCurrentRow(row);
+    },
+    //
+    confirm() {
+      if (this.currentData) {
+        this.$emit("confirm", this.currentData);
+      }
+      this.setVisible(false);
+    },
+  },
+  created() { },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-dialog :title="title" :visible.sync="visible" :width="width" append-to-body @open="beforeOpen">
+    <el-form :size="size" :inline="true" :model="params">
+      <el-form-item v-for="(column, index) in searchColumns" :key="index" :label="column.title">
+        <el-input v-model="params[column.key]" @change="queryList"> </el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-refresh" @click="resetList"></el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="data" :size="size" ref="singleTable" height="45vh" highlight-current-row
+      style="width: 100%; margin-bottom: 20px" @row-click="selectCurrentData">
+      <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">
+      <p>
+        <span style="font-size: 12px">已选择 :</span>
+        <el-tag v-if="currentData" :size="size">{{
+          currentData[showKey]
+        }}</el-tag>
+        <span v-else>无</span>
+      </p>
+      <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">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+<style scoped></style>

+ 14 - 1
src/views/common-dialog/index.js

@@ -10,6 +10,13 @@ import supplier from "./supplier.vue";
 import tax from "./tax.vue";
 // 币种
 import currency from "./currency.vue";
+// 客户
+import customer from './customer.vue';
+// 仓库
+import warehouse from './warehouse.vue';
+// 货位
+import allocation from './allocation.vue';
+
 
 export const User = user;
 export const Organization = organization;
@@ -17,4 +24,10 @@ export const Department = department;
 export const Supplier = supplier;
 export const Tax = tax;
 export const Currency = currency;
-export default { Tax, User, Supplier, Currency, Department, Organization };
+export const Customer = customer;
+export const Warehouse = warehouse;
+export const Allocation = allocation;
+export default {
+  Tax, User, Supplier, Currency, Department, Organization,
+  Customer, Warehouse,Allocation
+};

+ 171 - 0
src/views/common-dialog/warehouse.vue

@@ -0,0 +1,171 @@
+<!-- 仓库 -->
+<script>
+import { list, refer } from "./api/index";
+import { initParams } from "@/utils/init-something";
+
+export default {
+  name: "WarehouseInputDialog",
+  props: ["title", "value"],
+  components: {},
+  data() {
+    const columns = [
+      {
+        key: "deptId",
+        title: "仓库编码",
+        type: "Input",
+        search: true,
+      },
+      {
+        key: "deptName",
+        title: "仓库名称",
+        type: "Input",
+        search: true,
+      },
+    ];
+    const initTableColumns = () => columns.filter((column) => column.key);
+    const initSearchColumns = () => columns.filter((column) => column.search);
+    return {
+      // global
+      size: "mini",
+      width: "50%",
+      page: { pageNum: 1, pageSize: 25, total: 0 },
+      pageSizes: [25, 50],
+      layout: "prev, pager, next, jumper",
+      api: "puOrg",
+      showKey: "deptName",
+      // dialog
+      visible: false,
+      loading: false,
+      // search
+      searchColumns: initSearchColumns(),
+      params: initParams(initSearchColumns()),
+      // table
+      tableColumns: initTableColumns(),
+      data: [],
+      currentData: null,
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    // set dialog visible
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // do something before dialog open
+    beforeOpen() {
+      const { value } = this.$props;
+      this.params[this.showKey] = value;
+      this.fetchList(this.params, this.page);
+    },
+    // fetch table data
+    async fetchList(prop, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await refer({
+          pageNum,
+          pageSize,
+          isPage: true,
+          type: "WAREHOUSE_PARAM",
+        });
+        // const { code, msg, rows, total } = await list(this.api, {
+        //   ...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) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+        this.setCurrentData(
+          this.data.find(
+            (column) => column[this.showKey] === this.currentData[this.showKey]
+          )
+        );
+      }
+    },
+    // 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 = initParams(this.searchColumns);
+      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);
+    },
+    // select row data
+    selectCurrentData(row) {
+      this.currentData = row;
+    },
+    // set row data highlight
+    setCurrentData(row) {
+      this.$refs.singleTable.setCurrentRow(row);
+    },
+    //
+    confirm() {
+      if (this.currentData) {
+        this.$emit("confirm", this.currentData);
+      }
+      this.setVisible(false);
+    },
+  },
+  created() { },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-dialog :title="title" :visible.sync="visible" :width="width" append-to-body @open="beforeOpen">
+    <el-form :size="size" :inline="true" :model="params">
+      <el-form-item v-for="(column, index) in searchColumns" :key="index" :label="column.title">
+        <el-input v-model="params[column.key]" @change="queryList"> </el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-refresh" @click="resetList"></el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="data" :size="size" ref="singleTable" height="45vh" highlight-current-row
+      style="width: 100%; margin-bottom: 20px" @row-click="selectCurrentData">
+      <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">
+      <p>
+        <span style="font-size: 12px">已选择 :</span>
+        <el-tag v-if="currentData" :size="size">{{
+          currentData[showKey]
+        }}</el-tag>
+        <span v-else>无</span>
+      </p>
+      <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">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+<style scoped></style>

+ 114 - 23
src/views/purchase/purchase-order/add/column.js

@@ -11,7 +11,15 @@ const columns = [
     require: true,
   },
   // { key: "puOrgName", title: "采购组织名称", },
-  { key: "billType", title: "订单类型", type: "Input", },
+  {
+    key: "billType",
+    title: "订单类型",
+    type: "Select",
+    require: true,
+    config: {
+      optionsName: "", // 字典名
+    },
+  },
   // { key: "billTypeName", title: "订单类型名称", },
   { key: "oaDemandNo", title: "OA需求单号", type: "Input", },
   { key: "code", title: "订单编号", type: "Input", },
@@ -32,9 +40,30 @@ const columns = [
     require: true,
   },
   // { key: "supplierName", title: "供应商名称", },
-  { key: "paymentAgreement", title: "付款协议", type: "Input", },
+  {
+    key: "paymentAgreement",
+    title: "付款协议",
+    type: "InputDialog",
+    config: {
+      componentName: "PaymentPlan",
+      dataMapping: {
+        buyer: "userName",
+        puDept: "deptName",
+      },
+    },
+  },
   { key: "finalType", title: "结算方式", type: "Input", },
-  { key: "currency", title: "币种", type: "Input", },
+  {
+    key: "currency",
+    title: "币种",
+    type: "InputDialog",
+    config: {
+      componentName: "Currency",
+      dataMapping: {
+        currency: "name",
+      },
+    },
+  },
   // { key: "currencyName", title: "币种名称", },
   {
     key: "buyer",
@@ -58,8 +87,14 @@ const columns = [
     require: true,
   },
   // { key: "puDeptName", title: "采购部门名称", },
-  { key: "customer", title: "收货客户", type: "Input", },
-  // { key: "customerName", title: "收货客户名称", },
+  // { key: "customer", title: "收货客户", type: "Input", },
+  {
+    key: "customerName",
+    title: "收货客户名称",
+    type: "InputDialog",
+    config: { componentName: "Customer" },
+    width: 200,
+  },
   {
     key: "qty",
     title: "总数量",
@@ -78,11 +113,22 @@ const columns = [
   { key: "status", title: "单据状态", type: "Input", },
   { key: "freezeCause", title: "冻结原因", type: "Input", },
   { key: "isBack", title: "退货", type: "Input", type: "Input", },
-  { key: "isMarketing", title: "已协同生成销售订单", type: "Input", },
-  { key: "isMarketingSource", title: "由销售订单协同生成", type: "Input", },
-  { key: "warehouse", title: "WMS入库仓库", type: "Input", },
+  { key: "isMarketing", title: "已协同生成销售订单", type: "Checkbox", },
+  { key: "isMarketingSource", title: "由销售订单协同生成", type: "Checkbox", },
+  {
+    key: "warehouse",
+    title: "WMS入库仓库", // 收货仓库
+    type: "InputDialog",
+    config: { componentName: "Warehouse" },
+  },
   // { key: "warehouseName", title: "WMS入库仓库名称", },
-  { key: "goodsAllocation", title: "货位", type: "Input", },
+  {
+    key: "goodsAllocation",
+    title: "货位",
+    type: "InputDialog",
+    config: { componentName: "Allocation" },
+    width: 200,
+  },
   // { key: "goodsAllocationName", title: "货位名称", },
   { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
   { key: "isInvoice", title: "发票标识", type: "Input", },
@@ -93,25 +139,58 @@ const columns = [
   { key: "contacts", title: "收货联系人", type: "Input", },
   { key: "customerDept", title: "客户部门", type: "Input", },
   // { key: "customerDeptName", title: "客户部门名称", },
-  { key: "supplierContacts", title: "供应商业务联系人", type: "Input", },
+  {
+    key: "supplierContacts",
+    title: "供应商业务联系人",
+    type: "InputDialog",
+    config: { componentName: "" },
+    width: 200,
+  },
   // { key: "supplierContactsName", title: "供应商业务联系人名称", },
   { key: "isUrgency", title: "紧急程度", type: "Input", },
-  { key: "isSendWms", title: "已同步WMS", type: "Input", },
-  { key: "agent", title: "代理人", type: "Input", },
+  { key: "isSendWms", title: "已同步WMS", type: "Checkbox", },
+  // { key: "agent", title: "代理人", type: "Input", }, // 建议删除
   // { key: "agentName", title: "代理人名称", },
-  { key: "isClose", title: "最终关闭", type: "Input", },
+  { key: "isClose", title: "最终关闭", type: "Checkbox", },
   { key: "closeTime", title: "最终关闭日期", type: "Input", },
   { key: "applyPaymentMoney", title: "累计付款申请金额", type: "Input", },
   { key: "paymentMoney", title: "累计付款金额", type: "Input", },
   { key: "invoiceMoney", title: "发票金额", type: "Input", },
-  { key: "supplierPersonal", title: "供应商业务员", type: "Input", },
+  {
+    key: "supplierPersonal",
+    title: "供应商业务员",
+    type: "InputDialog",
+    config: { componentName: "" },
+    width: 200,
+  },
   // { key: "supplierPersonalName", title: "供应商业务员名称", },
   { key: "isDeliver", title: "是否发货", type: "Input", },
-  { key: "retReason", title: "退换原因", type: "Input", },
-  { key: "processType", title: "处理方式", type: "Input", },
+  {
+    key: "retReason",
+    title: "退换原因",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
+  {
+    key: "processType",
+    title: "处理方式",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
   { key: "isEnd", title: "整单关闭标识", type: "Input", },
-  { key: "projectNow", title: "在建工程项目", type: "Input", },
-  { key: "operatingItems", title: "经营性项目", type: "Input", },
+  {
+    key: "projectNow",
+    title: "在建工程项目",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
+  {
+    key: "operatingItems",
+    title: "经营性项目",
+    type: "Input",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
   { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
   { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
   { key: "marketingCode", title: "销售订单号", type: "Input", },
@@ -143,8 +222,14 @@ const tabColumns = [
       // { key: "id", title: "主键" },
       { key: "rowNo", title: "行号", type: "Input", },
       { key: "orderId", title: "采购订单ID", type: "Input", },
-      { key: "material", title: "物料", type: "Input", },
-      { key: "materialName", title: "物料名称", type: "Input", },
+      // { key: "material", title: "物料", type: "Input", },
+      {
+        key: "materialName",
+        title: "物料名称",
+        type: "InputDialog",
+        config: { componentName: "" },
+        width: 200,
+      },
       { key: "materialCode", title: "物料编码", type: "Input", },
       { key: "materialClassify", title: "物料分类", type: "Input", },
       { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", },
@@ -168,7 +253,13 @@ const tabColumns = [
       { key: "isArrival", title: "到货关闭", type: "Input", },
       { key: "isPayment", title: "付款关闭", type: "Input", },
       { key: "isGift", title: "赠品", type: "Input", },
-      { key: "warehouse", title: "收货仓库", type: "Input", },
+      {
+        key: "warehouse",
+        title: "收货仓库", //WMS入库仓库
+        type: "InputDialog",
+        config: { componentName: "Warehouse" },
+        width: 200,
+      },
       { key: "place", title: "收货地点", type: "Input", },
       { key: "address", title: "收货地址", type: "Input", },
       { key: "productBatch", title: "产品批号", type: "Input", },
@@ -219,13 +310,13 @@ const tabColumns = [
       { key: "orderId", title: "采购订单ID", type: "Input", },
       { key: "rowno", title: "行号", type: "Input", },
       { key: "material", title: "物料", type: "Input", },
-      { key: "materialName", title: "物料名称", type: "Input", },
+      // { key: "materialName", title: "物料名称", type: "Input", },
       { key: "specification", title: "规格", type: "Input", },
       { key: "qty", title: "数量", type: "Input", },
       { key: "stroageQty", title: "累计到货主数量", type: "Input", },
       { key: "stockQty", title: "累计入库主数量", type: "Input", },
       { key: "invoiceQty", title: "累计开票主数量", type: "Input", },
-      { key: "rollbackQty", title: "累计退货主数量", type: "Input", },
+      { key: "rollbackQty", title: "累计退货主数量", type: "Checkbox", },
       { key: "backStockQty", title: "累计退库主数量", type: "Input", },
       { key: "floatQty", title: "未到货数量", type: "Input", },
       // { key: "tenantId", title: "租户号",type: "Input", },

+ 10 - 5
src/views/purchase/purchase-order/add/index.vue

@@ -57,7 +57,12 @@ export default {
       this.params = arr2obj(this.columns, "key", "value");
     },
     sava() {
-      this.setVisible(false);
+      let data = {
+        ...this.params,
+        ...this.tabTableParams
+      }
+      console.log(data, 'data');
+      // this.setVisible(false);
     },
     async submitSava() {
       console.log(this.params);
@@ -154,8 +159,8 @@ export default {
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 style="width: 100%"></el-input>
 
-              <el-checkbox v-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="0"
-                false-label="2"></el-checkbox>
+              <el-checkbox v-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
+                false-label="N"></el-checkbox>
 
               <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
                 :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
@@ -232,8 +237,8 @@ export default {
                     </template>
                   </el-input>
 
-                  <el-checkbox v-if="cColumn.type === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="0"
-                    false-label="2"></el-checkbox>
+                  <el-checkbox v-if="cColumn.type === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
+                    false-label="N"></el-checkbox>
                 </template>
               </el-table-column>
             </el-table>

+ 27 - 5
src/views/purchase/purchase-order/index.vue

@@ -246,7 +246,7 @@ export default {
   //     },
   //   },
   created() {
-    // this.fetchTaskList();
+    this.fetchTaskList();
     console.log("Vue", this);
   },
   methods: {
@@ -278,7 +278,7 @@ export default {
     },
     handleSizeChange() { },
     handleCurrentChange() { },
-    handleClick() { },
+    handleTabClick() { },
     handleOpenAddDrawer() {
       const { setVisible } = this.$refs.addDrawerFef;
       setVisible(true);
@@ -293,6 +293,26 @@ export default {
         this.$notify.info("Open See Drawer");
       }, 250);
     },
+    // 获取子表信息
+    async handleDetailsData(row) {
+      console.log(row, '获取详情信息');
+      try {
+        const { code, msg, data } = await orderApi.orderDetails(row.id);
+        if (code === 200) {
+
+          // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
+          this.tabTableDatas.first = data.puOrderItemList;
+          this.tabTableDatas.second = data.puOrderExecuteList;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.loading = false;
+      }
+    },
   },
 };
 </script>
@@ -325,6 +345,7 @@ export default {
         @click="handleSearchChange"></i>
     </el-divider>
 
+    <!-- 操作 -->
     <el-row :gutter="24" style="padding: 0 20px">
       <!-- <el-col :span="6">123</el-col> -->
       <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
@@ -348,7 +369,8 @@ export default {
       </el-col>
     </el-row>
 
-    <el-table @row-dblclick="handleOpenSeeDrawer" :data="tableData" size="mini" style="width: 100%; margin: 20px 0 0 0">
+    <el-table @row-dblclick="handleOpenSeeDrawer" @row-click="handleDetailsData" :data="tableData" size="mini"
+      highlight-current-row style="width: 100%; margin: 20px 0 0 0">
       <el-table-column type="index" width="50" label="序号"></el-table-column>
       <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
         :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
@@ -372,9 +394,9 @@ export default {
       display: 'flex',
       'flex-wrap': 'wrap',
     }" style="margin: 10px"> -->
-    <el-tabs v-model="tabName" @tab-click="handleClick" style="width: 100%;padding: 20px 10px">
+    <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
       <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
-        <el-table :data="tabTableDatas[column.key]" style="width: 100%">
+        <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row>
           <el-table-column type="index" width="50" label="序号"></el-table-column>
           <el-table-column width="100" v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
             :label="cColumn.title">

+ 6 - 6
vue.config.js

@@ -37,12 +37,12 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-        target: `http://test-sy.derom.com/drp-admin`, //测试
+        // target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
-        // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
+        target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
@@ -137,10 +137,10 @@ module.exports = {
         },
       });
       config.optimization.runtimeChunk("single"),
-        {
-          from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
-          to: "./", //到根目录下
-        };
+      {
+        from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
+        to: "./", //到根目录下
+      };
     });
   },
 };