src/views/orderManageModule/orderManage/index.vue
@@ -29,7 +29,10 @@
            <template slot="tableButton">
              <el-table-column label="操作" width="160" fixed="right">
                <template slot-scope="scope">
                  <el-button v-if="scope.row.status == 0" type="text" size="small">待确认</el-button>
                  <template v-if="scope.row.status == 1">
                    <el-button type="text" size="small">确认</el-button>
                    <el-button type="text" size="small">取消</el-button>
                  </template>
                  <el-button
                    v-else-if="scope.row.status == 2 || scope.row.status == 4"
                    type="text"
@@ -125,6 +128,13 @@
</template>
<script>
import {
  outsourceOrderList,
  outsourceOrderOverview,
  outsourceOrderProductList,
  getMaterialApplyList
  // changeOutsourceOrderStatus
} from "@/api/orderManageModule/orderManage"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import ApplyMaterialsDialog from "@/views/orderManageModule/orderManage/components/ApplyMaterialsDialog"
import DeliveryDialog from "@/views/orderManageModule/orderManage/components/DeliveryDialog"
@@ -155,10 +165,10 @@
      tableList: {},
      tableColumn: [
        { label: "订单编号", prop: "number", min: 90, default: true },
        { label: "产品数量", prop: "quotationName", min: 120 },
        { label: "签约日期", prop: "validity_date", min: 100 },
        { label: "交付日期", prop: "client_name", min: 120 },
        { label: "状态", prop: "quotationStatus", isCallMethod: true, getCallMethod: this.getStatus }
        { label: "产品数量", prop: "productQuantity", min: 120 },
        { label: "签约日期", prop: "signTime", min: 100 },
        { label: "交付日期", prop: "deliveryDate", min: 120 },
        { label: "状态", prop: "status", isCallMethod: true, getCallMethod: this.getStatus }
      ],
      showCol: ["订单编号", "产品数量", "签约日期", "交付日期", "状态"],
      selectRow: {},
