Răsfoiți Sursa

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

001295 1 an în urmă
părinte
comite
f018e3ecd1

+ 10 - 0
src/api/business/report/summary.js

@@ -0,0 +1,10 @@
+import request from "@/utils/request";
+
+export function LIST(data, params) {
+  return request({
+    url: "/pu/priceApply/list",
+    method: "POST",
+    params: params,
+    data: data,
+  });
+}

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

@@ -36,6 +36,9 @@
               <el-table-column prop="model" header-align="center" align="center" sortable="custom" min-width="90"
                 label="型号">
               </el-table-column>
+              <el-table-column prop="remark" header-align="center" align="center" sortable="custom" min-width="90"
+                label="物料备注">
+              </el-table-column>
               <el-table-column prop="manufacturerIdName" header-align="center" align="center" sortable="custom" min-width="90"
                 label="生产厂家">
               </el-table-column>

+ 2 - 0
src/components/popover-select-v2/index.vue

@@ -250,6 +250,7 @@ export default {
     },
     handleClear() {
       this.innerValue = "";
+      this.$emit("clear");
     },
     handleKeyupDel() {
       console.log("focus");
@@ -298,6 +299,7 @@ export default {
       @select="useConfirm([$event])"
       style="width: 100%"
       @blur="useBlur"
+      @clear="handleClear"
     >
       <i class="el-icon-search" slot="suffix" @click="open"> </i>
       <template slot-scope="{ item }">

+ 15 - 11
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -1,6 +1,6 @@
 export default [
   {
-    item: { key: "code", title: "编码", width: "150" },
+    item: { key: "code", title: "编码", width: "140" },
     attr: {},
   },
   {
@@ -8,7 +8,11 @@ export default [
     attr: {},
   },
   {
-    item: { key: "specification", title: "规格", width: "150" },
+    item: { key: "specification", title: "规格", width: "120" },
+    attr: {},
+  },
+  {
+    item: { key: "remark", title: "物料备注", width: "150" },
     attr: {},
   },
   {
@@ -30,7 +34,7 @@ export default [
   {
     item: { key: "registrationNo", title: "注册证号", width: "160" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine != null ? prop.materialMedcine.registrationNo : null;
       },
@@ -39,7 +43,7 @@ export default [
   {
     item: { key: "isMedicineYN", title: "医药物料", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.isMedicine == "0" ? "Y" : "N";
       },
@@ -48,7 +52,7 @@ export default [
   {
     item: { key: "isDrug", title: "物料药品属性", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.isDrug == "0" ? "Y" : "N";
       },
@@ -57,7 +61,7 @@ export default [
   {
     item: { key: "isDrugNumber", title: "药品", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine != null ? prop.materialMedcine.isDrug : null;
       },
@@ -78,7 +82,7 @@ export default [
   {
     item: { key: "dosageFrom", title: "剂型", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine != null ? prop.materialMedcine.dosageFrom : null;
       },
@@ -87,7 +91,7 @@ export default [
   {
     item: { key: "dosageFromName", title: "剂型名称", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine != null ? prop.materialMedcine.dosageFromName : null;
       },
@@ -96,7 +100,7 @@ export default [
   {
     item: { key: "curingType", title: "养护类型", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine != null ? prop.materialMedcine.curingType : null;
       },
@@ -105,7 +109,7 @@ export default [
   {
     item: { key: "medicalInstruments", title: "医疗器械", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine != null ? prop.materialMedcine.medicalInstruments : null;
       },
@@ -114,7 +118,7 @@ export default [
   {
     item: { key: "ratifyBatchNo", title: "批准文号", width: "auto" },
     attr: {
-      type:'ComputedInput',
+      type: 'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine != null ? prop.materialMedcine.ratifyBatchNo : null;
       },

+ 317 - 0
src/views/purchase/DemandSummary/add/columns.js

@@ -0,0 +1,317 @@
+export default function useColumns() {
+
+  const TableColumns = [
+    {
+      item: { key: "code", title: "需求单号", },
+      attr: {},
+    },
+    {
+      item: { key: "rowNo", title: "行号", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "materialCode", title: "物料编码", },
+      attr: {},
+    },
+    {
+      item: { key: "materialName", title: "品名", },
+      attr: {},
+    },
+    {
+      item: { key: "specification", title: "规格", },
+      attr: {},
+    },
+    {
+      item: { key: "unit", title: "单位", width: 100, },
+      attr: {},
+    },
+    {
+      item: { key: "manufacturerName", title: "生产厂家/代理人", },
+      attr: {},
+    },
+    {
+      item: { key: "totalMonthlySales", title: "月销量", },
+      attr: {},
+    },
+    {
+      item: { key: "resDemandQty", title: "最终净需求量", },
+      attr: {},
+    },
+    {
+      item: { key: "puQtyRes", title: "最终采购量", },
+      attr: {},
+    },
+    {
+      item: { key: "closeQty", title: "关闭数量", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "customerName", title: "需求客户", },
+      attr: {},
+    },
+    {
+      item: { key: "minPackage", title: "最小包装量", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "minOrderQty", title: "最小订单量", },
+      attr: {},
+    },
+    {
+      item: { key: "minBatch", title: "最小批量", },
+      attr: {},
+    },
+    {
+      item: { key: "updateByName", title: "修改人", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "updateCause", title: "修改原因", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "remark", title: "业务备注", },
+      attr: {},
+    },
+    {
+      item: { key: "expiry", title: "有效期", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "expiryUnit", title: "有效期单位", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "要求交货日期", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "isUrgency", title: "紧急标识", width: 120, },
+      attr: {
+        is: "el-select",
+        dictName: "sys_yes_no",
+      },
+    },
+    {
+      item: { key: "isReplenishment", title: "补单标识", width: 120, },
+      attr: {
+        is: "el-select",
+        dictName: "sys_yes_no",
+      },
+    },
+    {
+      item: { key: "deliveryWarehouseName", title: "收货仓库名称", },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "WAREHOUSE_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          deliveryWarehouse: "id",
+        },
+        queryParams: (params) => ({
+          pkOrg: params.org
+        })
+      },
+    },
+    {
+      item: { key: "deliveryAllocationName", title: "收货货位名称", },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "ALLOCATION_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          deliveryAllocation: "id",
+        },
+        queryParams: (params) => ({
+          stordocId: params.deliveryWarehouse
+        })
+      },
+    },
+    {
+      item: { key: "buyerName", title: "采购员名称", width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "billMaker", title: "制单人", width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "approver", title: "审核人员", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "status", title: "行状态", width: 120, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_row_status",
+      },
+    },
+    {
+      item: { key: "registrant", title: "注册人", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "lastWarehouseQty", title: "末级供应仓库存量", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "additionalSupplierName", title: "补单供应商名称", },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "SUPPLIER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          additionalSupplier: "id",
+        },
+      },
+    },
+    {
+      item: { key: "lastWarehouseName", title: "供应仓库", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "lastAllocationName", title: "供应货位", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "billType", title: "业务类型", width: 120, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "xqcl_business_type",
+      },
+    },
+    {
+      item: { key: "materialCategory", title: "品类", },
+      attr: {},
+    },
+    {
+      item: { key: "forecastClassify", title: "集团预测分类", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "updateTime", title: "修改时间", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "puPeriod", title: "采购周期", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "orgName", title: "采购组织名称", },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "ORG_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          org: "id",
+        },
+      },
+    },
+    {
+      item: { key: "demandDeptName", title: "需求部门名称", hidden: false, },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "DEPT_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          demandDept: "id",
+        },
+        queryParams: (params) => ({
+          pkOrg: params.org
+        })
+      },
+    },
+    {
+      item: { key: "isBatchLock", title: "批号锁定标识", hidden: false, },
+      attr: {
+        is: "el-select",
+        dictName: "sys_yes_no",
+      },
+    },
+    {
+      item: { key: "approveName", title: "采购需求审批人", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "approverFinishTime", title: "需求单审批时间", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "createTime", title: "需求单提交时间", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "createByName", title: "需求提交人", },
+      attr: {},
+    },
+    {
+      item: { key: "processTime", title: "需求处理时间", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "puManagerApproverDate", title: "处理审批时间", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "processPersonal", title: "处理需求人员", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "priceType", title: "价格类型", width: 120, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_price_type",
+      },
+    },
+    {
+      item: { key: "", title: "需求客户近1月用量", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "需求客户近3月月均用量", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "近1月均销售量", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "近3月均销售量", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "在途数量", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "中心公共库存", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "中心仓专属货位", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "客户专属货位库存", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "呆滞库存", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "项目仓库存", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "电商库存", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "近效期数量", },
+      attr: {},
+    },
+  ];
+
+  return { TableColumns }
+}

+ 285 - 0
src/views/purchase/DemandSummary/add/index.vue

@@ -0,0 +1,285 @@
+<!-- 采购需求处理-详情 -->
+<script>
+import useColumns from "./columns";
+import {
+  getSummaryDetail,
+  shutDownSummary,
+  editSummaryMx,
+  reloadBatch,
+} from "@/api/purchase/DemandSummary.js";
+export default {
+  name: "DemandSummaryAdd",
+  props: {
+    dict: {
+      type: Object,
+    },
+    data: {
+      type: Object,
+    },
+  },
+  components: {
+    CloseLineBtn: () => import("../closeLine/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+  },
+  data() {
+    const { TableColumns } = useColumns();
+    return {
+      width: "100%",
+      title: "详 情",
+      isEdit: false,
+      visible: false,
+      loading: false,
+      params: [],
+      TableColumns,
+      selectData: [],
+    };
+  },
+  computed: {},
+  methods: {
+    onHide() {
+      this.visible = false;
+      this.params = [];
+      this.selectData = [];
+      this.$emit("refresh");
+    },
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    beforeOpen() {
+      this.fetchItem();
+    },
+    async fetchItem() {
+      try {
+        this.loading = true;
+        let { code, msg, data } = await getSummaryDetail({
+          ...this.$props.data,
+        });
+        if (code == 200) {
+          this.params = data;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+    useSelect(prop) {
+      this.selectData = prop;
+    },
+    // 编辑
+    useEdit() {
+      this.isEdit = true;
+    },
+    // 取消
+    useCancel() {
+      this.isEdit = false;
+      this.fetchItem();
+    },
+    // 保存
+    async useSave() {
+      try {
+        const params = [...this.params];
+        console.log(params, "params");
+        let { code, msg } = await editSummaryMx(params);
+        if (code == 200) {
+          this.$modal.notifySuccess(msg);
+          this.isEdit = false;
+          this.fetchItem();
+        }
+      } catch (error) {}
+    },
+    // 重取批量
+    refetchBatch() {
+      this.$modal
+        .confirm("是否更新明细的最小包装量,最小订货量,最小批量?")
+        .then(async () => {
+          let ids = this.params.map((item) => item.demandItemId);
+          let { code, msg } = await reloadBatch(ids);
+          if (code == 200) {
+            this.$modal.notifySuccess(msg);
+            this.fetchItem();
+          }
+        })
+        .catch(() => {});
+    },
+    // 补单标识
+    changeReplenishment(prop, row) {
+      if (prop === "N") {
+        row.additionalSupplier = null;
+        row.additionalSupplierName = null;
+      }
+    },
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-drawer
+    v-loading="loading"
+    v-bind="$attrs"
+    v-on="$listeners"
+    :size="width"
+    :show-close="false"
+    :visible.sync="visible"
+    destroy-on-close
+    @close="onHide"
+    @open="beforeOpen"
+  >
+    <div
+      slot="title"
+      style="display: flex; justify-content: space-between; align-items: center"
+    >
+      <h3>{{ title }}</h3>
+      <el-button
+        v-if="!isEdit"
+        :size="$attrs.size"
+        :loading="loading"
+        @click="onHide"
+      >
+        返 回
+      </el-button>
+    </div>
+
+    <el-row class="my-4" style="text-align: right; padding: 0 20px">
+      <el-col v-if="isEdit">
+        <el-button-group>
+          <el-button :size="$attrs.size" @click="useCancel">取 消</el-button>
+          <el-button type="primary" :size="$attrs.size" @click="useSave"
+            >保 存</el-button
+          >
+        </el-button-group>
+      </el-col>
+
+      <el-col v-else>
+        <el-button-group>
+          <el-button type="primary" :size="$attrs.size" @click="useEdit"
+            >编 辑</el-button
+          >
+        </el-button-group>
+
+        <el-button-group>
+          <close-line-btn
+            :size="$attrs.size"
+            :select-data="selectData"
+            @refresh="fetchItem"
+          ></close-line-btn>
+        </el-button-group>
+
+        <el-button-group>
+          <el-button :size="$attrs.size" @click="refetchBatch"
+            >重取批量</el-button
+          >
+        </el-button-group>
+      </el-col>
+    </el-row>
+
+    <el-super-ux-table
+      v-model="params"
+      :size="$attrs.size"
+      :dict="dict"
+      :columns="TableColumns"
+      index
+      checkbox
+      convenitentOperation
+      storage-key="DemandSummaryDetailsSuperTable"
+      @row-select="useSelect"
+      style="padding: 0 20px 20px"
+    >
+      <!-- 紧急标识-->
+      <template slot="isUrgency" slot-scope="scope">
+        <component
+          v-bind="scope.attr"
+          v-model="scope.row[scope.item.key]"
+          :size="$attrs.size"
+          :source.sync="scope.row"
+          :disabled="!isEdit || scope.row.status !== '1'"
+        >
+          <el-option
+            v-for="item in dict.type[scope.attr.dictName]"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </component>
+      </template>
+      <!-- 补单标识-->
+      <template slot="isReplenishment" slot-scope="scope">
+        <component
+          v-bind="scope.attr"
+          v-model="scope.row[scope.item.key]"
+          :size="$attrs.size"
+          :source.sync="scope.row"
+          :disabled="!isEdit || scope.row.status !== '1'"
+          @change="(val) => changeReplenishment(val, scope.row)"
+        >
+          <el-option
+            v-for="item in dict.type[scope.attr.dictName]"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </component>
+      </template>
+      <!-- 收货仓库-->
+      <template slot="deliveryWarehouseName" slot-scope="scope">
+        <component
+          v-bind="scope.attr"
+          v-model="scope.row[scope.item.key]"
+          :size="$attrs.size"
+          :source.sync="scope.row"
+          :disabled="!isEdit || scope.row.status !== '1'"
+        >
+        </component>
+      </template>
+      <!-- 收货货位-->
+      <template slot="deliveryAllocationName" slot-scope="scope">
+        <component
+          v-bind="scope.attr"
+          v-model="scope.row[scope.item.key]"
+          :size="$attrs.size"
+          :source.sync="scope.row"
+          :disabled="!isEdit || scope.row.status !== '1'"
+        >
+        </component>
+      </template>
+      <!-- 补单供应商-->
+      <template slot="additionalSupplierName" slot-scope="scope">
+        <component
+          v-bind="scope.attr"
+          v-model="scope.row[scope.item.key]"
+          :size="$attrs.size"
+          :source.sync="scope.row"
+          :disabled="
+            !isEdit ||
+            scope.row.status !== '1' ||
+            (isEdit && scope.row.isReplenishment === 'N')
+          "
+        >
+        </component>
+      </template>
+      <!-- 采购组织-->
+      <template slot="orgName" slot-scope="scope">
+        <component
+          v-bind="scope.attr"
+          v-model="scope.row[scope.item.key]"
+          :size="$attrs.size"
+          :source.sync="scope.row"
+          :disabled="!isEdit || scope.row.status !== '1'"
+        >
+        </component>
+      </template>
+    </el-super-ux-table>
+  </el-drawer>
+</template>
+<style scoped>
+.el-button-group + .el-button-group {
+  margin: 0 0 0 8px;
+}
+>>> .el-drawer__header {
+  margin-bottom: 0;
+  padding: 5px 20px;
+}
+</style>

+ 59 - 0
src/views/purchase/DemandSummary/closeLine/index.vue

@@ -0,0 +1,59 @@
+<script>
+import { shutDownSummary } from "@/api/purchase/DemandSummary.js";
+export default {
+  name: "CloseLine",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this.$props;
+        return !selectData.length;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    async useClick() {
+      const { selectData } = this.$props;
+      let demand = selectData.some((item) => item.demandNum >= 2);
+      let ids = selectData.map((item) => item.demandItemId);
+      if (demand) {
+        this.$modal
+          .confirm("选中项有多个需求单位,是否确定关闭?")
+          .then(async () => {
+            await this.closeItem(ids);
+          })
+          .catch(() => {});
+      } else {
+        await this.closeItem(ids);
+      }
+    },
+    // 关闭
+    async closeItem(prop) {
+      let params = prop.join();
+      try {
+        let { code, msg } = await shutDownSummary(prop);
+        if (code == 200) {
+          this.$modal.notifySuccess(msg);
+          this.$emit("refresh");
+        }
+      } catch (error) {}
+    },
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button :size="$attrs.size" :disabled="disabled" @click="useClick"
+    >行关闭</el-button
+  >
+</template>

+ 304 - 98
src/views/purchase/DemandSummary/columns.js

@@ -1,10 +1,7 @@
 export default function useColumns() {
   const SearchColumns = [
     {
-      item: {
-        key: "rowStatus",
-        title: "行状态",
-      },
+      item: { key: "rowStatus", title: "行状态", },
       attr: {
         is: "el-select",
         dictName: "sys_row_status",
@@ -13,10 +10,7 @@ export default function useColumns() {
       },
     },
     {
-      item: {
-        key: "buyerName",
-        title: "采购员",
-      },
+      item: { key: "buyerName", title: "采购员", },
       attr: {
         clearable: true,
         is: "el-popover-select-v2",
@@ -24,18 +18,15 @@ export default function useColumns() {
         valueKey: "name",
         dataMapping: {
           buyer: "code",
-          buyerName: "name",
         },
       },
     },
     {
-      item: {
-        key: "materialClassifyFour",
-        title: "品类",
-      },
+      item: { key: "materialClassifyFour", title: "品类", },
       attr: {
         clearable: true,
         is: "el-popover-multiple-tree-select",
+        valueKey: "id",
         referName: "MATERIALCLASSIFY_PARAM",
         defaultProps: {
           label: function (data, node) {
@@ -43,35 +34,17 @@ export default function useColumns() {
           },
           children: "children",
         },
-        // dataMapping: {
-        //   materialClassifyFour: 'id',
-        // }
       },
     },
     {
-      item: {
-        width: 100,
-        key: "manufacturer",
-        title: "生产厂家"
-      },
+      item: { key: "manufacturer", title: "生产厂家", width: 100, },
       attr: {
         is: "el-input",
         clearable: true,
       },
     },
     {
-      item: {
-        key: "forecastClassification",
-        title: "预测分类"
-      },
-      attr: {
-        is: "el-select",
-        dictName: "predictive_classify",
-        clearable: true,
-      },
-    },
-    {
-      item: { key: "puManagerAuditorName", title: "审核人" },
+      item: { key: "puManagerAuditorName", title: "审核人", },
       attr: {
         is: "el-popover-select-v2",
         referName: "CONTACTS_PARAM",
@@ -83,18 +56,7 @@ export default function useColumns() {
       },
     },
     {
-      item: {
-        width: 100,
-        key: "registrant",
-        title: "注册人"
-      },
-      attr: {
-        is: "el-input",
-        clearable: true,
-      },
-    },
-    {
-      item: { key: "businessType", title: "业务类型" },
+      item: { key: "businessType", title: "业务类型", },
       attr: {
         is: "el-select",
         dictName: "sys_business",
@@ -102,15 +64,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "billSource", title: "单据来源" },
-      attr: {
-        is: "el-select",
-        dictName: "sys_bill_source",
-        clearable: true,
-      },
-    },
-    {
-      item: { key: "customerName", title: "需求客户" },
+      item: { key: "customerName", title: "需求客户", },
       attr: {
         is: "el-popover-select-v2",
         referName: "CUSTOMER_PARAM",
@@ -122,40 +76,17 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "lastWarehouseName", title: "供应仓库" },
-      attr: {
-        is: "el-popover-select-v2",
-        referName: "WAREHOUSE_PARAM",
-        valueKey: "name",
-        dataMapping: {
-          lastWarehouse: "id",
-          lastWarehouseName: "name"
-        },
-      },
-    },
-    {
-      item: { key: "lastAllocationName", title: "供应库位" },
-      attr: {
-        is: "el-popover-select-v2",
-        referName: "ALLOCATION_PARAM",
-        valueKey: "name",
-        dataMapping: {
-          lastAllocation: "id",
-          lastAllocationName: "name"
-        },
-      },
-    },
-    {
-      item: { key: "materialCodeList", title: "物料编码" },
+      item: { key: "materialCodeList", title: "物料编码", },
       attr: {
         clearable: true,
-        is: "el-popover-multiple-select-v2",
-        valueKey: "code",
-        referName: "MATERIAL_PARAM",
+        is: "el-input",
+        // is: "el-popover-multiple-select-v2",
+        // valueKey: "code",
+        // referName: "MATERIAL_PARAM",
       },
     },
     {
-      item: { key: "purchaseOrgName", title: "默认采购组织" },
+      item: { key: "purchaseOrgName", title: "默认采购组织", },
       attr: {
         is: "el-popover-select-v2",
         referName: "ORG_PARAM",
@@ -167,7 +98,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "demandDateArray", title: "需求日期" },
+      item: { key: "demandDateArray", title: "需求日期", },
       attr: {
         is: "el-date-picker",
         type: "daterange",
@@ -179,14 +110,14 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "code", title: "采购需求单号" },
+      item: { key: "code", title: "采购需求单号", },
       attr: {
         is: "el-input",
         clearable: true,
       },
     },
     {
-      item: { key: "approverFinishTimeArray", title: "审批结束日期" },
+      item: { key: "approverFinishTimeArray", title: "审批结束日期", },
       attr: {
         is: "el-date-picker",
         type: "daterange",
@@ -198,10 +129,7 @@ export default function useColumns() {
       },
     },
     {
-      item: {
-        key: "isCustomerSpecified",
-        title: "是否客户指定",
-      },
+      item: { key: "isCustomerSpecified", title: "是否客户指定", },
       attr: {
         is: "el-select",
         dictName: "sys_yes_no",
@@ -209,10 +137,7 @@ export default function useColumns() {
       },
     },
     {
-      item: {
-        key: "isUrgency",
-        title: "是否紧急需求",
-      },
+      item: { key: "isUrgency", title: "是否紧急需求", },
       attr: {
         is: "el-select",
         dictName: "sys_yes_no",
@@ -220,7 +145,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "additionalSupplierName", title: "补单供应商" },
+      item: { key: "additionalSupplierName", title: "补单供应商", },
       attr: {
         is: "el-popover-select-v2",
         referName: "SUPPLIER_PARAM",
@@ -232,7 +157,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "processTimeArray", title: "确认日期" },
+      item: { key: "processTimeArray", title: "确认日期", },
       attr: {
         is: "el-date-picker",
         type: "daterange",
@@ -243,7 +168,288 @@ export default function useColumns() {
 
       },
     },
-  ]
+  ];
+
+  const TableColumns = [
+    {
+      item: { key: "status", title: "行状态", width: 100, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_row_status",
+      },
+    },
+    {
+      item: { key: "finalBuyQty", title: "最终采购量", },
+      attr: {
+        is: "el-input-number",
+        min: 0,
+        controlsPosition: "right",
+        isSummary: true,
+      },
+    },
+    {
+      item: { key: "artificialAdjust", title: "人工调整数", width: 120, },
+      attr: {
+        isSummary: true,
+        formatter: (prop) => {
+          return prop.finalBuyQty - prop.suggestionPurchase
+        }
+      },
+    },
+    {
+      item: { key: "materialClassifyOneName", title: "一级分类名称", width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "materialCode", title: "物料编码", },
+      attr: {},
+    },
+    {
+      item: { key: "materialName", title: "品名", },
+      attr: {},
+    },
+    {
+      item: { key: "specification", title: "规格", },
+      attr: {},
+    },
+    {
+      item: { key: "unit", title: "单位", width: 100, },
+      attr: {},
+    },
+    {
+      item: { key: "manufacturer", title: "生产厂家/代理人", },
+      attr: {},
+    },
+    {
+      item: { key: "demandNum", title: "需求单位量", width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "evensalesforyear", title: "近1月均销量", width: 120, },
+      attr: {
+        formatter: (prop) => {
+          return prop.evensalesforyear ? parseFloat(prop.evensalesforyear).toFixed(2) : "0.00"
+        }
+      },
+    },
+    {
+      item: { key: "evensalesforthrmonth", title: "近3月均销量", width: 120, },
+      attr: {
+        formatter: (prop) => {
+          return prop.evensalesforthrmonth ? parseFloat(prop.evensalesforthrmonth).toFixed(2) : "0.00"
+        }
+      },
+    },
+    {
+      item: { key: "", title: "需求客户近1月用量", width: 150, },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "需求客户近3月月均用量", width: 150, },
+      attr: {},
+    },
+    {
+      item: { key: "netDemandNum", title: "总最终净需求量", width: 120, },
+      attr: {
+        isSummary: true,
+        formatter: (prop) => {
+          return prop.netDemandNum ? parseFloat(prop.netDemandNum).toFixed(2) : "0.00";
+        }
+      },
+    },
+    {
+      item: { key: "totalMonthlySales", title: "总月销量", width: 120, },
+      attr: {
+        formatter: (prop) => {
+          return prop.totalMonthlySales ? parseFloat(prop.totalMonthlySales).toFixed(2) : "0.00";
+        }
+      },
+    },
+    {
+      item: { key: "demandCycle", title: "需求可用周期", width: 120, },
+      attr: {
+        formatter: (prop) => {
+          return prop.demandCycle ? parseFloat(prop.demandCycle).toFixed(2) : "0.00";
+        }
+      },
+    },
+    {
+      item: { key: "dullQut", title: "呆滞量", width: 120, },
+      attr: {
+        formatter: (prop) => {
+          // return prop.dullQut ? parseFloat(prop.dullQut).toFixed(2) : "0.00";
+          return parseFloat(prop.dullQut).toFixed(2);
+        }
+      },
+    },
+    {
+      item: { key: "centralPublicStock", title: "中心公共库存", },
+      attr: {},
+    },
+    {
+      item: { key: "centralWarehouse", title: "中心仓专属货位", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "客户专属货位库存", },
+      attr: {},
+    },
+    {
+      item: { key: "commerceWarehouse", title: "电商仓库", },
+      attr: {},
+    },
+    {
+      item: { key: "buyTransit", title: "采购在途", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "近效期库存数量", },
+      attr: {},
+    },
+    {
+      item: { key: "lendTransit", title: "借出在途", },
+      attr: {},
+    },
+    {
+      item: { key: "transferTransit", title: "调拨在途", },
+      attr: {},
+    },
+    {
+      item: { key: "eachWarehouseStock", title: "各项目仓库存", },
+      attr: {},
+    },
+    {
+      item: { key: "regionPublicStock", title: "区域分仓公共库存", },
+      attr: {},
+    },
+    {
+      item: { key: "stockTotal", title: "库存总计", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "buyPeriod", title: "采购周期", width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "minPackage", title: "最小包装量", width: 120, hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "minOrder", title: "最小订货量", width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "minBatch", title: "最小批量", width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "modifyReason", title: "修改原因", hidden: false, },
+      attr: {
+        is: "el-input",
+      },
+    },
+    {
+      item: { key: "suggestionPurchase", title: "建议净采购量", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "closeQty", title: "关闭数量", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "materialClassifyTwoName", title: "二级品类", },
+      attr: {},
+    },
+    {
+      item: { key: "materialClassifyThreeName", title: "三级品类", },
+      attr: {},
+    },
+    {
+      item: { key: "materialClassifyFourName", title: "四级品类", },
+      attr: {},
+    },
+    {
+      item: { key: "buyerName", title: "采购员", },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "CONTACTS_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          buyer: "code",
+        },
+      },
+    },
+    {
+      item: { key: "purchaseOrgName", title: "默认采购组织名称", },
+      attr: {},
+    },
+    {
+      item: { key: "validityPeriod", title: "有效期", hidden: false, width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "validityPeriodUnit", title: "有效期单位", hidden: false, width: 120, },
+      attr: {},
+    },
+    {
+      item: { key: "businessType", title: "业务类型", hidden: false, width: 120, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_business",
+      },
+    },
+    {
+      item: { key: "safetyStock", title: "安全库存量", hidden: false, width: 120, },
+      attr: {
+        formatter: (prop) => {
+          return prop.safetyStock ? parseFloat(prop.safetyStock).toFixed(2) : "0.00";
+        }
+      },
+    },
+    {
+      item: { key: "billSource", title: "单据来源", hidden: false, width: 120, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_bill_source",
+      },
+    },
+    {
+      item: { key: "registrant", title: "注册人", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "buyDiscrepancy", title: "总需要与终采差异", },
+      attr: {},
+    },
+    {
+      item: { key: "forecastClassification", title: "集团预测分类", hidden: false, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "predictive_classify",
+      },
+    },
+    {
+      item: { key: "centerBinPossession", title: "中心仓占有量", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "centralWarehouseAvailable", title: "中心仓可用量", hidden: false, },
+      attr: {},
+    },
+    {
+      item: { key: "puManagerAuditor", title: "采购经理审核人", },
+      attr: {},
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
+  }));
 
-  return { SearchColumns }
+  return { SearchColumns, TableColumns }
 }

+ 78 - 0
src/views/purchase/DemandSummary/confirm/index.vue

@@ -0,0 +1,78 @@
+<script>
+import { confirmSummary, cancelSummary } from "@/api/purchase/DemandSummary.js";
+export default {
+  name: "ConfirmBtn",
+  props: {
+    selectData: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this.$props;
+        return !selectData.length;
+      },
+      set() {},
+    },
+    innerValue: {
+      get() {
+        const { selectData } = this.$props;
+        return selectData;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    // 确认
+    async useConfirms() {
+      try {
+        this.$modal.loading("处理中,请稍后......");
+        let { code, msg } = await confirmSummary(this.innerValue);
+        if (code == 200) {
+          this.$notify.success(msg);
+          this.$emit("refresh");
+        }
+      } catch (error) {
+      } finally {
+        this.$modal.closeLoading();
+      }
+    },
+    // 取消确认
+    async useUnconfirm() {
+      try {
+        this.$modal.loading("处理中,请稍后......");
+        let params = this.innerValue.map((item) => item.demandItemId).join();
+        let { code, msg } = await cancelSummary(params);
+        if (code == 200) {
+          this.$notify.success(msg);
+          this.$emit("refresh");
+        }
+      } catch (error) {
+      } finally {
+        this.$modal.closeLoading();
+      }
+    },
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button-group>
+    <el-button
+      type="primary"
+      :size="$attrs.size"
+      :disabled="disabled"
+      @click="useConfirms"
+      >确 认</el-button
+    >
+    <el-button :size="$attrs.size" :disabled="disabled" @click="useUnconfirm"
+      >取消确认</el-button
+    >
+  </el-button-group>
+</template>

+ 0 - 1031
src/views/purchase/DemandSummary/index - 副本.vue

@@ -1,1031 +0,0 @@
-<template>
-  <div id="demandSummary">
-    <div v-if="isList">
-      <el-card style="position: relative;">
-        <el-form class="search_area" label-width="100px">
-          <el-row :gutter="10">
-            <el-col :span="1.5">
-              <el-form-item label="行状态">
-                <el-select multiple v-model="queryParams.rowStatus" size="mini" style="width: 200px" clearable>
-                  <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="采购员">
-                <el-select clearable size="mini" v-model="queryParams.buyer" @clear="cleanBuyer" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
-                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="品类">
-                <el-select
-                v-model="queryParams.materialClassifyFour"
-                size="mini"
-                multiple
-                collapse-tags
-                clearable
-                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
-                style="width: 200px"
-                >
-                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="生产厂家">
-                <el-input
-                v-model.trim="queryParams.manufacturer"
-                size="mini"
-                clearable
-                style="width: 200px"
-                />
-              </el-form-item>
-            </el-col>
-            <!-- <el-col :span="1.5"> -->
-              <!-- <el-form-item label="" label-width="20px"> -->
-                <div style="position: absolute;top: 3px;right: 10px;">
-                  <el-button type="primary" size="mini" @click="search">搜索</el-button>
-                  <el-button size="mini" plain @click="reset">重置</el-button>
-                </div>
-              <!-- </el-form-item> -->
-            <!-- </el-col> -->
-          </el-row>
-
-          <CollapseTransition>
-          <div v-show="expanded">
-            <el-row :gutter="10">
-              <el-col :span="1.5">
-                <el-form-item label="预测分类">
-                  <el-select v-model="queryParams.forecastClassification" size="mini" style="width: 200px" clearable>
-                    <el-option
-                      v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.label">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="审核人">
-                  <el-select clearable size="mini" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
-                    <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.code" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="注册人">
-                  <el-input
-                  v-model.trim="queryParams.registrant"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                  />
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="业务类型">
-                  <el-select v-model="queryParams.businessType" size="mini" style="width: 200px" clearable>
-                    <el-option
-                      v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-
-            <el-row :gutter="10">
-              <el-col :span="1.5">
-                <el-form-item label="单据来源">
-                  <el-select v-model="queryParams.billSource" size="mini" style="width: 200px" clearable>
-                    <el-option
-                      v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="需求客户">
-                  <el-select clearable size="mini" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
-                    <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="供应仓库">
-                  <el-select clearable size="mini" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
-                    <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="供应库位">
-                  <el-select clearable size="mini" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '供应库位', queryParams.lastWarehouse)" style="width: 200px">
-                    <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-
-            <el-row :gutter="10">
-              <el-col :span="1.5">
-                <el-form-item label="物料编码">
-                  <el-popover
-                    placement="top-start"
-                    width="500"
-                    trigger="hover"
-                    :title="'数量:'+ queryParams.materialCodeList.length"
-                    :content="queryParams.names">
-                  <el-input slot="reference" clearable size="mini" v-model="queryParams.names" @clear="clearMaterial" style="width: 200px" @paste.native="pasteMe($event)">
-                    <el-button size="mini" slot="append" @click="chooseMaterial">数量:{{queryParams.materialCodeList.length}}</el-button>
-                  </el-input>
-                  </el-popover>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="默认采购组织">
-                  <el-select clearable size="mini" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
-                    <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="需求日期">
-                  <el-date-picker
-                    v-model="queryParams.demandDate"
-                    type="date"
-                    value-format="yyyy-MM-dd"
-                    size="mini"
-                    style="width: 200px"
-                  >
-                  </el-date-picker>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="采购需求单号">
-                  <el-input
-                  v-model.trim="queryParams.code"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                  />
-                </el-form-item>
-              </el-col>
-            </el-row>
-
-            <el-row :gutter="10">
-              <el-col :span="1.5">
-                <el-form-item label="审批结束日期">
-                  <el-date-picker
-                    v-model="queryParams.approverFinishTime"
-                    type="date"
-                    clearable
-                    value-format="yyyy-MM-dd"
-                    size="mini"
-                    style="width: 200px"
-                  >
-                  </el-date-picker>
-                </el-form-item>
-              </el-col>
-              <el-col :span="1.5">
-                <el-form-item label="是否客户指定">
-                  <el-select clearable v-model="queryParams.isCustomerSpecified" size="mini" style="width: 200px">
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="1.5">
-                <el-form-item label="是否紧急需求">
-                  <el-select clearable v-model="queryParams.isUrgency" size="mini" style="width: 200px">
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-
-            <el-col :span="1.5">
-              <el-form-item label="补单供应商">
-                <el-select clearable size="mini" v-model="queryParams.additionalSupplier" @focus="chooseRefer('SUPPLIER_PARAM', true, '供应商')" style="width: 200px">
-                  <el-option v-for="item in supplierOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            </el-row>
-          </div>
-          </CollapseTransition>
-        </el-form>
-        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
-    
-      
-        <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="editList">编辑</el-button>
-          <el-button type="danger" size="mini" v-if="!lineDisable" @click="cancelEdit">取消编辑</el-button>
-          <el-button type="success" size="mini" v-if="!lineDisable" @click="saveList">保存</el-button>
-          <el-button type="primary" size="mini" v-if="lineDisable" @click="confirms">确认</el-button>
-          <el-button type="primary" size="mini" v-if="lineDisable" @click="cancels">取消</el-button>
-          <!-- <el-button type="primary" size="mini" v-if="lineDisable" @click="cancelAudit">取消审批</el-button> -->
-          <el-button type="primary" size="mini" v-if="lineDisable" @click="audits">审核</el-button>
-          <el-button type="primary" size="mini" v-if="lineDisable" @click="closeLine">行关闭</el-button>
-
-          <el-button size="mini" type="primary" style="margin: 0 10px;" v-if="lineDisable" @click="handleCommand">
-            导出
-          </el-button>
-
-          <!-- <el-button type="primary" size="mini">转请购</el-button> -->
-        </div>
-        <vxe-toolbar ref="xToolbar1" custom>
-        </vxe-toolbar>
-
-        <vxe-table
-          id="toolbar_demo5"
-          :custom-config="{storage: true, checkMethod: checkColumnMethod}"
-          @resizable-change="resizableChangeEvent"
-          v-loading="loading"
-          :data="tableList" 
-          :cell-style="{ borderColor: '#c0c0c0' }"
-          :header-cell-style="{ borderColor: '#c0c0c0' }"
-          class="exporttable"
-          border
-          show-summary
-          show-footer
-          :footer-method="getSummaries"
-          highlight-current-row
-          max-height="620"
-          style="font-size: 12px;"
-          :cell-class-name="cellClassName"
-          @checkbox-all="selectAllEvent"
-          @checkbox-change="handleSelectionChange"
-          @cell-dblclick="doubleClick"
-          ref="table"
-          :checkbox-config="{trigger:'row', highlight: true, range: true}"
-          :column-config="{resizable: true}"
-        >
-          <vxe-column type="checkbox" width="50"/>
-          <vxe-column show-header-overflow show-overflow  title="序号" type="seq" align="center" width="50px"/>
-          <!-- <vxe-column show-header-overflow show-overflow title="行号" align="center" field="rowNo"/> -->
-          <vxe-column show-header-overflow show-overflow title="行状态" align="center" field="status" width="50px" :formatter="hangStatus"/>
-          <vxe-column show-header-overflow show-overflow title="最终采购量" align="center" field="finalBuyQty" width="80px">
-            <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$rowIndex)"/>
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="关闭数量" align="center" field="closeQty" width="50px"/>
-          <vxe-column show-header-overflow show-overflow title="人工调整数" align="center" field="artificialAdjust" width="50px">
-            <template slot-scope="scope">
-              {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="一级品类" align="center" field="materialClassifyOneName" width="80"/>
-          <vxe-column show-header-overflow show-overflow title="物料编码" align="center" field="materialCode" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="品名" align="center" field="materialName" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="规格" align="center" field="specification" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="单位" align="center" field="unit" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="生产厂家/代理人" align="center" field="manufacturer" width="100px"/>
-          <vxe-column show-header-overflow show-overflow title="需求单位数" align="center" field="demandNum" width="50px"/>
-          <vxe-column show-header-overflow show-overflow title="总最终净需求量" align="center" field="netDemandNum" width="80px">
-            <template slot-scope="scope">
-              {{scope.row.netDemandNum ? parseFloat(scope.row.netDemandNum).toFixed(2) : '0.00'}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="近1月月均需求" align="center" field="evensalesforyear" width="50">
-            <template slot-scope="scope">
-              {{scope.row.evensalesforyear ? parseFloat(scope.row.evensalesforyear).toFixed(2) : '0.00'}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="近3月月均需求" align="center" field="evensalesforthrmonth" width="50">
-            <template slot-scope="scope">
-              {{scope.row.evensalesforthrmonth ? parseFloat(scope.row.evensalesforthrmonth).toFixed(2) : '0.00'}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="总月销量" align="center" field="totalMonthlySales" width="50">
-            <template slot-scope="scope">
-              {{scope.row.totalMonthlySales ? parseFloat(scope.row.totalMonthlySales).toFixed(2) : '0.00'}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="需求可用周期" align="center" field="demandCycle" width="50px">
-            <template slot-scope="scope">
-              {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '-'}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="呆滞量" align="center" field="dullQut" width="50px">
-            <template slot-scope="scope">
-              {{parseFloat(scope.row.dullQut).toFixed(2)}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="采购周期" align="center" field="buyPeriod" width="50px" />
-          <vxe-column show-header-overflow show-overflow title="中心公共库存" align="center" field="centralPublicStock" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="中心仓专属货位" align="center" field="centralWarehouse" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="各项目仓库存" align="center" field="eachWarehouseStock" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="电商仓库" align="center" field="commerceWarehouse"  width="50" />
-          <vxe-column show-header-overflow show-overflow title="区域分仓公共库存" align="center" field="regionPublicStock" width="50"/>
-          <vxe-column show-header-overflow show-overflow title="采购在途" align="center" field="buyTransit"  width="80px" />
-          <vxe-column show-header-overflow show-overflow title="借出在途" align="center" field="lendTransit"  width="80px" />
-          <vxe-column show-header-overflow show-overflow title="调拨在途" align="center" field="transferTransit"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="库存总计" align="center" field="stockTotal" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="最小包装量" align="center" field="minPackage"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="最小订货量" align="center" field="minOrder"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="最小批量" align="center" field="minBatch"  width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="修改原因" align="center" field="modifyReason" width="150px">
-            <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$rowIndex)"/>
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="建议采购量" align="center" field="suggestionPurchase"  width="80px"/>
-          <!-- <vxe-column show-header-overflow show-overflow title="建议净采购量" align="center" field="suggestBuyQty" width="100px"/> -->
-          <vxe-column show-header-overflow show-overflow title="二级品类" align="center" field="materialClassifyTwoName" width="120px"/>
-          <vxe-column show-header-overflow show-overflow title="三级品类" align="center" field="materialClassifyThreeName" width="120px"/>
-          <vxe-column show-header-overflow show-overflow title="四级品类" align="center" field="materialClassifyFourName" width="120px"/>
-          <vxe-column show-header-overflow show-overflow title="采购员" align="center" field="buyerName" width="150px">
-            <template slot-scope="scope">
-                <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.buyerName">
-                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$rowIndex, 'CONTACTS_PARAM', true, '明细采购员')"></el-button>
-                </el-input>
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="默认采购组织" align="center" field="purchaseOrgName" width="150px">
-            <!-- <template slot-scope="scope">
-                <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.purchaseOrgName">
-                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '明细默认采购组织')"></el-button>
-                </el-input>
-            </template> -->
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="有效期" align="center" field="validityPeriod"/>
-          <vxe-column show-header-overflow show-overflow title="有效期单位" align="center" field="validityPeriodUnit" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="业务类型" align="center" field="businessType" :formatter="formatterBusinessType"/>
-          <vxe-column show-header-overflow show-overflow title="安全库存量" align="center" field="safetyStock" width="80px">
-            <template slot-scope="scope">
-              {{scope.row.safetyStock ? parseFloat(scope.row.safetyStock).toFixed(2) : '0.00'}}
-            </template>
-          </vxe-column>
-          <vxe-column show-header-overflow show-overflow title="单据来源" align="center" field="billSource" :formatter="formatterSource"/>
-          <vxe-column show-header-overflow show-overflow title="注册人" align="center" field="registrant" width="120px"/>
-          <!-- <vxe-column title="可用量" align="center" field="qty"/> -->
-          <vxe-column show-header-overflow show-overflow title="总需与终采差异" align="center" field="buyDiscrepancy" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="集团预测分类" align="center" field="forecastClassification" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="中心仓占有量" align="center" field="centerBinPossession" width="80px"/>
-          <vxe-column show-header-overflow show-overflow title="中心仓可用量" align="center" field="centralWarehouseAvailable" width="80px"/>
-          <!-- <vxe-column title="物料类别" align="center" field="materialCategory" width="150px"/> -->
-          <!-- <vxe-column title="业务部门" align="center" field="departmentName" width="150px"/> -->
-          <!-- <vxe-column show-header-overflow show-overflow title="需求单位" align="center" field="demandUnit"/> -->
-          <vxe-column show-header-overflow show-overflow title="采购经理审核人" align="center" field="puManagerAuditor" width="120px"/>
-          <vxe-column
-          title="操作"
-          align="center"
-          width="50"
-          >
-          <template slot-scope="scope">
-            <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
-          </template>
-        </vxe-column>
-        </vxe-table>
-
-        <!-- <el-button size="mini" style="position: absolute;left: 20px;bottom: 20px;" @click="tols.open = true">隐藏列</el-button> -->
-
-        <!-- <colTol :isVisible.sync="tols.open" @reDraw="reDraw" :showColumn.sync="showColumn" :arrs.sync="arrs"/> -->
-
-        <el-pagination
-          background
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="queryParams.pageNum"
-          :page-sizes="[10, 20, 50, 100, 200, 500]"
-          :page-size="50"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total=total>
-        </el-pagination>
-      </el-card>
-    </div>
-
-    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" :query="queryParams" @refresh="search"/>
-  
-    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
-
-    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
-
-    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
-  </div>
-</template>
-
-<script>
-import Add from './add'
-// import colTol from './colTol.vue'
-import Refers from '@/components/Refers/refers.vue'
-import TreeRefers from '@/components/Refers/treeRefer.vue'
-import popDialog from '@/components/PopDialog/index.vue'
-import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-// 用于物料参照框数据
-import {getRefer} from '@/api/purchase/basic.js'
-import {getSummaryList, auditSummary, cancelAudits, confirmSummary , cancelSummary , shutDownSummary, editSummaryList, exportList, exportItems } from '@/api/purchase/DemandSummary.js'
-export default {
-  name: 'demandSummary',
-  dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
-  components: {
-    Add,
-    // colTol,
-    CollapseTransition,
-    Refers,
-    TreeRefers,
-    popDialog
-  },
-  data() {
-    return {
-      loading: true,
-      showColumn: {},
-      arrs:[],
-      tols: {
-        open: false
-      },
-      hangStatus(row) {
-        switch (row.row.status) {
-          case '0':
-            return '需补货'
-          case '1':
-            return '待计划确认'
-          case '2':
-            return '计划已确认'
-          case '3':
-            return '计划已审核'
-          case '4':
-            return '行关闭'
-          case '5':
-            return '总供应可满足'
-        }
-      },
-      formatterBusinessType(row) {
-        switch (row.row.businessType) {
-          case 'ZQBH':
-            return '周期备货'
-          case 'FXXQ':
-            return '分销需求'
-          case 'TSXQ':
-            return '特殊采购需求'
-          case 'BDXQ':
-            return '补单需求'
-          case 'JJXQ':
-            return '紧急需求单'
-          case 'XPXQ':
-            return '新品需求'
-          case 'HZBM':
-            return '合作部门需求'
-        }
-      },
-      formatterSource(row) {
-        switch (row.row.billSource) {
-          case '1':
-            return '手工导入'
-          case '2':
-            return '按客户计算'
-          case '3':
-            return '按仓库计算'
-          case '4':
-            return '手工新增'
-        }
-      },
-      expanded: false,
-      // 页面配置
-      isList: true,
-      // 页面状态
-      page: '',
-      queryParams: {
-        rowStatus: ['1'],
-        buyer: '',
-        buyerName: '',
-        materialClassifyFour: [],
-        manufacturer: '',
-        forecastClassification: '',
-        periodUnit: '',
-        departmentName: '',
-        puManagerAuditor: '',
-        // zqgdh: '',
-        code: '',
-        registrant: '',
-        businessType: '',
-        billSource: '',
-        customer: '',
-        lastWarehouse: '',
-        lastAllocation: '',
-        materialCodeList: [],
-        names: '',
-        purchaseOrg: '',
-        demandDate: '',
-        approverFinishTime: '',
-        isCustomerSpecified: '',
-        isUrgency: '',
-        additionalSupplier: '',
-        pageNum: 1,
-        pageSize: 50
-      },
-      personOptions: [],
-      classOptions: [],
-      deptOptions: [],
-      auditOptions: [],
-      customerOptions: [],
-      lastWarehouseOptions: [],
-      lastAllocationOptions: [],
-      orgOptions: [],
-      supplierOptions: [],
-      options: [{
-        value: 'Y', label: '是',
-      }, {
-        value: 'N', label: '否'
-      }],
-      referCondition: {
-        type: '',
-        isPage: true,
-        title: ''
-      },
-      tableList: [],
-      total: 0,
-      rowDetail: {},
-      disable: false,
-      lineDisable: true,
-      ids: [],
-      allSelection: [],
-      // 子表index
-      tableIndex: null,
-      // referConditionMx: {
-      //   type: '',
-      //   isPage: true,
-      //   title: ''
-      // }
-      // 用于保存临时记录修改行的数组
-      record:[]
-    }
-  },
-  created() {
-    this.$nextTick(() => {
-      // 手动将表格和工具栏进行关联
-      this.$refs.table.connect(this.$refs.xToolbar1)
-      this.getList(this.queryParams)
-    })
-  },
-  methods: {
-    checkColumnMethod ({ column }) {
-      if (column.property === 'role') {
-        return false
-      }
-      return true
-    },
-    resizableChangeEvent () {
-      const columns = this.$refs.table.getColumns()
-      const customData = columns.map(column => {
-        return {
-          width: column.renderWidth
-        }
-      })
-      console.log(customData)
-    },
-    reDraw() {
-      // this.$refs.table.doLayout();
-    },
-    // 单元格标红
-    cellClassName({row, column, rowIndex, columnIndex}) {
-      if(column.title == "需求可用周期" && Number(row.demandCycle) > 1.5 ) {
-        return 'success-row';
-      }
-    },
-    // 指定列合计
-    getSummaries(param) {
-      const { columns, data } = param;
-      const sums = [];
-      columns.forEach((column, index) => {
-        if (index === 0) {
-          sums.push('合计');
-          return;
-        }
-        const values = data.map(item => Number(item[column.property]));
-        if (column.property === 'demandNum' || column.property === 'netDemandNum' || column.property === 'artificialAdjust' || column.property === 'suggestBuyQty' || column.property === 'finalBuyQty') {
-          sums[index] = values.reduce((prev, curr) => {
-            const value = Number(curr);
-            if (!isNaN(value)) {
-              return prev + curr;
-            } else {
-              return prev;
-            }
-          }, 0);
-          sums[index];
-
-        }
-      });
-      return [sums]
-    },
-    // 搜索
-    search() {
-      this.getList(this.queryParams)
-    },
-    reset() {
-      this.queryParams = {
-        rowStatus: ['1'],
-        buyer: '',
-        buyerName: '',
-        materialClassifyFour: [],
-        manufacturer: '',
-        forecastClassification: '',
-        periodUnit: '',
-        departmentName: '',
-        puManagerAuditor: '',
-        // zqgdh: '',
-        code: '',
-        registrant: '',
-        businessType: '',
-        billSource: '',
-        customer: '',
-        lastWarehouse: '',
-        lastAllocation: '',
-        materialCodeList: [],
-        names: '',
-        purchaseOrg: '',
-        demandDate: '',
-        approverFinishTime: '',
-        isCustomerSpecified: '',
-        isUrgency: '',
-        additionalSupplier: '',
-        pageNum: 1,
-        pageSize: 50
-      }
-      this.getList(this.queryParams)
-    },
-    getList(params){
-      getSummaryList(params).then(res => {
-        if (res.code === 200) {
-          this.tableList = res.rows
-          this.total = res.total
-          // let arrs = []
-          // this.$refs.table.$children.forEach(item => {
-          //   if (item.label != undefined && item.prop != undefined) {
-          //     arrs.push({
-          //       label: item.label,
-          //       prop: item.prop
-          //     })
-          //   }
-          // })
-          // this.arrs = arrs
-        }
-      }).then(() => {
-        // 合计不显示重绘
-        this.$refs.table.doLayout()
-        this.loading = false
-      }).catch(err => {
-        this.loading = false
-      })
-    },
-    selectAllEvent({checked}) {
-      const selection = this.$refs.table.getCheckboxRecords()
-      console.log('选中', selection)
-      this.allSelection = selection
-      this.ids = selection.map(item => item.demandItemId)
-      console.log('选中数组', this.ids.join())
-    },
-    handleSelectionChange({checked}) {
-      const selection = this.$refs.table.getCheckboxRecords()
-      console.log('选中', selection)
-      this.allSelection = selection
-      this.ids = selection.map(item => item.demandItemId)
-      console.log('选中数组', this.ids.join())
-    },
-    handleCommand() {
-      this.$modal.loading("正在导出数据,请稍后...");
-      let param = this.queryParams
-      param.pageSize = this.total
-      exportItems(param).then(res => {
-        this.$modal.closeLoading();
-        const blob = new Blob([res], {
-          type: "application/vnd.ms-excel;charset=UTF-8",
-        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
-        const downloadElement = document.createElement("a"); //创建a标签
-        const href = window.URL.createObjectURL(blob); // 创建下载的链接
-        // var temp = res.headers["content-disposition"]; 
-        // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
-        // var name = fileName.split(";")[0]; //切割成文件名
-        downloadElement.href = href;  //下载地址
-        downloadElement.download = '采购需求处理导出'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
-        document.body.appendChild(downloadElement);
-        downloadElement.click(); // 点击下载
-        document.body.removeChild(downloadElement); // 下载完成移除元素
-        window.URL.revokeObjectURL(href); // 释放blob对象
-      })
-    },
-    check(row) {
-      this.isList = false
-      this.page = 'check'
-      this.rowDetail = row
-      this.disable = true
-    },
-    doubleClick({row}) {
-      this.isList = false
-      this.page = 'check'
-      this.rowDetail = row
-      this.disable = true
-    },
-    // 表格选中数据
-    rowSelect(row) {
-      // console.log(row)
-      this.$refs.table.toggleCheckboxRow(row.row);
-    },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-      this.queryParams.pageSize = val
-      this.getList(this.queryParams)
-    },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-      this.queryParams.pageNum = val
-      this.getList(this.queryParams)
-    },
-    drop() {
-      this.expanded = !this.expanded
-    },
-    editList() {
-      console.log('Lists`````',this.tableList)
-      this.lineDisable = false
-    },
-    cancelEdit() {
-      this.lineDisable = true
-      this.getList(this.queryParams)
-    },
-    saveList() {
-      // console.log('记录',this.record)
-      // 对记录的数据进行去重
-      let newRecord = Array.from(new Set(this.record))
-      // console.log('去重后的', newRecord)
-      let changeList = newRecord.map(i => {
-        return this.tableList[i]
-      })
-      // console.log('shuzu', changeList)
-      editSummaryList(changeList).then(res => {
-        if (res.code === 200) {
-          this.$modal.notifySuccess("保存成功");
-          this.lineDisable = true
-          this.getList(this.queryParams)
-        }
-      })
-    },
-    confirms() {
-      if (this.ids.length == 0) {
-        this.$modal.notifyWarning("请选中至少一条数据");
-      } else {
-        confirmSummary(this.allSelection).then(res => {
-          if (res.code === 200) {
-            this.$modal.notifySuccess("确认成功");
-            this.getList(this.queryParams)
-          }
-        })
-      }
-    },
-    cancels() {
-      if (this.ids.length == 0) {
-        this.$modal.notifyWarning("请选中至少一条数据");
-      } else {
-        let param = this.ids.join()
-        cancelSummary(param).then(res => {
-          if (res.code === 200) {
-            this.$modal.notifySuccess("取消成功");
-            this.getList(this.queryParams)
-          }
-        })
-      }
-    },
-    cancelAudit() {
-      if(this.ids.length == 0) {
-        this.$modal.notifyWarning("请选中至少一条数据");
-      } else {
-        let param = this.ids.join()
-        cancelAudits(param).then(res => {
-          if (res.code === 200) {
-            this.$modal.notifySuccess("审核成功");
-            this.getList(this.queryParams)
-          }
-        })
-      }
-    },
-    audits() {
-      if(this.ids.length == 0) {
-        this.$modal.notifyWarning("请选中至少一条数据");
-      } else {
-        let param = this.ids.join()
-        auditSummary(param).then(res => {
-          if (res.code === 200) {
-            this.$modal.notifySuccess("审核成功");
-            this.getList(this.queryParams)
-          }
-        }).catch(err => {
-          this.getList(this.queryParams)
-        })
-      }
-    },
-    // 行关闭
-    closeitem() {
-      let param = this.ids.join()
-      shutDownSummary(param).then(res => {
-        if (res.code === 200) {
-          this.$modal.notifySuccess("操作成功");
-          this.getList(this.queryParams)
-        }
-      })
-    },
-    closeLine() {
-      if (this.ids.length == 0) {
-        this.$modal.notifyWarning("请选中至少一条数据");
-      } else {
-        console.log('选中数组', this.allSelection)
-        let item = this.allSelection.some(item => {
-          return item.demandNum >= 2
-        })
-        if (item) {
-          this.$modal.confirm('选中项有多个需求单位,是否确定关闭?').then(function () {
-          }).then(() => {
-            this.closeitem()
-          }).catch(() => {})
-        } else {
-          this.closeitem()
-        }
-      }
-    },
-    // 搜索区参照选择
-    chooseRefer(type, isPage, title, stordocId) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.referCondition.stordocId = stordocId
-      this.$refs.refer.init(this.referCondition)
-    },
-    selectionsToInput(selection) {
-      if (this.referCondition.title == '采购员') {
-        this.personOptions = selection
-        this.queryParams.buyer = selection[0].code
-        this.queryParams.buyerName = selection[0].name
-      }
-      if (this.referCondition.title == '业务部门') {
-        this.deptOptions = selection
-        this.queryParams.departmentName = selection[0].id
-      }
-      if (this.referCondition.title == '审核人') {
-        this.auditOptions = selection
-        this.queryParams.puManagerAuditor = selection[0].code
-      }
-      if (this.referCondition.title == '需求客户') {
-        this.customerOptions = selection
-        this.queryParams.customer = selection[0].id
-      }
-      if (this.referCondition.title == '供应仓库') {
-        this.lastWarehouseOptions = selection
-        this.queryParams.lastWarehouse = selection[0].id
-      }
-      if (this.referCondition.title == '供应库位') {
-        this.lastAllocationOptions = selection
-        this.queryParams.lastAllocation = selection[0].id
-      }
-      if (this.referCondition.title == '默认采购组织') {
-        this.orgOptions = selection
-        this.queryParams.purchaseOrg = selection[0].id
-      }
-      if (this.referCondition.title == '明细采购员') {
-        console.log('选择进了吗',this.tableList)
-        this.record.push(this.tableIndex)
-        this.tableList[this.tableIndex].buyer = selection[0].code
-        this.tableList[this.tableIndex].buyerName = selection[0].name
-      }
-      if (this.referCondition.type == 'SUPPLIER_PARAM') {
-        this.supplierOptions = selection
-        this.queryParams.additionalSupplier = selection[0].id
-      }
-      // if (this.referCondition.title == '明细默认采购组织') {
-      //   console.log('选择进了吗',this.tableList)
-      //   this.tableList[this.tableIndex].purchaseOrg = selection[0].id
-      //   this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
-      // }
-    },
-    // 搜索区树形选择
-    chooseTreeRefer(type, isPage, title) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.$refs.tree.init(this.referCondition)
-    },
-    selectionsToInput2(selection) {
-      this.classOptions = selection
-      this.queryParams.materialClassifyFour = selection.map(item => {return item.id})
-    },
-    // 搜索区物料编码
-    chooseMaterial() {
-      this.$refs.materialRefer.init()
-    },
-    selectMaterial(selection) {
-      console.log('选择的物料', selection)
-      this.queryParams.materialCodeList = selection.map(item => {return item.code})
-      console.log(this.queryParams.materialCodeList)
-      this.queryParams.names = (selection.map(item => {return item.name})).join(',')
-    },
-    // 清空物料搜索框
-    clearMaterial() {
-      this.queryParams.names = ''
-      this.queryParams.materialCodeList = []
-    },
-    // 粘贴来的数据
-    async pasteMe(e) {
-      this.$modal.loading("正在粘贴数据...");
-      e.preventDefault() //阻止默认粘贴事件
-      let source = e.clipboardData.getData("Text");
-      console.log('source', source)
-      // 这里区分普通复制和在表格内复制,判断是否包含','
-      // 没找到,就通过表格复制
-      if (source.indexOf(",") === -1) {
-        // 首先对源头进行解析
-        let rows = source.split("\r\n"); // 拆成一个数组
-        // 数组去除空字符串
-        rows = rows.filter(item => {
-          return item && item.trim()
-        })
-        await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-          this.$modal.closeLoading();
-          if (res.code === 200) {
-            let rowList = res.rows
-            console.log('粘贴的', rowList)
-            this.queryParams.materialCodeList = rowList.map(item => {return item.code})
-            this.queryParams.names = (rowList.map(item => {return item.code})).join(',')
-          }
-        }).catch(err => {
-          this.$modal.closeLoading();
-        })
-      } else {
-        // 找到了,按,分割
-        let codelist = source.split(',')
-        console.log('按照逗号分隔', codelist)
-        // 数组去除空字符串
-        codelist = codelist.filter(item => {
-          return item && item.trim()
-        })
-        this.queryParams.materialCodeList = codelist
-        this.queryParams.names = codelist.join(',')
-        this.$modal.closeLoading();
-      }
-    },
-        // 明细行选择业务部门参照带出业务部门数据
-    chooseSon(index, type, isPage, title) {
-      this.tableIndex = index
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.$refs.refer.init(this.referCondition)
-    },
-    jilu(index) {
-      this.record.push(index)
-    },
-    // 清空搜索区采购员
-    cleanBuyer() {
-      this.queryParams.buyer = ''
-      this.queryParams.buyerName = ''
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-#demandSummary {
-  padding: 12px;
-  box-sizing: border-box;
-  overflow-y: scroll;
-}
-.btn_grooup {
-  margin-bottom: 10px;
-  display: flex;
-  justify-content: flex-end;
-}
-.lines {
-  margin-top: 0;
-}
-.hang {
-  margin: auto;
-}
-.hang ::v-deep .el-form-item__content{
-  margin-left: 0px !important;
-}
-.el-pagination {
-  margin-top: 10px;
-  text-align: right;
-}
-::v-deep .vxe-body--row > td {
-  border-right: none;
-}
- ::v-deep .el-card .el-form-item {
-  margin-bottom: 3px;
-}
-::v-deep .vxe-body--row .success-row {
-  background-color: #ff8a8a!important;
-}
-</style>
-<style>
-.exporttable {
-  border: solid 1px #c0c0c0;
- }
-</style>

Fișier diff suprimat deoarece este prea mare
+ 574 - 159
src/views/purchase/DemandSummary/index copy.vue


Fișier diff suprimat deoarece este prea mare
+ 111 - 1320
src/views/purchase/DemandSummary/index.vue


+ 14 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -454,6 +454,13 @@
           />
           <ux-table-column
             resizable
+            title="物料备注"
+            align="center"
+            field="materialRemark"
+            width="150px"
+          />
+          <ux-table-column
+            resizable
             title="单位"
             align="center"
             field="unitName"
@@ -1669,7 +1676,7 @@ export default {
         }
       } catch (error) {}
     },
-   
+
     // 改变需求计划改变需求日期
     changeplanType(val) {
       this.dafaultDate();
@@ -1872,6 +1879,7 @@ export default {
       }
     },
     async save() {
+      console.log(this.basicForm, "this.basicForm");
       if (this.basicForm.puDemandItemList.length !== 0) {
         this.$refs["basic"].validate((valid, obj) => {
           if (valid) {
@@ -2705,6 +2713,9 @@ export default {
               res.rows[0].buyerName;
           }
         });
+        // 2024.03.29 增加物料备注
+        this.basicForm.puDemandItemList[this.tableIndex].materialRemark =
+          selection[0].remark;
         this.basicForm.puDemandItemList[this.tableIndex].materialCode =
           selection[0].code;
         this.basicForm.puDemandItemList[this.tableIndex].material =
@@ -2805,6 +2816,8 @@ export default {
           // 物料存储条件和运输条件
           line.transportationCondition = selection[i].transportationCondition;
           line.storageCondition = selection[i].storageCondition;
+          // 2024.03.29 增加物料备注
+          line.materialRemark = selection[i].remark;
           // this.basicForm.puDemandItemList.push(line)
           newLine.push(line);
         }

+ 40 - 8
src/views/purchase/purchase-order/add/column.js

@@ -410,7 +410,6 @@ const PurchaseTabColumns = [
         disabled: true,
         require: false,
       },
-
       {
         key: "materialCode",
         title: "物料编码",
@@ -442,13 +441,21 @@ const PurchaseTabColumns = [
           registration: 'registrationNo',
           isDrug: 'isDrug',
           rateCode: "materialRateName",
+          materialManufacturersCode: "materialManufacturersCode",
+          materialRemark: "remark",
         },
         queryParams: () => ({}),
         width: 180,
       },
       {
-        // key: "materialCode",
-        // title: "物料编码",
+        key: "materialManufacturersCode",
+        title: "厂家物料编码",
+        inputType: "Input",
+        width: 180,
+        disabled: true,
+        readonly: true,
+      },
+      {
         key: "materialName",
         title: "物料名称",
         inputType: "Input",
@@ -457,7 +464,7 @@ const PurchaseTabColumns = [
         disabled: true,
         readonly: true,
       },
-      { //specification
+      {
         key: "specification",
         title: "规格",
         inputType: "Input",
@@ -465,13 +472,21 @@ const PurchaseTabColumns = [
         disabled: true,
         readonly: true,
       },
-      { //model
+      {
         key: "model",
         title: "型号",
         inputType: "Input",
         disabled: true,
         readonly: true,
       },
+      {
+        key: "materialRemark",
+        title: "物料备注",
+        inputType: "Input",
+        disabled: true,
+        width: 180,
+        readonly: true,
+      },
       { // manufacturerId  manufacturerIdName
         key: "manufacturerName",
         title: "生产厂家代理人",
@@ -1224,7 +1239,6 @@ const CauseTabColumns = [
         disabled: true,
         require: false,
       },
-
       {
         key: "materialCode",
         title: "物料编码",
@@ -1256,10 +1270,20 @@ const CauseTabColumns = [
           registration: 'registrationNo',
           isDrug: 'isDrug',
           rateCode: "materialRateName",
+          materialManufacturersCode: "materialManufacturersCode",
+          materialRemark: "remark",
         },
         queryParams: () => ({}),
       },
       {
+        key: "materialManufacturersCode",
+        title: "厂家物料编码",
+        inputType: "Input",
+        width: 180,
+        disabled: true,
+        readonly: true,
+      },
+      {
         key: "materialName",
         title: "物料名称",
         inputType: "Input",
@@ -1268,7 +1292,7 @@ const CauseTabColumns = [
         disabled: true,
         readonly: true,
       },
-      { //specification
+      {
         key: "specification",
         title: "规格",
         inputType: "Input",
@@ -1276,13 +1300,21 @@ const CauseTabColumns = [
         disabled: true,
         readonly: true,
       },
-      { //model
+      {
         key: "model",
         title: "型号",
         inputType: "Input",
         disabled: true,
         readonly: true,
       },
+      {
+        key: "materialRemark",
+        title: "物料备注",
+        inputType: "Input",
+        disabled: true,
+        readonly: true,
+        width: 180,
+      },
       { //isMedicine  isMedicineValue
         key: "isMedcine",
         title: "医药物料",

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

@@ -293,7 +293,7 @@ export default {
           ).tableColumns;
 
           let rowData = initParams(arr, "key", "value");
-          console.log(rowData, "rowData");
+          // console.log(rowData, "rowData");
 
           "rowno" in rowData &&
             (rowData["rowno"] = this.params[key].length
@@ -643,7 +643,7 @@ export default {
         source.deliveryDate = new Date(
           new Date(params.createTime).getTime() + DPtime
         ).Format("yyyy-MM-dd HH:mm:ss");
-        
+
         try {
           // try
           this.loading = true;

+ 19 - 5
src/views/purchase/purchase-order/column.js

@@ -838,7 +838,12 @@ const PurTabColumns = [
         attr: {
           isHidden: true,
         },
-
+      },
+      {
+        item: { key: "materialManufacturersCode", title: "厂家物料编码", width: 150, },
+        attr: {
+          isHidden: true,
+        },
       },
       {
         item: { key: "materialName", title: "物料名称", width: 150, },
@@ -861,6 +866,12 @@ const PurTabColumns = [
         },
       },
       {
+        item: { key: "materialRemark", title: "物料备注", width: 180, },
+        attr: {
+          isHidden: true,
+        },
+      },
+      {
         item: { key: "manufacturerName", title: "生产厂家代理人", width: 150, },
         attr: {
           isHidden: true,
@@ -1188,25 +1199,28 @@ const CommonTabColumns = [
       },
       // { item:{key: "materialClassify", title: "物料分类",  },},
       {
-        item: { key: "materialManufacturersCode", title: "厂家物料编码", width: 100, },
+        item: { key: "materialManufacturersCode", title: "厂家物料编码", width: 150, },
         attr: {
           isHidden: true,
         },
-
       },
       {
         item: { key: "specification", title: "规格", width: 100, },
         attr: {
           isHidden: true,
         },
-
       },
       {
         item: { key: "model", title: "型号", width: 100 },
         attr: {
           isHidden: true,
         },
-
+      },
+      {
+        item: { key: "materialRemark", title: "物料备注", width: 180, },
+        attr: {
+          isHidden: true,
+        },
       },
       {
         item: { key: "customerName", title: "收货客户", width: 100, },

+ 98 - 0
src/views/report/summary-sheet/columns.js

@@ -0,0 +1,98 @@
+export default function useColumns() {
+  const SearchColumns = [
+    {
+      item: { key: "", title: "开始时间", },
+      attr: {
+        is: "el-date-picker",
+        type: "date",
+        placeholder: "选择日期",
+        valueFormat: "yyyy-MM-dd",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "", title: "结束时间", },
+      attr: {
+        is: "el-date-picker",
+        type: "date",
+        placeholder: "选择日期",
+        valueFormat: "yyyy-MM-dd",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "", title: "日志类型", },
+      attr: {
+        is: "el-select",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "", title: "员工", },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "CONTACTS_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          // buyer: "code",
+        },
+      },
+    },
+    // {
+    //   item: { key: "", title: "员工姓名", },
+    //   attr: {
+    //     is: "el-input",
+    //     clearable: true,
+    //   },
+    // },
+  ];
+
+  const TableColumns = [
+    {
+      item: { key: "", title: "员工工号", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "员工姓名", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "一级部门", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "二级部门", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "三级部门", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "应交份数", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "实交份数", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "缺交份数", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "休假", },
+      attr: {},
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
+  }));
+  return { SearchColumns, TableColumns }
+}

+ 14 - 0
src/views/report/summary-sheet/dicts.js

@@ -0,0 +1,14 @@
+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);

+ 112 - 0
src/views/report/summary-sheet/index.vue

@@ -0,0 +1,112 @@
+<!-- 日志汇总查询 -->
+<script>
+import { dicts } from "./dicts";
+import useColumns from "./columns";
+export default {
+  name: "SummarySheet",
+  dicts: [...dicts],
+  components: {
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+  },
+  data() {
+    const { SearchColumns, TableColumns } = useColumns();
+    const params = this.$init.params(SearchColumns);
+    const page = this.$init.page();
+    return {
+      page,
+      params,
+      TableColumns,
+      SearchColumns,
+      size: "mini",
+      loading: false,
+      tableData: [],
+      selectData: [],
+    };
+  },
+  computed: {},
+  methods: {
+    // 重置
+    useReset() {
+      this.params = this.$init.params(this.SearchColumns);
+      this.page = this.$init.page();
+      this.useQuery(this.params, this.page);
+    },
+    useQuery(params, page) {
+      try {
+        this.loading = true;
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 导出
+    useExport() {
+      try {
+      } catch (error) {}
+    },
+    useSelect(selection) {
+      this.selectData = selection;
+    },
+  },
+  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>
+        <el-button :size="size" @click="useExport">导 出</el-button>
+      </el-button-group>
+    </el-row>
+
+    <el-super-ux-table
+      v-model="tableData"
+      :size="size"
+      :dict="dict"
+      :page="page"
+      :columns="TableColumns"
+      checkbox
+      pagination
+      convenitentOperation
+      storage-key="SummarySheetSuperTable"
+      @row-select="useSelect"
+      @pagination="useQuery(params, page)"
+    >
+    </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>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff