zzq
2023-09-28 62dd7a29fb929865cfcd72e8412beb3b5d41a7fc
Merge remote-tracking branch 'origin/zzq'
11个文件已修改
702 ■■■■■ 已修改文件
src/api/reportForm/inventoryRwport.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/product/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/report/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/overview/AddOverviewDialog.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/product/AddProductDialog.vue 392 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/inboundOutboundDetail/index.vue 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/inventoryReport/index.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportForm/locationReport/index.vue 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/reportForm/inventoryRwport.js
@@ -26,4 +26,13 @@
    method: "post",
    data
  })
}
//报表历史
export function getHistory(data) {
  return request({
    url: "/api-wms/v1/forms/getHistory",
    method: "post",
    data
  })
}
src/components/makepager/TableCommonView.vue
@@ -54,9 +54,9 @@
            <span
              class="Badge"
              :class="{
                greenSlot: scope.row.status == '4',
                greenSlot: scope.row.status == '4'||scope.row.status ==  '完成',
                redSlot: scope.row.status == '5',
                blueSlot: scope.row.status == '3',
                blueSlot: scope.row.status == '3'||scope.row.status ==  '就绪',
                graySlot: scope.row.status == '1',
              }"
              >{{
src/router/index.js
@@ -109,12 +109,13 @@
const router = createRouter()
router.afterEach((to, from, next) => {
  console.log(to,"to")
  if ((to.path === "/overview/overviewList" || to.path === "/productManage/productList") && to.params.name) {
    console.log(from, next)
    to.meta.title = to.params.name
    document.title = to.meta.title
  } else if (to.path === "/reportForm/inOutboundDetail" && to.params.name) {
    to.meta.title = "出入库明细"
  } else if (to.name === "inboundOutboundDetail") {
    to.meta.title = to.params.name + "/出入库明细"
    document.title = to.meta.title
  }
})
src/router/product/index.js
@@ -1,7 +1,7 @@
// const type from '@/router/deployCode'
const product = (resolve) => require(["@/views/productManage/product/index"], resolve) // 产品
const inOutboundDetail = (resolve) => require(["@/views/reportForm/inboundOutboundDetail/index"], resolve) // 出入库明细
const inboundOutboundDetail = (resolve) => require(["@/views/reportForm/inboundOutboundDetail/index"], resolve) // 出入库明细
const productCategory = (resolve) => require(["@/views/productManage/productCategory/index"], resolve) // 产品类别
const productList = (resolve) => require(["@/views/productManage/productCategory/ProductList"], resolve) // 产品类别-产品
const overviewList = (resolve) => require(["@/views/overview/OverviewListView"], resolve) // 概述-产品列表
@@ -24,9 +24,9 @@
    }
  },
  {
    path: "/reportForm/inOutboundDetail",
    name: "inOutboundDetail",
    component: inOutboundDetail,
    path: "/reportForm/inboundOutboundDetail",
    name: "inboundOutboundDetail",
    component: inboundOutboundDetail,
    meta: {
      title: "出入库明细"
    }
src/router/report/index.js
@@ -2,6 +2,7 @@
const inventoryReport = (resolve) => require(["@/views/reportForm/inventoryReport/index"], resolve) // 库存报表
const locationReport = (resolve) => require(["@/views/reportForm/locationReport/index"], resolve) // 位置报表
const inboundOutboundDetail = (resolve) => require(["@/views/reportForm/inboundOutboundDetail/index"], resolve) // 历史记录
const appconfig = [
  {
@@ -19,6 +20,14 @@
    meta: {
      title: "位置报表"
    }
  },
  {
    path: "/reportForm/inboundOutboundDetail",
    name: "inboundOutboundDetail",
    component: inboundOutboundDetail,
    meta: {
      title: "出入库明细"
    }
  }
]
src/views/overview/AddOverviewDialog.vue
@@ -411,7 +411,7 @@
        this.showEdit = false
        this.showFooter = true
        this.isValidateClick = false
      } else if (this.editConfig.infomation.status === 4) {
      } else if (this.editConfig.infomation.status === 4||this.editConfig.infomation.status === "完成") {
        this.showButton = true
        this.showEdit = false
        this.isDelClick = true
@@ -423,6 +423,7 @@
        this.showFooter = false
        this.isValidateClick = false
      } else {
        // 就绪---
        this.showButton = true
        this.showEdit = true
        this.showFooter = false
@@ -432,7 +433,8 @@
        this.list[0].status = "active"
      } else {
        this.list.map((item) => {
          if (item.value === this.editConfig.infomation.status) {
          console.log(item,this.editConfig.infomation.status,"打印信息")
          if (item.value === this.editConfig.infomation.status||item.label===this.editConfig.infomation.status) {
            item.status = "active"
          } else {
            item.status = "todo"
src/views/productManage/product/AddProductDialog.vue
@@ -18,7 +18,14 @@
            <i class="el-icon-s-tools"></i>
            <span>动作</span>
          </span>
          <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button>
          <el-button
            v-if="showEdit"
            plain
            size="mini"
            style="margin-left: 15px"
            @click="editClick"
            >编辑</el-button
          >
        </div>
      </div>
      <!-- 内容 -->
@@ -46,9 +53,15 @@
          <div class="basic-info-view">
            <el-row>
              <el-col :span="23">
                <div style="margin-left: 20px"><span style="color: #f56c6c">*</span>产品名称</div>
                <div style="margin-left: 20px">
                  <span style="color: #f56c6c">*</span>产品名称
                </div>
                <el-form-item label="" prop="name" label-width="20px">
                  <el-input v-model="editConfig.infomation.name" placeholder="" :disabled="!showFooter"></el-input>
                  <el-input
                    v-model="editConfig.infomation.name"
                    placeholder=""
                    :disabled="!showFooter"
                  ></el-input>
                </el-form-item>
              </el-col>
              <!-- <el-col :span="4">
@@ -81,7 +94,11 @@
            <div v-if="activeName === 'first'">
              <div class="purchase-view">
                <div class="left">
                  <el-form-item label="产品类型" prop="productType" style="margin-left: 20px">
                  <el-form-item
                    label="产品类型"
                    prop="productType"
                    style="margin-left: 20px"
                  >
                    <el-select
                      v-model="editConfig.infomation.productType"
                      placeholder="请选择"
@@ -89,11 +106,20 @@
                      style="width: 85%"
                      :disabled="!showFooter"
                    >
                      <el-option v-for="item in productTypeOptions" :key="item.id" :label="item.name" :value="item.id">
                      <el-option
                        v-for="item in productTypeOptions"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="开票策略" prop="invoicingStrategy" style="margin-left: 20px">
                  <el-form-item
                    label="开票策略"
                    prop="invoicingStrategy"
                    style="margin-left: 20px"
                  >
                    <el-select
                      v-model="editConfig.infomation.invoicingStrategy"
                      placeholder="请选择"
@@ -101,13 +127,26 @@
                      style="width: 85%"
                      :disabled="!showFooter"
                    >
                      <el-option v-for="item in strategyOptions" :key="item.id" :label="item.name" :value="item.id">
                      <el-option
                        v-for="item in strategyOptions"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      >
                      </el-option>
                    </el-select>
                    <div class="font_size_13" style="color: gray">可储存的产品是您管理库存水平的实物项目。</div>
                    <div class="font_size_13" style="color: gray">您可以在发货前为其开具结算单。</div>
                    <div class="font_size_13" style="color: gray">
                      可储存的产品是您管理库存水平的实物项目。
                    </div>
                    <div class="font_size_13" style="color: gray">
                      您可以在发货前为其开具结算单。
                    </div>
                  </el-form-item>
                  <el-form-item label="物料类型" prop="model" style="margin-left: 20px">
                  <el-form-item
                    label="物料类型"
                    prop="model"
                    style="margin-left: 20px"
                  >
                    <el-select
                      v-model="editConfig.infomation.model"
                      placeholder="请选择"
@@ -117,11 +156,20 @@
                      :popper-append-to-body="false"
                      :disabled="!showFooter"
                    >
                      <el-option v-for="item in materialTypeList" :key="item.id" :label="item.name" :value="item.id">
                      <el-option
                        v-for="item in materialTypeList"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="单位" prop="unit" style="margin-left: 20px">
                  <el-form-item
                    label="单位"
                    prop="unit"
                    style="margin-left: 20px"
                  >
                    <el-input
                      v-model="editConfig.infomation.unit"
                      placeholder="请输入"
@@ -129,7 +177,11 @@
                      :disabled="!showFooter"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="产品标签" prop="productTagName" style="margin-left: 20px">
                  <el-form-item
                    label="产品标签"
                    prop="productTagName"
                    style="margin-left: 20px"
                  >
                    <el-input
                      v-model="editConfig.infomation.productTagName"
                      placeholder="请输入"
@@ -139,7 +191,11 @@
                  </el-form-item>
                </div>
                <div class="right">
                  <el-form-item label="销售价格" prop="salePrice" style="margin-left: 20px">
                  <el-form-item
                    label="销售价格"
                    prop="salePrice"
                    style="margin-left: 20px"
                  >
                    <span>¥</span>
                    <el-input-number
                      v-model.trim="editConfig.infomation.salePrice"
@@ -151,7 +207,11 @@
                      :disabled="!showFooter"
                    ></el-input-number>
                  </el-form-item>
                  <el-form-item label="销项税" prop="customerTaxes" style="margin-left: 20px">
                  <el-form-item
                    label="销项税"
                    prop="customerTaxes"
                    style="margin-left: 20px"
                  >
                    <el-input-number
                      v-model="editConfig.infomation.customerTaxes"
                      placeholder="请输入"
@@ -161,7 +221,11 @@
                      :disabled="!showFooter"
                    ></el-input-number>
                  </el-form-item>
                  <el-form-item label="成本" prop="cost" style="margin-left: 20px">
                  <el-form-item
                    label="成本"
                    prop="cost"
                    style="margin-left: 20px"
                  >
                    <span>¥</span>
                    <el-input-number
                      v-model.trim="editConfig.infomation.cost"
@@ -173,7 +237,11 @@
                      :disabled="!showFooter"
                    ></el-input-number>
                  </el-form-item>
                  <el-form-item label="产品类别" prop="categoryId" style="margin-left: 20px">
                  <el-form-item
                    label="产品类别"
                    prop="categoryId"
                    style="margin-left: 20px"
                  >
                    <el-select
                      v-model="editConfig.infomation.categoryId"
                      placeholder="请选择"
@@ -190,7 +258,11 @@
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="内部参考" prop="internalReference" style="margin-left: 20px">
                  <el-form-item
                    label="内部参考"
                    prop="internalReference"
                    style="margin-left: 20px"
                  >
                    <el-input
                      v-model.trim="editConfig.infomation.internalReference"
                      placeholder="请输入"
@@ -199,7 +271,11 @@
                      :disabled="!showFooter"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="条码" prop="barcode" style="margin-left: 20px">
                  <el-form-item
                    label="条码"
                    prop="barcode"
                    style="margin-left: 20px"
                  >
                    <el-input
                      v-model.trim="editConfig.infomation.barcode"
                      placeholder="请输入"
@@ -212,7 +288,12 @@
              </div>
              <div class="all">
                <div class="second-label">内部说明</div>
                <el-form-item label="" prop="internalNotes" style="margin-left: 20px" label-width="0px">
                <el-form-item
                  label=""
                  prop="internalNotes"
                  style="margin-left: 20px"
                  label-width="0px"
                >
                  <el-input
                    v-model.trim="editConfig.infomation.internalNotes"
                    placeholder="请输入"
@@ -244,7 +325,12 @@
                  </el-form-item>
                </div> -->
                <div class="left">
                  <el-form-item label="负责人" prop="principal" style="margin-left: 20px" label-width="80px">
                  <el-form-item
                    label="负责人"
                    prop="principal"
                    style="margin-left: 20px"
                    label-width="80px"
                  >
                    <el-select
                      v-model="editConfig.infomation.principal"
                      placeholder="请选择"
@@ -252,11 +338,21 @@
                      style="width: 85%"
                      :disabled="!showFooter"
                    >
                      <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :value="item.name">
                      <el-option
                        v-for="item in memberOptions"
                        :key="item.id"
                        :label="item.name"
                        :value="item.name"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="重量" prop="weight" style="margin-left: 20px" label-width="80px">
                  <el-form-item
                    label="重量"
                    prop="weight"
                    style="margin-left: 20px"
                    label-width="80px"
                  >
                    <el-input-number
                      v-model="editConfig.infomation.weight"
                      placeholder="请输入"
@@ -268,7 +364,12 @@
                    ></el-input-number>
                    <span> kg</span>
                  </el-form-item>
                  <el-form-item label="体积" prop="volume" style="margin-left: 20px" label-width="80px">
                  <el-form-item
                    label="体积"
                    prop="volume"
                    style="margin-left: 20px"
                    label-width="80px"
                  >
                    <el-input-number
                      v-model="editConfig.infomation.volume"
                      placeholder="请输入"
@@ -338,7 +439,12 @@
              <div class="purchase-view">
                <div class="left">
                  <div class="second-label">收货说明</div>
                  <el-form-item label="" prop="inStorageExplain" style="margin-left: 20px" label-width="0px">
                  <el-form-item
                    label=""
                    prop="inStorageExplain"
                    style="margin-left: 20px"
                    label-width="0px"
                  >
                    <el-input
                      v-model.trim="editConfig.infomation.inStorageExplain"
                      placeholder="此说明添加到收货订单中(例如,产品在仓库的存储位置)"
@@ -352,7 +458,12 @@
                </div>
                <div class="right">
                  <div class="second-label">出库单说明</div>
                  <el-form-item label="" prop="outStorageExplain" style="margin-left: 20px" label-width="0px">
                  <el-form-item
                    label=""
                    prop="outStorageExplain"
                    style="margin-left: 20px"
                    label-width="0px"
                  >
                    <el-input
                      v-model.trim="editConfig.infomation.outStorageExplain"
                      placeholder="此通知已添加到送货单中"
@@ -368,9 +479,16 @@
              <div class="purchase-view">
                <div class="left">
                  <div class="second-label">内部调拨说明</div>
                  <el-form-item label="" prop="internalTransferExplain" style="margin-left: 20px" label-width="0px">
                  <el-form-item
                    label=""
                    prop="internalTransferExplain"
                    style="margin-left: 20px"
                    label-width="0px"
                  >
                    <el-input
                      v-model.trim="editConfig.infomation.internalTransferExplain"
                      v-model.trim="
                        editConfig.infomation.internalTransferExplain
                      "
                      placeholder="此说明添加到内部调拨订单中(例如,在仓库中何处提取产品)"
                      size="mini"
                      type="textarea"
@@ -484,8 +602,12 @@
      </el-form>
      <!-- 尾 -->
      <div v-if="showFooter" slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
        <el-button type="primary" size="small" @click="saveClick('form')"
          >保存</el-button
        >
        <el-button size="small" @click="editConfig.visible = false"
          >取消</el-button
        >
      </div>
    </el-dialog>
  </div>
@@ -493,10 +615,14 @@
<script>
// import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import { getProductCategoryList } from "@/api/product/productCategory"
import { getProductList, addProduct, updateProduct } from "@/api/product/product"
import { getProductCategoryList } from "@/api/product/productCategory";
import {
  getProductList,
  addProduct,
  updateProduct,
} from "@/api/product/product";
let inputElement = null
let inputElement = null;
export default {
  name: "AddProductDialog",
  props: {
@@ -506,10 +632,10 @@
        return {
          visible: false,
          title: "新建",
          infomation: {}
        }
      }
    }
          infomation: {},
        };
      },
    },
  },
  components: {},
  computed: {},
@@ -519,20 +645,24 @@
      editConfig: this.editCommonConfig,
      rules: {
        name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
        model: [{ required: true, message: "请选择物料类型", trigger: "change" }],
        salePrice: [{ required: true, message: "请输入销售价格", trigger: "blur" }],
        unit: [{ required: true, message: "请输入单位", trigger: "blur" }]
        model: [
          { required: true, message: "请选择物料类型", trigger: "change" },
        ],
        salePrice: [
          { required: true, message: "请输入销售价格", trigger: "blur" },
        ],
        unit: [{ required: true, message: "请输入单位", trigger: "blur" }],
      },
      memberOptions: [{ name: "管理员", id: 1 }],
      productCategoryOptions: [], // 产品类别
      productTypeOptions: [
        { name: "能消耗", id: 1 },
        { name: "服务", id: 2 },
        { name: "可库存产品", id: 3 }
        { name: "可库存产品", id: 3 },
      ], // 产品类型
      strategyOptions: [
        { name: "订购数量", id: 1 },
        { name: "交付数量", id: 2 }
        { name: "交付数量", id: 2 },
      ], // 开票策略
      selectProductOptions: [], // 可选产品
      showButton: true,
@@ -557,15 +687,15 @@
        { name: "成品", id: "成品" },
        { name: "辅料", id: "辅料" },
        { name: "耗材", id: "耗材" },
        { name: "其他", id: "其他" }
      ]
    }
        { name: "其他", id: "其他" },
      ],
    };
  },
  created() {
    this.getProductCategoryList()
    this.getProductList()
    this.setTableForm()
    this.setBottonView()
    this.getProductCategoryList();
    this.getProductList();
    this.setTableForm();
    this.setBottonView();
  },
  methods: {
    // 获取产品类别
@@ -573,73 +703,74 @@
      await getProductCategoryList({
        keyWord: "",
        page: 0,
        pageSize: 0
        pageSize: 0,
      }).then((res) => {
        if (res.code === 200) {
          this.productCategoryOptions = res.data
          this.productCategoryOptions = res.data;
        }
      })
      });
    },
    // 获取可选产品
    async getProductList() {
      await getProductList({
        keyWord: "",
        page: 1,
        pageSize: 20
        pageSize: 20,
      }).then((res) => {
        if (res.code === 200) {
          const list = res.data.map((item) => {
            return {
              id: item.id,
              name: item.name
            }
          })
          this.selectProductOptions = list || []
              name: item.name,
            };
          });
          this.selectProductOptions = list || [];
        }
      })
      });
    },
    // 设置删除/打印/编辑是否显示
    setBottonView() {
      if (this.editConfig.title === "新建") {
        this.showButton = false
        this.showEdit = false
        this.showFooter = true
        this.addProduct = true
        this.showButton = false;
        this.showEdit = false;
        this.showFooter = true;
        this.addProduct = true;
      } else {
        this.showEdit = true
        this.showFooter = false
        this.addProduct = false
        this.showEdit = true;
        this.showFooter = false;
        this.addProduct = false;
      }
    },
    // 关闭
    handleClose() {
      this.editConfig.visible = false
      this.editConfig.visible = false;
    },
    // 编辑
    editClick() {
      this.showEdit = false
      this.showButton = false
      this.showFooter = true
      this.setTableForm()
      this.showEdit = false;
      this.showButton = false;
      this.showFooter = true;
      this.setTableForm();
    },
    // 保存
    saveClick(formName) {
      console.log(this.editConfig.infomation)
      console.log(this.editConfig.infomation);
      this.$refs[formName].validate((valid) => {
        if (valid) {
          let requestUrl = this.editConfig.title === "新建" ? addProduct : updateProduct
          let requestUrl =
            this.editConfig.title === "新建" ? addProduct : updateProduct;
          requestUrl({
            ...this.editConfig.infomation
            ...this.editConfig.infomation,
          }).then((res) => {
            console.log(res)
            this.editConfig.visible = false
            console.log(res);
            this.editConfig.visible = false;
            if (res.code === 200) {
              this.$message.success("添加成功")
              this.$parent.getData()
              this.$message.success("添加成功");
              this.$parent.getData();
            }
          })
          });
        }
      })
      });
    },
    // 删除
    delClick() {},
