Explorar el Código

新增客户消耗单静态页面及列表查询接口

002390 hace 1 año
padre
commit
249863b223

+ 10 - 0
src/api/expend/customerExpend.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 消耗单明细列表
+export function queryList(data) {
+  return request({
+    url: `/pu/ccd/list`,
+    method: 'post',
+    data: data
+  })
+}

+ 38 - 0
src/views/expend/customerExpend/che-hui/index.vue

@@ -0,0 +1,38 @@
+<script>
+export default {
+  name: "OpenOrClose",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      title: "撤回",
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this;
+        if (selectData.length < 1) {
+          return true;
+        }
+        return false;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    useClick() {},
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+    title
+  }}</el-button>
+</template>

+ 184 - 0
src/views/expend/customerExpend/columns.js

@@ -0,0 +1,184 @@
+export default function useColumns() {
+  const SearchColumns = [
+    {
+      item: { key: "ccdProjectName", title: "项目名称" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "ccdSupplier", title: "供应商" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "ccdSpdProject", title: "SPD项目" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "ccdSaleOrg_name", title: "销售组织" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "ORG_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          ccdSaleOrg: "id",
+          ccdSaleOrg_name: "name",
+        },
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "ccdMaterialCode", title: "物料编码" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "ccdIsTicket", title: "是否开票" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_yes_no",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "ccdSaleOrderNo", title: "销售订单号" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "verifyState", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_status",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "code", title: "编码" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+  ];
+  const TableColumns = [
+    {
+      item: { key: "code", title: "单据号" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdProjectName", title: "项目名称" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdSupplier", title: "供应商" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdCalculateSupplier", title: "结算供应商" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdStartDate", title: "结算开始日期" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdEndDate", title: "结算截止日期" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdSpdProject", title: "SPD项目" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdProfileCenter", title: "利润中心" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdSaleOrg_name", title: "销售组织" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdSaleMonth", title: "销售月份" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdPriceSum", title: "价税合计" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdServiceFee", title: "服务费" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdMaterialCode", title: "物料编码" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdNum", title: "数量" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdIsToSaleOrder", title: "是否转销售订单" },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_yes_no",
+      }
+    },
+    {
+      item: { key: "ccdSaleOrderNo", title: "销售订单号" },
+      attr: {}
+    },
+    {
+      item: { key: "ccdIsReturnMoney", title: "是否回款" },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_return_money",
+      }
+    },
+    {
+      item: { key: "ccdIsTicket", title: "是否开票" },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_yes_no",
+      }
+    },
+    {
+      item: { key: "verifyState", title: "单据状态" },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_status",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "ccdIsOpenStatus", title: "单据打开状态" },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_open_status",
+        clearable: true,
+      }
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
+  }));
+  return { SearchColumns, TableColumns }
+}

+ 15 - 0
src/views/expend/customerExpend/dicts.js

@@ -0,0 +1,15 @@
+
+import { initDicts } from "@/utils/init.js";
+const modules = require.context("./", true, /columns.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);

+ 149 - 0
src/views/expend/customerExpend/edit/columns.js

