zuozhengqing
2024-03-22 50538b42c86e69ba7d0de5fde2ad3d68779d9f77
src/views/purchaseManage/purchase/index.vue
@@ -53,12 +53,13 @@
                  <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px"
                    >查看</el-button
                  >
                  <!-- <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px"
                  <el-button
                    v-if="scope.row.status === 6||scope.row.status === 7" type="text" size="small" @click="confirmation(scope.row)" style="margin-right: 5px"
                    >到货确认</el-button
                  >
                  <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px"
                  <el-button v-if="scope.row.status === 7||scope.row.status === 8" type="text" size="small" @click="TestingAllClick(scope.row)" style="margin-right: 5px"
                    >去质检</el-button
                  > -->
                  >
                  <el-button
                    v-if="scope.row.status === 1"
                    type="text"
@@ -102,6 +103,16 @@
          >
            收货信息
          </div>
          <div
            class="tab-pane"
            @click="getTab(2)"
            :style="{
              background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8',
              color: TabsIndex == 2 ? '#fff' : '#666'
            }"
          >
            入库信息
          </div>
        </div>
        <div class="list-view">
          <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol">
@@ -123,6 +134,10 @@
    <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" />
    <!-- 新建/编辑 -->
    <AddPurchase ref="addDialog" v-if="editConfig.visible" :edit-common-config="editConfig" />
    <!-- 到货通知 -->
    <ArrivalConfirmation  v-if="editAffirmConfig.visible" :edit-common-config="editAffirmConfig" />
    <!-- 批量质检 -->
    <TestingAll  v-if="editTestingAllConfig.visible" :edit-common-config="editTestingAllConfig" />
  </div>
</template>
@@ -131,18 +146,20 @@
import {
  getPurchaseList,
  getPurchaseInfo,
  submitPurchase,
  newSubmitPurchase,
  deletePurchase,
  getOperationInfo
} from "@/api/purchaseManage/purchase"
import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier"
import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase"
import ArrivalConfirmation from"@/views/purchaseManage/purchase/components/ArrivalConfirmation"
import TestingAll from"@/views/purchaseManage/purchase/components/TestingAll"
import { getSupplierList } from "@/api/supplierManage/supplier"
import { getDataByType } from "@/api/data"
export default {
  name: "SupplierManage",
  props: {},
  components: { DetailSupplier, AddPurchase },
  components: { DetailSupplier, AddPurchase,ArrivalConfirmation,TestingAll },
  mixins: [pageMixin],
  computed: {},
  data() {
@@ -161,6 +178,17 @@
    ]
    // 收货信息
    const recriveColumn = [
      { label: "收货时间", prop: "operationNumber", default: true },
      { label: "收货人", prop: "principal" },
      { label: "产品名称", prop: "name" },
      { label: "产品编码", prop: "number" },
      { label: "规格", prop: "warehouseName" },
      { label: "数量", prop: "amount" },
      { label: "单位", prop: "overTime" },
      { label: "状态", prop: "status", isCallMethod: true, getCallMethod: this.getreceiveStatusStatus }
    ]
    // 入库信息
    const inLibraryColumn = [
      { label: "入库单号", prop: "operationNumber", default: true },
      { label: "收货仓库", prop: "warehouseName" },
      { label: "产品名称", prop: "name" },
@@ -189,6 +217,23 @@
        detailEnter: false,
        infomation: {
          supplierList: []
        }
      },
      editAffirmConfig: {
        visible: false,
        isDisabled: false,
        detailEnter: false,
        infomation: {
          // supplierList: []
        }
      },
      editTestingAllConfig:{
        visible: false,
        isDisabled: false,
        detailEnter: false,
        infomation: {
        }
      },
      tableColumn: [
@@ -222,7 +267,10 @@
      ],
      // 收货信息
      recriveColumn: recriveColumn,
      showReceiveCol: ["入库单号", "收货仓库", "产品名称", "产品编码", "数量", "入库时间", "收货人", "状态"],
      // 入库信息
      inLibraryColumn:inLibraryColumn,
      showReceiveCol: ["收货时间", "收货人", "产品名称", "产品编码", "规格", "数量", "单位", "状态"],
      inLibraryCol: ["入库单号", "收货仓库", "产品名称", "产品编码", "数量", "入库时间", "收货人", "状态"],
      loading: false,
      selectRow: {}
    }
@@ -425,7 +473,7 @@
          if (!row.supplierName) {
            this.btnEdit(row)
          } else {
            submitPurchase({ id: Number(row.id), status: 2 }).then((response) => {
            newSubmitPurchase(row.id).then((response) => {
              if (response.code === 200) {
                this.$message.success("提交成功")
                this.getData()
@@ -448,7 +496,7 @@
        type: "warning"
      }).then(
        () => {
          submitPurchase({ id: Number(row.id), status: 5 }).then((response) => {
          newSubmitPurchase(Number(row.id)).then((response) => {
            if (response.code === 200) {
              this.$message.success("已取消")
              this.getData()
@@ -508,6 +556,17 @@
      setTimeout(() => {
        this.tableLoading = false
      }, 3000)
    },
    // 到货确认
    confirmation(row){
      console.log(row,"row")
      this.editAffirmConfig.infomation=row
      this.editAffirmConfig.visible=true
    },
    // 去质检
    TestingAllClick(row){
      this.editTestingAllConfig.infomation=row
      this.editTestingAllConfig.visible=true
    },
    // 详情
    selCommonClick(row) {
@@ -592,11 +651,17 @@
        this.showBottomCol = this.showReceiveCol
        this.setBottomList()
        this.getProductInventoryInfo(this.selectRow)
      } else if (this.TabsIndex == 2) {
        // 入库信息列表
        this.tableBottomColumn = this.inLibraryColumn
        this.showBottomCol = this.inLibraryCol
        this.setBottomList()
        this.getProductInventoryInfo(this.selectRow)
      }
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "待确认" : val === 2 ? "待出库" : val === 3 ? "出库完成" : val === 4 ? "已关闭" : "--"
      return val === 1 ? "待确认" : val === 2 ? "待入库" : val === 3 ? "已入库" : val === 4 ? "已完成" : val === 5 ? "已取消" :val === 6 ? "待收货" :val === 7 ? "部分收货" :val === 8 ? "待质检" : "--"
    },
    // 获取产品/收货信息
    async getProductInventoryInfo(row) {