@@ -655,33 +786,33 @@
          { label: "公司", prop: "total", select: true },
          { label: "数量", prop: "total", inputFloat: true },
          { label: "价格", prop: "price", inputFloat: true },
          { label: "币种", prop: "total", select: true }
          { label: "币种", prop: "total", select: true },
          // { label: "交货提前时间", prop: "total", inputNumber: true }
        ]
      }
        ],
      };
    },
    // 产品列表输入
    inputContent(val, prop, row) {
      this.productId = row.productId
      this.productId = row.productId;
      this.tableData.map((item) => {
        if (item.productId === row.productId) {
          item[prop] = val
          item[prop] = val;
        }
      })
      });
    },
    // 产品新增
    addProductClick() {
      console.log(this.tableData)
      console.log(this.tableData);
      for (let i = 0; i < this.tableData.length; i++) {
        if (this.tableData[i].name.length === 0) {
          this.isNoProduct = true
          break
          this.isNoProduct = true;
          break;
        } else {
          this.isNoProduct = false
          this.isNoProduct = false;
        }
      }
      if (!this.isNoProduct) {
        this.productId++
        this.productId++;
        this.tableData.push({
          productId: this.productId,
          id: 0,
@@ -690,81 +821,96 @@
          name: "",
          number: "",
          price: 0,
          total: 0
        })
          total: 0,
        });
      }
    },
    // 产品删除
    handleDelClick(scope) {
      console.log(scope)
      this.tableData.splice(scope.$index, 1)
      console.log(scope);
      this.tableData.splice(scope.$index, 1);
    },
    // 上传图片
    toGetImg() {
      if (this.showFooter) {
        if (inputElement === null) {
          // 生成文件上传的控件
          inputElement = document.createElement("input")
          inputElement.setAttribute("type", "file")
          inputElement.style.display = "none"
          inputElement = document.createElement("input");
          inputElement.setAttribute("type", "file");
          inputElement.style.display = "none";
          if (window.addEventListener) {
            inputElement.addEventListener("change", this.uploadFile, false)
            inputElement.addEventListener("change", this.uploadFile, false);
          } else {
            inputElement.attachEvent("onchange", this.uploadFile)
            inputElement.attachEvent("onchange", this.uploadFile);
          }
          document.body.appendChild(inputElement)
          document.body.appendChild(inputElement);
        }
        inputElement.click()
        inputElement.click();
      }
    },
    uploadFile(el) {
      if (el && el.target && el.target.files && el.target.files.length > 0) {
        console.log(el)
        const files = el.target.files[0]
        const isLt2M = files.size / 1024 / 1024 < 2
        const size = files.size / 1024 / 1024
        console.log(size)
        console.log(el);
        const files = el.target.files[0];
        const isLt2M = files.size / 1024 / 1024 < 2;
        const size = files.size / 1024 / 1024;
        console.log(size);
        // 判断上传文件的大小
        if (!isLt2M) {
          this.$message.error("上传头像图片大小不能超过 2MB!")
          this.$message.error("上传头像图片大小不能超过 2MB!");
        } else if (files.type.indexOf("image") === -1) {
          //如果不是图片格式
          this.$message.error("请选择图片文件")
          this.$message.error("请选择图片文件");
        } else {
          const that = this
          const reader = new FileReader() // 创建读取文件对象
          reader.readAsDataURL(el.target.files[0]) // 发起异步请求,读取文件
          const that = this;
          const reader = new FileReader(); // 创建读取文件对象
          reader.readAsDataURL(el.target.files[0]); // 发起异步请求,读取文件
          reader.onload = function () {
            // 读取完成后,将结果赋值给img的src
            that.imageSrc = this.result
            console.log(this.result)
            that.imageSrc = this.result;
            console.log(this.result);
            // 数据传到后台
            //const formData = new FormData()
            //formData.append('file', files); // 可以传到后台的数据
          }
          };
        }
      }
    },
    // 进出点击
    inOutBoundClick() {
      if (this.editConfig.title !== "新建") {
        console.log(this.editConfig.infomation)
        console.log(this.editConfig.infomation);
        this.$router.push({
          name: "inOutboundDetail",
          params: { name: this.editConfig.infomation.name, id: this.editConfig.infomation.id }
        })
          name: "inboundOutboundDetail",
          params: {
            name: this.editConfig.infomation.name,
            id: this.editConfig.infomation.id,
            pageName:"产品",
            paramsKey: {
              amount: "amount", //数量
              productName:"productName", //产品名称
              status: "status", // 状态
              contactedName: "admin",  //完成者
              date: "operationDate", // 日期
              fromLocation: "from", // 从
              number: "number", //单号
              toLocation: "to",  //至
              unit: "unit", //单位
            },
          },
        });
      }
    },
    // 可销售/可采购
    checkboxChange(val, param) {
      if (val === "采购") {
        this.showProcure = param
        this.showProcure = param;
      } else if (val === "销售") {
        this.showSale = param
        this.showSale = param;
      }
    }
  }
}
    },
  },
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
src/views/reportForm/inboundOutboundDetail/index.vue
@@ -18,18 +18,28 @@
        @tableRowClick="tableRowClick"
      ></TableCommonView>
      <div class="btn-pager">
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        <PagerView
          class="page"
          :pager-options="pagerOptions"
          v-on="pagerEvents"
        />
      </div>
    </div>
    <!-- 编辑 -->
    <AddOverviewDialog v-if="editConfig.visible" :edit-common-config="editConfig" :add-name="this.$route.params.name" />
    <AddOverviewDialog
      v-if="editConfig.visible"
      :edit-common-config="editConfig"
      :add-name="this.$route.params.name"
    />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getProductOperatonList } from "@/api/product/product"
