yangfeng
2023-09-22 fbdb1d15b6cf692d27598806eee6be6f16e1f36d
src/views/reportForm/inboundOutboundDetail/index.vue
@@ -21,18 +21,20 @@
        <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" />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getProductList } from "@/api/product/product"
// import DetailProduct from "@/views/productManage/product/DetailProduct"
import { getProductOperatonList } from "@/api/product/product"
import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
export default {
  name: "InboundOutboundDetail",
  props: {},
  components: {},
  components: { AddOverviewDialog },
  mixins: [pageMixin],
  computed: {},
  data() {
@@ -49,7 +51,9 @@
        visible: false,
        title: "新建",
        infomation: {}
      }
      },
      productId: this.$route.params.id,
      productName: this.$route.params.name
    }
  },
  created() {
@@ -78,43 +82,44 @@
      let tableColumn = [
        {
          label: "日期",
          prop: "id",
          prop: "operationDate",
          isShowColumn: true,
          default: true
          default: true,
          date: true
        },
        {
          label: "参考",
          prop: "id",
          label: "单号",
          prop: "number",
          isShowColumn: true,
          default: true
        },
        {
          label: "产品",
          prop: "id",
          prop: "productName",
          isShowColumn: true,
          default: true
        },
        {
          label: "从",
          prop: "deviceName",
          prop: "from",
          isShowColumn: true,
          default: true
        },
        {
          label: "至",
          prop: "id",
          prop: "to",
          isShowColumn: true,
          default: true
        },
        {
          label: "公司",
          prop: "shopName",
          isShowColumn: showcol.includes("公司"),
          default: false
          label: "数量",
          prop: "amount",
          isShowColumn: true,
          default: true
        },
        {
          label: "数量",
          prop: "deviceId",
          label: "单位",
          prop: "unit",
          isShowColumn: true,
          default: true
        },
@@ -124,11 +129,13 @@
          width: 120,
          isShowColumn: showcol.includes("状态"),
          default: false,
          status: true
          status: true,
          isCallMethod: true,
          getCallMethod: this.getStatus
        },
        {
          label: "完成者",
          prop: "preTime",
          prop: "admin",
          isShowColumn: showcol.includes("完成者"),
          default: false
        }
@@ -140,23 +147,23 @@
      this.tableList.tableColumn = this.setTableColumn(val)
    },
    // 请求数据
    async getData(val, content) {
      await getProductList({
        [val]: content,
    async getData() {
      await getProductOperatonList({
        productId: this.productId,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.data.code === 200) {
          const list = res.data.data.list.map((item) => {
        if (res.code === 200) {
          const list = res.data.map((item) => {
            return {
              ...item,
              supplierNumber: item.supplier.number,
              status: "就绪",
              preTime: "2023-09-04 11:20:00"
              from: item.fromLocation.name,
              to: item.toLocation.name,
              productName: this.productName
            }
          })
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.data.total
          this.pagerOptions.totalCount = res.total
        }
      })
    },
@@ -168,13 +175,17 @@
    tableRowClick(row) {
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.title = "查看"
      this.editConfig.infomation = { ...row }
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成"
    }
  }
}