@@ -0,0 +1,149 @@
+export default function useColumns() {
+  const FearchColumns = [
+    {
+      item: { key: "code", title: "编码" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdProjectName", title: "项目名称" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdStartDate", title: "结算开始日期" },
+      attr: {
+        is: "el-date-picker",
+        type: "date",
+        valueFormat: "yyyy-MM-dd",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdEndDate", title: "结算截止日期" },
+      attr: {
+        is: "el-date-picker",
+        type: "date",
+        valueFormat: "yyyy-MM-dd",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdSpdProject", title: "SPD项目" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdProfileCenter", title: "利润中心" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdCalculateSupplier", title: "结算供应商" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdSupplier", title: "供应商" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdSaleOrg_name", title: "销售组织" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "ORG_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          ccdSaleOrg: "id",
+          ccdSaleOrg_name: "name",
+        },
+        // ccdSaleOrg_name
+      }
+    },
+    {
+      item: { key: "ccdSaleMonth", title: "销售月份" },
+      attr: {
+        is: "el-input",
+      }
+    },
+    {
+      item: { key: "ccdSaleOrderNo", title: "销售订单号" },
+      attr: {
+        is: "el-input",
+      }
+    },
+    {
+      item: { key: "ccdPriceSum", title: "价税合计" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdServiceFee", title: "服务费" },
+      attr: {
+        is: "el-input",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdIsToSaleOrder", title: "是否转销售订单" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_yes_no",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdIsReturnMoney", title: "是否回款" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_return_money",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdIsTicket", title: "是否开票" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_yes_no",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "ccdIsOpenStatus", title: "单据打开状态" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_open_status",
+        disabled: true,
+      }
+    },
+    {
+      item: { key: "verifyState", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_status",
+        disabled: true,
+      }
+    },
+
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+
+  return { FearchColumns }
+}

+ 104 - 0
src/views/expend/customerExpend/edit/index.vue

@@ -0,0 +1,104 @@
+<script>
+import useColumns from "./columns";
+export default {
+  name: "customerExpendAdd",
+  props: {
+    dict: {
+      type: Object,
+    },
+  },
+  components: {
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+  },
+  data() {
+    const { FearchColumns } = useColumns();
+    const page = this.$init.page();
+    const params = this.$init.params(FearchColumns);
+    const rules = this.$init.rules(FearchColumns);
+    return {
+      page,
+      rules,
+      params,
+      FearchColumns,
+      size: "mini",
+      width: "100%",
+      visible: false,
+      loading: false,
+      opType: "edit",
+    };
+  },
+  computed: {
+    title: {
+      get() {
+        let { opType } = this;
+        if (opType === "edit") {
+          return "编辑";
+        } else {
+          return "查看";
+        }
+      },
+      set() {},
+    },
+  },
+  methods: {
+    setVisible(prop, type) {
+      this.visible = prop;
+      this.opType = type;
+    },
+    // 查询
+    fetchItem(prop) {
+      console.log(prop, "prop");
+    },
+    //
+    onHide() {
+      const { FearchColumns } = useColumns();
+      this.visible = false;
+      this.params = this.$init.params(FearchColumns);
+      this.$emit("success");
+    },
+    useSubmit() {},
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-drawer
+    :show-close="false"
+    :size="width"
+    :title="title"
+    :visible.sync="visible"
+    append-to-body
+    destroy-on-close
+    @close="onHide"
+  >
+    <template slot="title">
+      <span>{{ title }}</span>
+      <el-button
+        v-if="opType !== 'see'"
+        type="primary"
+        :size="$attrs.size"
+        :loading="loading"
+        @click="useSubmit('customerExpendAdd')"
+      >
+        确 认
+      </el-button>
+      <el-button :size="$attrs.size" :loading="loading" @click="onHide">
+        取 消
+      </el-button>
+    </template>
+    <el-super-form
+      v-model="params"
+      :dict="dict"
+      :rules="rules"
+      :size="$attrs.size"
+      :columns="FearchColumns"
+      :disabled="opType === 'see'"
+      ref="customerExpendAdd"
+      label-width="auto"
+      label-position="right"
+      style="padding: 18px"
+    >
+    </el-super-form>
+  </el-drawer>
+</template>

+ 38 - 0
src/views/expend/customerExpend/hdk-hgb/index.vue

@@ -0,0 +1,38 @@
+<script>
+export default {
+  name: "OpenOrClose",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      title: "行打开/关闭",
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this;
+        if (selectData.length < 1) {
+          return true;
+        }
+        return false;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    useClick() {},
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+    title
+  }}</el-button>
+</template>

+ 167 - 1
src/views/expend/customerExpend/index.vue

@@ -1 +1,167 @@
-<template><div>客户消耗单</div></template>
+<script>
+import { dicts } from "./dicts";
+import useColumns from "./columns";
+import { queryList } from "@/api/expend/customerExpend";
+export default {
+  name: "customerExpend",
+  dicts: dicts,
+  components: {
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    zxsddButton: () => import("./zxsdd/index.vue"),
+    hgbHdkButton: () => import("./hdk-hgb/index.vue"),
+    chButton: () => import("./che-hui/index.vue"),
+    tjButton: () => import("./ti-jiao/index.vue"),
+    editDrawer: () => import("./edit/index.vue"),
+  },
+  data() {
+    const { TableColumns, SearchColumns } = useColumns();
+    const page = this.$init.page();
+    const params = this.$init.params(SearchColumns);
+    return {
+      page,
+      params,
+      TableColumns,
+      SearchColumns,
+      size: "mini",
+      tableData: [],
+      selectData: [],
+      loading: false,
+    };
+  },
+  methods: {
+    // 查询
+    async useQuery(params, page) {
+      try {
+        this.loading = true;
+        let { code, rows, total } = await queryList({ ...params, ...page });
+        if (code == 200) {
+          this.tableData = rows;
+          this.page.total = total;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 查看
+    useSee(row) {
+      let { setVisible, fetchItem } = this.$refs.customerEdit;
+      setVisible(true, "see");
+      fetchItem(row);
+    },
+    // 编辑
+    useEdit(row) {
+      let { setVisible, fetchItem } = this.$refs.customerEdit;
+      setVisible(true, "edit");
+      fetchItem(row);
+    },
+    // 重置
+    useReset() {
+      this.page = this.$init.page();
+      this.params = this.$init.params(this.SearchColumns);
+    },
+    // 选 择
+    useSelect(prop) {
+      this.selectData = prop;
+    },
+  },
+  created() {
+    this.useQuery(this.params, this.page);
+  },
+};
+</script>
+
+<template>
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
+  >
+    <el-super-search
+      v-model="params"
+      :size="size"
+      :dict="dict"
+      :columns="SearchColumns"
+      @reset="useReset"
+      @submit="useQuery(params, page)"
+    ></el-super-search>
+    <el-row class="my-4" style="text-align: right">
+      <el-button-group>
+        <tj-button
+          :dict="dict"
+          :size="size"
+          type="primary"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        ></tj-button>
+        <ch-button
+          :dict="dict"
+          :size="size"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        ></ch-button>
+      </el-button-group>
+      <el-button-group>
+        <zxsdd-button
+          :dict="dict"
+          :size="size"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        ></zxsdd-button>
+        <hgb-hdk-button
+          :dict="dict"
+          :size="size"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        ></hgb-hdk-button>
+      </el-button-group>
+    </el-row>
+    <edit-drawer
+      ref="customerEdit"
+      :dict="dict"
+      :size="size"
+      @submit="useQuery(params, page)"
+    ></edit-drawer>
+    <el-super-ux-table
+      v-model="tableData"
+      :size="size"
+      :dict="dict"
+      :page="page"
+      :columns="TableColumns"
+      index
+      checkbox
+      pagination
+      convenitentOperation
+      storage-key="CustomerExpendSuperTable"
+      @row-dblclick="useSee"
+      @row-select="useSelect"
+      @pagination="useQuery(params, page)"
+    >
+      <ux-table-column fixed="right" title="操作" align="center" width="100">
+        <template slot-scope="scope">
+          <el-button type="text" :size="size" @click="useEdit(scope.row)"
+            >编辑</el-button
+          >
+        </template>
+      </ux-table-column>
+    </el-super-ux-table>
+  </el-card>
+</template>
+<style scoped lang="scss">
+.el-card {
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
+}
+
+.el-button-group + .el-button-group {
+  margin: 0 0 0 8px;
+}
+</style>

+ 38 - 0
src/views/expend/customerExpend/ti-jiao/index.vue

@@ -0,0 +1,38 @@
+<script>
+export default {
+  name: "OpenOrClose",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      title: "提交",
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this;
+        if (selectData.length < 1) {
+          return true;
+        }
+        return false;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    useClick() {},
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+    title
+  }}</el-button>
+</template>

+ 38 - 0
src/views/expend/customerExpend/zxsdd/index.vue

@@ -0,0 +1,38 @@
+<script>
+export default {
+  name: "ResaleOrder",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      title: "转销售订单",
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this;
+        if (selectData.length < 1) {
+          return true;
+        }
+        return false;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    useClick() {},
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+    title
+  }}</el-button>
+</template>