import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin";
import { getHistory } from "@/api/reportForm/inventoryRwport";
import { getProductOperatonList } from "@/api/product/product";
import AddOverviewDialog from "@/views/overview/AddOverviewDialog";
export default {
  name: "InboundOutboundDetail",
@@ -45,15 +55,16 @@
      commonDetail: {
        visible: false,
        title: "新建",
        infomation: {}
        infomation: {},
      },
      editConfig: {
        visible: false,
        title: "新建",
        infomation: {}
        infomation: {},
      },
      params: {}
    }
      productId: this.$route.params.id,
      productName: this.$route.params.name,
    };
  },
  created() {
    this.setTable()
@@ -77,128 +88,139 @@
        selectBox: true,
        showcol: this.showcol,
        allcol: [],
        tableColumn: this.setTableColumn(this.showcol)
      }
      let allcol = []
        tableColumn: this.setTableColumn(this.showcol),
      };
      let allcol = [];
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        if (!this.tableList.tableColumn[i].default) {
          const label = this.tableList.tableColumn[i].label
          allcol.push(label)
          const label = this.tableList.tableColumn[i].label;
          allcol.push(label);
        }
      }
      this.tableList.allcol = allcol
      this.tableList.allcol = allcol;
    },
    setTableColumn(showcol) {
      let tableColumn = [
        {
          label: "日期",
          prop: "operationDate",
          prop: this.$route.params.paramsKey.date,
          isShowColumn: true,
          default: true,
          date: true
          date: true,
        },
        {
          label: "单号",
          prop: "number",
          prop: this.$route.params.paramsKey.number,
          isShowColumn: true,
          default: true
          default: true,
        },
        {
          label: "产品",
          prop: "productName",
          prop: this.$route.params.paramsKey.productName,
          isShowColumn: true,
          default: true
          default: true,
        },
        {
          label: "从",
          prop: "from",
          prop: this.$route.params.paramsKey.fromLocation,
          isShowColumn: true,
          default: true
          default: true,
        },
        {
          label: "至",
          prop: "to",
          prop: this.$route.params.paramsKey.toLocation,
          isShowColumn: true,
          default: true
          default: true,
        },
        {
          label: "数量",
          prop: "amount",
          prop: this.$route.params.paramsKey.amount,
          isShowColumn: true,
          default: true
          default: true,
        },
        {
          label: "单位",
          prop: "unit",
          prop: this.$route.params.paramsKey.unit,
          isShowColumn: true,
          default: true
          default: true,
        },
        {
          label: "状态",
          prop: "status",
          prop: this.$route.params.paramsKey.status,
          width: 120,
          isShowColumn: showcol.includes("状态"),
          default: false,
          status: true,
          isCallMethod: true,
          getCallMethod: this.getStatus
          getCallMethod: this.getStatus,
        },
        {
          label: "完成者",
          prop: "admin",
          prop: this.$route.params.paramsKey.contactedName,
          isShowColumn: showcol.includes("完成者"),
          default: false
        }
      ]
      return tableColumn
          default: false,
        },
      ];
      return tableColumn;
    },
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setTableColumn(val)
      this.showcol = val;
      this.tableList.tableColumn = this.setTableColumn(val);
    },
    // 请求数据
    // 库存报表跳转请求数据
    async getData() {
      await getProductOperatonList({
        productId: this.params.id,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.code === 200) {
          const list = res.data.map((item) => {
            return {
              ...item,
              from: item.fromLocation.name,
              to: item.toLocation.name,
              productName: this.params.name
            }
          })
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.total
        }
      })
      if (this.$route.params.pageName == "产品") {
        await getProductOperatonList({
          productId: this.productId,
          page: this.pagerOptions.currPage,
          pageSize: this.pagerOptions.pageSize,
        }).then((res) => {
          if (res.code === 200) {
            const list = res.data.map((item) => {
              return {
                ...item,
                from: item.fromLocation.name,
                to: item.toLocation.name,
                productName: this.productName,
              };
            });
            this.tableList.tableInfomation = list || [];
            this.pagerOptions.totalCount = res.total;
          }
        });
      } else if (this.$route.params.pageName == "报表") {
        await getHistory(this.$route.params.product).then((res) => {
          if (res.code === 200) {
            this.tableList.tableInfomation = res.data;
          }
        });
      }
    },
    //产品跳转请求数据
    // 搜索
    getList(val) {
      console.log(val)
      console.log(val);
    },
    // 行点击
    tableRowClick(row) {
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "查看"
      this.editConfig.infomation = { ...row }
      console.log(row,"行row")
      this.editConfig.visible = true;
      this.editConfig.title = "查看";
      this.editConfig.infomation = { ...row };
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      // this.editConfig.visible = true
      this.editConfig.title = "新建";
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成"
    }
  }
}
      console.log(val,"val状态")
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成";
    },
  },
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
src/views/reportForm/inventoryReport/index.vue
@@ -167,7 +167,8 @@
      warehouseListName: "", // 仓库名称
      stashRadio: "1",
      pageSizes: [15, 30],
      oldRadioBtn:"",
      oldRadioBtn: "",
      metaTitle: this.$route.meta.title,
    };
  },
  created() {
@@ -182,18 +183,16 @@
  methods: {
    checkListHandler(e) {
      this.categoryListId = e;
      this.getData()
      console.log(this.categoryListId, e, " 选中的产品id");
      this.getData();
    },
    radioHandleChange(e) {
      this.warehouseListName=e
      this.getData()
      console.log(e, "单选");
      this.warehouseListName = e;
      this.getData();
    },
    setTable() {
      if (this.isIconIndex === "1") {
        this.pageSizes = [30, 60]
        this.pagerOptions.pageSize = 30
        this.pageSizes = [30, 60];
        this.pagerOptions.pageSize = 30;
      }
      this.tableList = {
        tableInfomation: [],
@@ -312,13 +311,36 @@
    },
    // 历史
    handleHistoryClick(row) {
      console.log(row)
      this.$router.push("/operate/allot");
      this.$router.push({
        name: "inboundOutboundDetail",
        params: {
          name: this.metaTitle,
          product: {
            page: this.pagerOptions.currPage,
            pageSize: this.pagerOptions.pageSize,
            produceId: row.produceId,
            productName: row.productName,
            unit: row.unit,
          },
          pageName:"报表",
          paramsKey: {
            amount: "amount",
            status: "status", //状态
            productName:"productName", //产品名称
            contactedName: "contactedName",
            date: "date",
            fromLocation: "fromLocation",
            number: "number",
            toLocation: "toLocation",
            unit: "unit",
          },
        },
      });
    },
    // 补货
    handleAddGoods(row) {
      console.log(row)
      console.log(row);
    },
    // 位置
    handleLocation() {
@@ -342,7 +364,6 @@
          unit: item.unit, //单位
        };
        this.testArr.push(obj);
        console.log(this.testArr, "this");
      });
    },
