cz 1 éve
szülő
commit
4079ffce07

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

@@ -294,6 +294,9 @@ export default defineComponent({
       //   tableHeight.value = 550;
       // }
       tableHeight.value = window.innerHeight - 225;
+      if (props.hidePagination) {
+        tableHeight.value += 38;
+      }
     };
     getTableHeight();
     window.addEventListener("resize", () => {

+ 10 - 29
src/components/process/SF/Contract.vue

@@ -136,7 +136,7 @@
                   <div style="margin-bottom:10px;">
                     <TitleInfo content='BOM单:'></TitleInfo>
                   </div>
-                  <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
+                  <el-table :data="scope.row.contractProductBomList" style="width: 100%;" border class="bom-table">
                     <el-table-column label="图片" width="80">
                       <template #default="{ row }">
                         <div v-if="row.fileUrl">
@@ -969,7 +969,7 @@ const handlePerson = (item) => {
     formData.data.buyContactNumber = data[0].contactNo;
   }
 };
-const quotationProductBomList = ref([]);
+const contractProductBomList = ref([]);
 const selectProduct = (goods) => {
   if (goods && goods.id) {
     let fileUrl = "";
@@ -978,7 +978,7 @@ const selectProduct = (goods) => {
     }
     proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
       if (res.productBomDetailList && res.productBomDetailList.length > 0) {
-        quotationProductBomList.value = res.productBomDetailList.map((x) => ({
+        contractProductBomList.value = res.productBomDetailList.map((x) => ({
           fileUrl: "",
           materialId: x.materialId,
           productName: x.materialName,
@@ -1007,14 +1007,14 @@ const selectProduct = (goods) => {
           amount: "",
           remark: "",
           fileList: [],
-          quotationProductBomList: quotationProductBomList.value,
+          contractProductBomList: contractProductBomList.value,
         });
         proxy.msgTip("添加成功", 1);
         changeProductPrice();
-        let ids = quotationProductBomList.value.map((x) => x.materialId);
+        let ids = contractProductBomList.value.map((x) => x.materialId);
         proxy.getFile(
           ids,
-          quotationProductBomList.value,
+          contractProductBomList.value,
           "materialId",
           "fileList",
           "fileUrl"
@@ -1302,17 +1302,7 @@ const getAllData = (businessId) => {
       formData.data.contractProductList &&
       formData.data.contractProductList.length > 0
     ) {
-      let productIds = formData.data.contractProductList.map(
-        (x) => x.productId
-      );
-      proxy.getFile(
-        productIds,
-        formData.data.contractProductList,
-        "productId",
-        "fileListOne",
-        "fileUrl"
-      );
-
+      getFileData();
       let ids = formData.data.contractProductList.map((x) => x.id);
       proxy.getFile(
         ids,
@@ -1336,7 +1326,7 @@ const getFileData = () => {
   let ids = [];
   formData.data.contractProductList.map((x) => {
     ids.push(x.productId);
-    x.quotationProductBomList.map((y) => {
+    x.contractProductBomList.map((y) => {
       ids.push(y.materialId);
     });
   });
@@ -1350,7 +1340,7 @@ const getFileData = () => {
         if (fileObj[x.productId] && fileObj[x.productId].length > 0) {
           x.fileUrl = fileObj[x.productId][0].fileUrl;
         }
-        x.quotationProductBomList.map((y) => {
+        x.contractProductBomList.map((y) => {
           y.fileList = fileObj[y.materialId] || [];
           if (y.fileList && y.fileList.length > 0) {
             y.fileUrl = y.fileList[0].fileUrl;
@@ -1396,7 +1386,7 @@ const getPriceSheetData = (id) => {
       price: x.price,
       amount: x.amount,
       fileList: [],
-      quotationProductBomList: x.quotationProductBomList.map((y) => {
+      contractProductBomList: x.quotationProductBomList.map((y) => {
         y.quotationProductBomId = y.id;
         delete y.id;
         return y;
@@ -1404,15 +1394,6 @@ const getPriceSheetData = (id) => {
     }));
     changeProductPrice();
     getFileData();
-    // let productIds = formData.data.contractProductList.map((x) => x.productId);
-    // proxy.getFile(
-    //   productIds,
-    //   formData.data.contractProductList,
-    //   "productId",
-    //   "fileListOne",
-    //   "fileUrl"
-    // );
-    // totalAmount();
     formData.data.countryId = res.buyCountryId;
     formData.data.provinceId = res.buyProvinceId;
     formData.data.cityId = res.buyCityId;

+ 1 - 0
src/views/EHSD/procurement/profitSettlementEHSD/index.vue

@@ -480,5 +480,6 @@ const changeStyle = ({ row }) => {
     .el-table .el-table__fixed-header-wrapper th
   ) {
   background-color: #f5f7fa !important;
+  height: 40px !important;
 }
 </style>

+ 18 - 9
src/views/MES/productionScheduling/index.vue

@@ -8,9 +8,19 @@
 
         <template #product="{ item }">
           <div style="width:100%; ">
-            {{item.productName}}
+            <el-popover placement="bottom-start" title="" :width="300" trigger="hover">
+              <div default>
+                {{item.productName}}
+              </div>
+              <template #reference>
+                <div style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer">
+                  {{item.productName}}
+                </div>
+              </template>
+            </el-popover>
           </div>
         </template>
+
         <template #date="{ item }">
           <div style="width:100%; ">
             <div>{{item.createTime}} ~ {{item.deliveryPeriod}}</div>
@@ -125,7 +135,7 @@ const changDay = (val) => {
       label: `${ele.substr(8, 10)}`,
       slot: "day" + ele,
       isNeedHeaderSlot: false,
-      width: 40,
+      width: 35,
       align: "center",
       fixed: "right",
     };
@@ -137,11 +147,6 @@ const changDay = (val) => {
 };
 const selectConfig = computed(() => [
   {
-    label: "生产状态",
-    prop: "produceStatus",
-    data: statusData.value,
-  },
-  {
     type: "time",
     itemType: "month",
     label: "排程日期",
@@ -155,19 +160,22 @@ const selectConfig = computed(() => [
     },
   },
 ]);
+
 const config = ref([
   {
     attrs: {
       label: "生产订单号",
       prop: "code",
       width: 130,
+      align: "center",
     },
   },
   {
     attrs: {
       label: "生产日期",
       slot: "date",
-      width: 150,
+      width: 180,
+      align: "center",
     },
   },
   {
@@ -175,6 +183,7 @@ const config = ref([
       label: "产品",
       slot: "product",
       "min-width": 300,
+      // align: "center",
     },
   },
 ]);
@@ -186,7 +195,7 @@ const getList = (req) => {
     (res) => {
       sourceList.value.data = res.map((x, index) => ({
         ...x,
-        id: "id" + index,
+        // id: "id" + index,
         createTime: x.createTime.substr(0, 10),
         deliveryPeriod: x.deliveryPeriod.substr(0, 10),
       }));

+ 1 - 1
src/views/process/processApproval/index.vue

@@ -529,7 +529,7 @@ const skipPage = () => {
   useTagsStore.delVisitedView(router.currentRoute.value);
   if (route.query.processType) {
     router.replace({
-      path: "/oa/1/backlog",
+      name: "Backlog",
     });
   } else {
     proxy.msgTip("操作成功");

+ 165 - 75
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

@@ -1,15 +1,20 @@
 <template>
-  <div class="pageIndexClass">
+  <div class="user">
+    <div class="tree">
+      <TreeList title="分类" submitType="2" :hiddenBtn="true" :data="treeListData" v-model="sourceList.pagination.productClassifyId"
+                @change="treeChange">
+      </TreeList>
+    </div>
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
                highlight-current-row :action-list="[
-          selectStatus
+        ]" @get-list="getList">
+        <!-- selectStatus
             ? {}
             : {
                 text: '导出Excel',
                 action: () => deriveExcel(),
-              },
-        ]" @get-list="getList">
+              }, -->
         <template #btn="{ item }">
           <div style="width: 100%; text-align: center">
             <el-button type="primary" @click="checkTheFlow(item)" v-if="!selectStatus" text>查看流水</el-button>
@@ -20,7 +25,7 @@
           </div>
         </template>
       </byTable>
-      <div v-if="goodList && goodList.length > 0">
+      <!-- <div v-if="goodList && goodList.length > 0">
         <div>已选择货品</div>
         <div style="margin: 10px 0px">
           <el-tag style="margin-right: 10px" type="info" closable v-for="(good, index) in goodList" :key="good.id"
@@ -32,7 +37,7 @@
             确 定
           </el-button>
         </div>
-      </div>
+      </div> -->
     </div>
   </div>
 </template>
@@ -41,12 +46,17 @@
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import useUserStore from "@/store/modules/user";
+import TreeList from "./treeList.vue";
 import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
   selectStatus: Boolean,
   warehouseId: String,
+  rowId: {
+    type: String,
+    default: "",
+  },
 });
 const warehouseList = ref([]);
 const sourceList = ref({
@@ -56,7 +66,9 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
-    id: "",
+    companyId: "",
+    definition: "",
+    productClassifyId: "",
   },
 });
 const productUnit = ref([]);
@@ -71,15 +83,19 @@ const definition = ref([
   },
 ]);
 const loading = ref(false);
+const companyData = ref([]);
 const selectConfig = computed(() => {
-  if (props.warehouseId) {
-    return [];
-  }
   return [
     {
-      label: "仓库名称",
-      prop: "id",
-      data: warehouseList.value,
+      label: "归属公司",
+      prop: "companyId",
+      data: companyData.value,
+      isShowAll: false,
+    },
+    {
+      label: "物品类型",
+      prop: "definition",
+      data: definition.value,
     },
   ];
 });
@@ -88,18 +104,15 @@ const config = computed(() => {
     {
       attrs: {
         label: "仓库名称",
-        prop: "warehouseId",
-        width: 220,
-      },
-      render(type) {
-        return proxy.dictValueLabel(type, warehouseList.value);
+        prop: "warehouseName",
+        width: 150,
       },
     },
     {
       attrs: {
         label: "物品类型",
         prop: "productDefinition",
-        width: 140,
+        width: 80,
       },
       render(type) {
         return proxy.dictValueLabel(type, definition.value);
@@ -109,14 +122,14 @@ const config = computed(() => {
       attrs: {
         label: "所属分类",
         prop: "productClassifyName",
-        width: 140,
+        width: 150,
       },
     },
     {
       attrs: {
         label: "物品编码",
-        prop: "productCode",
-        width: 160,
+        prop: "productCustomCode",
+        width: 150,
       },
     },
     {
@@ -133,16 +146,16 @@ const config = computed(() => {
         width: 160,
       },
     },
-    {
-      attrs: {
-        label: "单位",
-        prop: "productUnit",
-        width: 120,
-      },
-      render(unit) {
-        return proxy.dictKeyValue(unit, productUnit.value);
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "单位",
+    //     prop: "productUnit",
+    //     width: 120,
+    //   },
+    //   render(unit) {
+    //     return proxy.dictKeyValue(unit, productUnit.value);
+    //   },
+    // },
     {
       attrs: {
         label: "库存数量",
@@ -158,56 +171,104 @@ const config = computed(() => {
       },
     },
 
-    {
-      attrs: {
-        label: "操作",
-        slot: "btn",
-        width: 120,
-        fixed: "right",
-        align: "center",
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "操作",
+    //     slot: "btn",
+    //     width: 120,
+    //     fixed: "right",
+    //     align: "center",
+    //   },
+    // },
   ];
 });
+
+const treeListData = ref([]);
+
+const arrayRecursion = (arr, definition) => {
+  arr.forEach((item) => {
+    item.definition = definition;
+    if (item.children && item.children.length > 0) {
+      arrayRecursion(item.children, definition);
+    }
+  });
+  return arr;
+};
 const getDict = () => {
-  proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      warehouseList.value = res.rows.map((item) => {
-        return {
-          label: item.name,
-          value: item.id,
-        };
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
+    })
+    .then((res) => {
+      companyData.value = res.data.map((x) => ({
+        ...x,
+        label: x.deptName,
+        value: x.deptId,
+      }));
+      if (res.data && res.data.length > 0) {
+        sourceList.value.pagination.companyId = companyData.value[0].value;
+      }
+      getList();
+    });
+
+  Promise.all([
+    proxy.post("/productClassify/tree", {
+      parentId: "",
+      name: "",
+      definition: "1",
+    }),
+    proxy.post("/productClassify/tree", {
+      parentId: "",
+      name: "",
+      definition: "2",
+    }),
+  ]).then((res) => {
+    if (res && res.length > 1) {
+      res[1].forEach((x) => {
+        x.id = x.id + "";
       });
+      treeListData.value = [
+        {
+          id: "-1",
+          label: "全部",
+          parentId: "",
+          children: [
+            {
+              id: "1",
+              definition: "1",
+              label: "产品",
+              parentId: "-1",
+              children: arrayRecursion(res[0], "1"),
+            },
+            {
+              id: "2",
+              definition: "2",
+              label: "物料",
+              parentId: "-1",
+              children: arrayRecursion(res[1], "2"),
+            },
+          ],
+        },
+      ];
     }
   });
-  proxy.getDict(["unit"]).then((res) => {
-    productUnit.value = res["unit"];
-  });
-  // proxy
-  //   .post("/dictTenantData/page", {
-  //     pageNum: 1,
-  //     pageSize: 999,
-  //     dictCode: "product_type",
-  //     tenantId: useUserStore().user.tenantId,
-  //   })
-  //   .then((res) => {
-  //     if (res.rows && res.rows.length > 0) {
-  //       productType.value = res.rows.map((item) => {
-  //         return {
-  //           label: item.dictValue,
-  //           value: item.dictKey,
-  //         };
-  //       });
-  //     }
-  //   });
 };
-const getList = async (req) => {
+
+const getList = (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  if (props.warehouseId) {
-    sourceList.value.pagination.id = props.warehouseId;
+  let url = "";
+  if (props.rowId) {
+    sourceList.value.pagination.snapshotId = props.rowId;
+    url = "/stockSnapshotDetails/page";
+  } else {
+    url = "/stock/page";
   }
-  proxy.post("/stock/page", sourceList.value.pagination).then((res) => {
+  proxy.post(url, sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -215,8 +276,29 @@ const getList = async (req) => {
     }, 200);
   });
 };
+
+const treeChange = (e) => {
+  if (e.id != undefined && e.id != "-1") {
+    let productClassifyId = "";
+    if (["1", "2"].includes(e.id)) {
+      sourceList.value.pagination.productClassifyId = "";
+      sourceList.value.pagination.definition = e.id;
+    } else {
+      if (e.id != e.definition) {
+        productClassifyId = e.id;
+      }
+      sourceList.value.pagination.productClassifyId = productClassifyId;
+      sourceList.value.pagination.definition = e.definition;
+    }
+    getList();
+  } else {
+    sourceList.value.pagination.productClassifyId = "";
+    sourceList.value.pagination.definition = "";
+    getList();
+  }
+};
 getDict();
-getList();
+
 const checkTheFlow = (item) => {
   proxy.$router.replace({
     path: "/purchaseSales/stockManage/record",
@@ -278,7 +360,15 @@ const handleSubmit = () => {
 .tenant {
   padding: 20px;
 }
-::v-deep(.el-input-number .el-input__inner) {
-  text-align: left;
+.user {
+  padding: 10px;
+  display: flex;
+  justify-content: space-between;
+  .tree {
+    width: 300px;
+  }
+  .content {
+    width: calc(100% - 310px);
+  }
 }
 </style>

+ 297 - 0
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/treeList.vue

@@ -0,0 +1,297 @@
+<template>
+  <div class="treeList">
+    <div class="title commons-title">
+      {{ title }}
+    </div>
+    <div class="search">
+      <el-input v-model="search" placeholder="请输入搜索内容" clearable @clear="search = ''" @keyup.enter="searchChange"></el-input>
+      <!-- <el-button type="primary" @click="searchChange">搜索</el-button> -->
+      <el-button type="primary" plain @click="add({ id: 0 })" v-if="!hiddenBtn">
+        <el-icon :size="20">
+          <Plus />
+        </el-icon>
+      </el-button>
+    </div>
+    <div class="box">
+      <el-tree :data="data" ref="tree" node-key="id" @node-click="treeChange" default-expand-all :expand-on-click-node="false"
+               :filter-node-method="filterNode">
+        <template #default="{ node, data }">
+          <div class="custom-tree-node">
+            <div style="flex: 1">{{ node.label }}</div>
+            <!-- <div style="float: right; width: 71px; margin-left: 10px" v-if="node.label != '全部'">
+              <el-icon :size="17" @click.stop.native="() => edit(node, data)" v-if="getShowIcon(data)">
+                <Edit />
+              </el-icon>
+              <el-icon :size="17" style="margin-left: 10px" @click.stop.native="() => add(data)">
+                <Plus />
+              </el-icon>
+              <el-icon :size="17" style="margin-left: 10px" @click.stop.native="() => del(data)" v-if="getShowIcon(data)">
+                <Delete />
+              </el-icon>
+            </div> -->
+            <el-popover placement="bottom-start" title="" :width="100" trigger="hover">
+              <div default style="display: flex;justify-content:space-around">
+                <el-icon :size="17" style="cursor:pointer" @click.stop.native="() => edit(node, data)" v-if="getShowIcon(data)">
+                  <Edit />
+                </el-icon>
+                <el-icon :size="17" style="cursor:pointer" @click.stop.native="() => add(data)">
+                  <Plus />
+                </el-icon>
+                <el-icon :size="17" style="cursor:pointer" @click.stop.native="() => del(data)" v-if="getShowIcon(data)">
+                  <Delete />
+                </el-icon>
+              </div>
+              <template #reference>
+                <span class="iconfont icon_more iconColor" style="padding-bottom: 5px; margin-left: auto;margin-right:8px"
+                      v-if="node.label != '全部' && !hiddenBtn">...</span>
+              </template>
+            </el-popover>
+          </div>
+        </template>
+      </el-tree>
+    </div>
+
+    <el-dialog :title="treeModalType == 'add' ? '添加分类' : '编辑分类'" v-model="treeModal" width="400" v-loading="loading">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+      </byForm>
+      <template #footer>
+        <el-button @click="treeModal = false" size="default">取 消</el-button>
+        <el-button type="primary" @click="submitForm('byform')" size="default" :loading="submitLoading">
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script setup>
+import { toRaw } from "vue";
+import { ElMessage, ElMessageBox } from "element-plus";
+import byForm from "@/components/byForm/index";
+
+const props = defineProps({
+  title: {
+    type: String,
+    default: "分类",
+  },
+  submitType: {
+    type: String,
+    default: "1", //默认产品
+  },
+  hiddenBtn: {
+    type: Boolean,
+    default: false,
+  },
+  data: {
+    type: Array,
+    default: [],
+  },
+});
+onMounted(() => {});
+const search = ref("");
+const emit = defineEmits(["update:modelValue"]);
+const { proxy } = getCurrentInstance();
+const treeChange = (e, data) => {
+  if (proxy.type == "radio") {
+    emit("update:modelValue", e.id);
+    emit("change", e);
+  } else {
+    emit("change", e);
+  }
+};
+
+// const filterNode = (value, data, node) => {
+//   if (!value) return true;
+//   return data.label.indexOf(value) !== -1;
+// };
+const getParents = (node, name, key) => {
+  if (node.parent && node.parent.data[key]) {
+    name += node.parent.data[key];
+    return getParents(node.parent, name, key);
+  }
+  return name;
+};
+// 以下可实现搜索显示子节点
+const filterNode = (value, data, node) => {
+  let names = getParents(node, node.data.label, "label");
+  let isName = names.indexOf(value) !== -1;
+  return !value || isName ? true : false;
+};
+
+const searchChange = () => {
+  proxy.$refs.tree.filter(search.value);
+};
+const byform = ref(null);
+const treeListData = ref([]);
+let treeModal = ref(false);
+let submitLoading = ref(false);
+let treeModalType = ref("add");
+let currentNode = reactive({
+  id: "",
+});
+let formData = reactive({
+  data: {
+    name: "",
+    parentId: "",
+    definition: props.submitType,
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+let rules = ref({
+  name: [{ required: true, message: "请输入分类名称", trigger: "blur" }],
+  sort: [{ required: true, message: "请输入分类排序", trigger: "blur" }],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "name",
+      label: "分类名称",
+    },
+    {
+      type: "number",
+      prop: "sort",
+      label: "分类排序",
+      precision: 0,
+      min: 0,
+    },
+  ];
+});
+const add = (data) => {
+  treeModal.value = true;
+  treeModalType.value = "add";
+  formData.data = {
+    name: "",
+    parentId: "",
+    definition: props.submitType,
+  };
+  formData.data.parentId = data.id;
+};
+
+const edit = (node, data) => {
+  treeModal.value = true;
+  treeModalType.value = "edit";
+  formData.data = {
+    name: data.label,
+    id: data.id,
+    definition: props.submitType,
+    sort: data.sort,
+  };
+};
+
+const del = (data) => {
+  ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    // 删除
+    proxy
+      .post("/productClassify/delete", {
+        id: data.id,
+      })
+      .then((res) => {
+        ElMessage({
+          message: "删除成功",
+          type: "success",
+        });
+        getTreeList();
+      });
+  });
+};
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/productClassify/" + treeModalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: treeModalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        getTreeList();
+        treeModal.value = false;
+        submitLoading.value = false;
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+
+const getTreeList = () => {
+  emit("changeTreeList");
+  // proxy
+  //   .post("/productClassify/tree", {
+  //     parentId: "",
+  //     name: "",
+  //     definition: props.submitType,
+  //   })
+  //   .then((message) => {
+  //     treeListData.value = message;
+  //   });
+};
+// getTreeList();
+const handleMouseOver = (data) => {
+  console.log(data, "sss");
+  // currentNode.id = toRaw(data).id;
+};
+
+const getShowIcon = (data) => {
+  let ids = [100, 200, 300];
+  return !ids.includes(data.id);
+};
+</script>
+
+<style lang="scss">
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+.treeList {
+  display: block;
+  height: 100%;
+  background: #fff;
+  padding: 10px 15px 15px;
+  height: calc(100vh - 122px);
+
+  .search {
+    display: flex;
+    margin-bottom: 20px;
+    .el-input {
+      // width: calc(100% - 70px);
+      margin-right: 10px;
+      text-align: center;
+    }
+  }
+  // .searh,.title,.box{
+  //   padding-left:20px ;
+  // }
+  .box {
+    padding-right: 0px;
+    height: calc(100vh - 245px);
+    overflow-y: auto;
+    overflow-x: auto;
+    .el-tree {
+      // .el-tree-node__content {
+      //   display: block;
+      // }
+
+      .el-tree-node > .el-tree-node__children {
+        overflow: visible;
+      }
+    }
+  }
+}
+.iconColor {
+  color: #666 !important;
+}
+</style>

+ 215 - 0
src/views/purchaseSales/outAndInWarehouse/snapshot/index.vue

@@ -0,0 +1,215 @@
+<template>
+  <div class="pageIndexClass">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }" :action-list="[
+         
+        ]" @get-list="getList">
+
+        <template #snapshotTime="{ item }">
+          <div style="width:100%">
+            <span class="el-click" @click="openModal(item)"> {{ item.snapshotTime }}</span>
+          </div>
+        </template>
+
+      </byTable>
+    </div>
+    <el-dialog :title="dialogTitle" v-model="dialogVisible" width="90%">
+      <InventoryInquiry :rowId="rowId"></InventoryInquiry>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="default">取 消</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, defineComponent, ref } from "vue";
+import useUserStore from "@/store/modules/user";
+import InventoryInquiry from "@/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue";
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  companyId: [
+    { required: true, message: "请选择归属公司", trigger: ["change"] },
+  ],
+  type: [
+    { required: true, message: "请选择仓库类型", trigger: ["blur", "change"] },
+  ],
+  name: [{ required: true, message: "请输入仓库名称", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const warehouseType = computed(
+  () => proxy.useUserStore().allDict["warehouse_type"]
+);
+const selectConfig = computed(() => [
+  // {
+  //   label: "仓库类型",
+  //   prop: "type",
+  //   data: warehouseType.value,
+  // },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "快照时间",
+        prop: "snapshotTime",
+        slot: "snapshotTime",
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = computed(() => [
+  {
+    type: "treeSelect",
+    prop: "companyId",
+    label: "归属公司",
+    data: treeData.value,
+    propsTreeLabel: "deptName",
+    propsTreeValue: "deptId",
+    itemWidth: 100,
+  },
+  {
+    type: "select",
+    prop: "type",
+    label: "仓库类型",
+    required: true,
+    data: warehouseType.value,
+  },
+  {
+    type: "input",
+    prop: "name",
+    label: "仓库名称",
+  },
+  {
+    type: "select",
+    prop: "keeperId",
+    label: "仓管员",
+    isLoad: {
+      url: `/tenantUser/list?pageNum=1&pageSize=9999&tenantId=${
+        useUserStore().user.tenantId
+      }`,
+      labelKey: "nickName",
+      labelVal: "userId",
+      method: "get",
+      resUrl: "rows",
+    },
+  },
+  {
+    type: "input",
+    itemType: "textarea",
+    prop: "remark",
+    label: "备注",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/stockSnapshot/page", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+const dialogTitle = ref("");
+const rowId = ref("");
+const openModal = (item) => {
+  rowId.value = item.id;
+  dialogTitle.value = "快照明细" + item.snapshotTime;
+  dialogVisible.value = true;
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/warehouse/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/warehouse/detail", { id: row.id }).then((res) => {
+    res.type = res.type + "";
+    dialogVisible.value = true;
+    formData.data = res;
+  });
+};
+const companyData = ref([]);
+const treeData = ref([]);
+const getDict = () => {
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
+    })
+    .then((res) => {
+      companyData.value = res.data.map((x) => ({
+        ...x,
+        label: x.deptName,
+        value: x.deptId,
+      }));
+      treeData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getList();
+// getDict();
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>