@@ -168,32 +178,32 @@
      bottomTwoTableList2: {},
      bottomTwoTableList3: {},
      productColumn: [
        { label: "产品名称", prop: "number", min: 90, default: true },
        { label: "产品编号", prop: "quotationName", min: 120 },
        { label: "Bom编号", prop: "validity_date", min: 100 },
        { label: "产品规格", prop: "client_name", min: 120 },
        { label: "产品数量", prop: "quotationStatus" },
        { label: "单位", prop: "client_name", min: 120 }
        { label: "产品名称", prop: "productName", min: 90, default: true },
        { label: "产品编号", prop: "productId", min: 120 },
        { label: "Bom编号", prop: "bomID", min: 100 },
        { label: "产品规格", prop: "specs", min: 120 },
        { label: "产品数量", prop: "amount" },
        { label: "单位", prop: "unit", min: 120 }
      ],
      showProductCol: ["产品名称", "产品编号", "Bom编号", "产品规格", "产品数量", "单位"],
      materialRquestColumn: [
        { label: "产品名称", prop: "number", min: 90, default: true },
        { label: "产品编号", prop: "quotationName", min: 120 },
        { label: "产品数量", prop: "validity_date", min: 100 },
        { label: "产品规格", prop: "client_name", min: 120 },
        { label: "产品型号", prop: "quotationStatus" },
        { label: "单位", prop: "client_name", min: 120 }
        { label: "产品名称", prop: "materialName", min: 90, default: true },
        { label: "产品编号", prop: "materialNumber", min: 120 },
        { label: "产品数量", prop: "amount", min: 100 },
        { label: "产品规格", prop: "specs", min: 120 },
        { label: "产品型号", prop: "type" },
        { label: "单位", prop: "unit", min: 120 }
      ],
      showMaterialRquestCol: ["产品名称", "产品编号", "产品数量", "产品规格", "产品型号", "单位"],
      deliveryRquestColumn: [
        { label: "发货单号", prop: "number", default: true },
        { label: "产品名称", prop: "number", default: true },
        { label: "产品编号", prop: "quotationName" },
        { label: "订单数量", prop: "validity_date" },
        { label: "产品名称", prop: "productName", default: true },
        { label: "产品编号", prop: "productId" },
        { label: "订单数量", prop: "amount" },
        { label: "发货数量", prop: "validity_date" },
        { label: "产品规格", prop: "client_name" },
        { label: "产品型号", prop: "quotationStatus" },
        { label: "单位", prop: "client_name" },
        { label: "产品规格", prop: "specs" },
        { label: "产品型号", prop: "model" },
        { label: "单位", prop: "unit" },
        { label: "运单号", prop: "validity_date" },
        { label: "承运商", prop: "validity_date" },
        { label: "创建时间", prop: "client_name", min: 100 }
@@ -220,22 +230,88 @@
        visible: false,
        title: "发货",
        infomation: {}
      },
      searchParam: {
        keyword: "",
        page: 1,
        pageSize: 15
      }
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    reRreshData() {
      this.getData()
    },
    // 获取top订单列表数据
    async getData() {
      this.searchParam.page = this.pagerOptions.currPage
      this.searchParam.pageSize = this.pagerOptions.pageSize
      let rsp = await outsourceOrderList(this.searchParam)
      let list = rsp
      console.log(list)
      if (list && list.code == 200) {
        this.tableList.tableInfomation = list.data
        this.pagerOptions.totalCount = list.total
        if (list.total > 0) {
          this.selectRow = list.data[0]
          this.getProductListMethod(list.data[0].id)
        }
        this.overview()
      }
    },
    // 获取产品信息
    getProductListMethod(id) {
      outsourceOrderProductList({ outsourcingOrderId: id }).then((res) => {
        console.log(res)
        if (res.code == 200) {
          this.bottomTwoTableList1.tableInfomation = res.data
        }
      })
    },
    // 获取物料申请单
    getMaterialApplyList(number) {
      getMaterialApplyList({ number: number, page: 1, pageSize: 15 }).then((res) => {
        console.log(res)
        if (res.code == 200) {
          this.bottomTwoTableList2.tableInfomation = res.data
        }
      })
    },
    overview() {
      outsourceOrderOverview().then((reply) => {
        this.totalObject.value = reply.data.total || 0
        this.otherOptions.map((item) => {
          if (item.label === "待分配") {
            item.value = reply.data.waitAssigned
          } else if (item.label === "已分配") {
            item.value = reply.data.hasAssigned
          }
        })
      })
    },
    addCommonClick() {
      alert("露西666")
    },
    searchClick() {},
    onFilterSearch() {},
    tableRowClick() {},
    tableRowClick(row, column, event) {
      console.log(row, column, event)
      this.selectRow = row
      if (this.activeNameBottom == 1) {
        this.getProductListMethod(this.selectRow.id)
      } else {
        this.getMaterialApplyList(this.selectRow.number)
      }
    },
    tableRowClassName({ row }) {
      if (row.id == this.selectRow.id) {
        return "onSelect"
      }
    },
    getSelectArray() {},
    // 申请物料
    applyClick(row) {
@@ -257,22 +333,17 @@
    },
    tabClickBottom(activeNameBottom) {
      this.activeNameBottom = activeNameBottom
      // if (activeNameBottom == 1) {
      //   this.getProductListMethod(this.selectRow.id);
      // } else {
      //   this.getMaterialApplyList(this.selectRow.number);
      // }
      if (activeNameBottom == 1) {
        this.getProductListMethod(this.selectRow.id)
      } else {
        this.getMaterialApplyList(this.selectRow.number)
      }
    },
    setTable() {
      this.tableList = {
        selectIndex: true,
        selectBox: true,
        tableInfomation: [
          {
            number: "1111",
            status: 4
          }
        ],
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
        tableColumn: this.setColumnVisible(this.showCol, this.tableColumn)
@@ -354,10 +425,8 @@
    },
    // 状态
    getStatus(val) {
      return val === 0
        ? "待分配"
        : val === 1
        ? "已分配"
      return val === 1
        ? "待确认"
        : val === 2
        ? "待生产"
        : val === 3