@@ -357,10 +378,9 @@
      };
      await getInventoryData(params).then((res) => {
        if (res.code === 200) {
          console.log(res.data, "接口请求成功");
          const list = res.data
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.total
          const list = res.data;
          this.tableList.tableInfomation = list || [];
          this.pagerOptions.totalCount = res.total;
        }
      });
    },
@@ -369,7 +389,7 @@
      await getProductCategoryList({
        keyWord: "",
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
        pageSize: this.pagerOptions.pageSize,
      }).then((res) => {
        if (res.code === 200) {
          this.categoryList = res.data;
@@ -381,11 +401,10 @@
      await getWarehouseList({
        keyword: "",
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
        pageSize: this.pagerOptions.pageSize,
      }).then((res) => {
        if (res.data.code === 200) {
          this.warehouseList = res.data.data;
          console.log(this.warehouseList, "warehouseList");
        }
      });
    },
src/views/reportForm/locationReport/index.vue
@@ -56,7 +56,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin";
import { getLocationData,} from "@/api/locationApi/locationApi";
import { getLocationData } from "@/api/locationApi/locationApi";
import AddOverviewDialog from "@/views/overview/AddOverviewDialog";
export default {
@@ -74,7 +74,7 @@
      //   { label: "预留数量", unit: "" },
      //   { label: "价值", unit: "¥" },
      // ],
      countcol:["在库数量","预留数量","价值"],
      countcol: ["在库数量", "预留数量", "价值"],
      testArr: [
        {
          product: "HC/销售区/b区",
@@ -114,6 +114,7 @@
      },
      productId: this.$route.params.id,
      productName: this.$route.params.name,
      metaTitle: this.$route.meta.title,
    };
  },
  created() {
@@ -171,14 +172,14 @@
          prop: "amount",
          isShowColumn: true,
          default: true,
          unit:""
          unit: "",
        },
        {
          label: "预留数量",
          prop: "availableStore",
          isShowColumn: true,
          default: true,
          unit:""
          unit: "",
        },
        {
          label: "单位",
@@ -193,7 +194,7 @@
          width: 120,
          default: false,
          isShowColumn: showcol.includes("价值"),
          unit:"¥"
          unit: "¥",
        },
      ];
      return tableColumn;
@@ -209,10 +210,9 @@
        pageSize: this.pagerOptions.pageSize,
      }).then((res) => {
        if (res.code === 200) {
          console.log(res.data,"接口请求成功")
          const list = res.data
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.total
          const list = res.data;
          this.tableList.tableInfomation = list || [];
          this.pagerOptions.totalCount = res.total;
        }
      });
    },
@@ -232,14 +232,40 @@
    addBtnClick() {
      this.editConfig.visible = true;
      this.editConfig.title = "新建";
      this.getData()
      this.getData();
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成";
    },
    // 历史
    handleHistoryClick() {},
    handleHistoryClick(row) {
      this.$router.push({
        name: "inboundOutboundDetail",
        params: {
          name: this.metaTitle,
          pageName:"报表",
          product: {
            page: this.pagerOptions.currPage,
            pageSize: this.pagerOptions.pageSize,
            produceId: row.produceId,
            productName: row.productName,
            unit: row.unit,
          },
          paramsKey: {
            amount: "amount",
            productName:"productName",
            status: "status",
            contactedName: "contactedName",
            date: "date",
            fromLocation: "fromLocation",
            number: "number",
            toLocation: "toLocation",
            unit: "unit",
          },
        },
      });
    },
    // 补货
    handleAddGoods() {},
  },
vue.config.js
@@ -14,12 +14,12 @@
  devServer: {
    proxy: {
      "/api-s": {
        target: "http://192.168.20.119:8005",
        target: "http://192.168.20.118:8005",
        ws: true,
        changeOrigin: true
      },
      "/api-wms": {
        target: "http://192.168.20.119:8005",
        target: "http://192.168.20.118:8005",
        ws: true,
        changeOrigin: true
      }