小小儁爺
2024-11-21 5a254a7606489147ccf6eda046e725019e676b4e
src/views/workOrder/produceOrderList.vue
@@ -12,6 +12,14 @@
        <div style="display: flex">
          <el-button
            v-waves
            type="success"
            icon="el-icon-download"
            @click="download"
          >导出子件
          </el-button>
          <el-button
            v-waves
            type="primary"
            icon="el-icon-bottom"
            @click="batchHandle"
@@ -375,7 +383,7 @@
          <el-table-column
            label="操作"
            fixed="right"
            width="120"
            width="150"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
@@ -405,6 +413,16 @@
                    @click="orderDel(row.id)"
                  />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="明细" placement="top">
                  <i
                    class="el-icon-tickets"
                    :style="{color:$store.state.settings.theme}"
                    style="cursor: pointer;margin-left: 15px"
                    @click="orderDetail(row.sbid)"
                  />
                </el-tooltip>
              </div>
            </template>
          </el-table-column>
@@ -533,6 +551,157 @@
        </div>
      </span>
    </el-dialog>
    <!--   明细-->
    <el-dialog
      v-el-drag-dialog
      title="明细"
      :visible.sync="dialogDetailVisible"
      width="1500px"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleDetailClose"
      @close="handleDetailClose"
    >
      <div>
        <el-table
          ref="tableDataRef"
          class="tableFixed"
          :data="tableDataDetail"
          height="500px"
          border
          row-class-name="custom-row"
          :style="{width: 100+'%',height:'500px'}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange2"
        >
          <el-table-column
            prop="rowNum"
            width="50"
            fixed
            label="序号"
          />
          <el-table-column
            prop="SortSeq"
            label="子件行号"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          />
          <el-table-column
            prop="partcode"
            label="子件编码"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          />
          <el-table-column
            prop="partname"
            label="子件名称"
            sortable="custom"
            show-overflow-tooltip
            min-width="105"
          />
          <el-table-column
            prop="partspec"
            label="子件规格"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          >
            <template slot-scope="{row}">
              {{ row.partspec?row.partspec:'/' }}
            </template>
          </el-table-column>
          <!--          <el-table-column-->
          <!--            prop="stockcode"-->
          <!--            label="仓库编码"-->
          <!--            show-overflow-tooltip-->
          <!--            width="105"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            prop="stockname"
            label="仓库名称"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          />
          <el-table-column
            prop="unitname"
            label="计量单位"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          />
          <el-table-column
            prop="BaseQtyN"
            label="基本用量"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          />
          <el-table-column
            prop="BaseQtyD"
            label="基础数量"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          />
          <el-table-column
            prop="CompScrap"
            label="子件损耗率(%)"
            show-overflow-tooltip
            min-width="140"
            sortable="custom"
          />
          <el-table-column
            prop="exqty"
            label="使用数量"
            show-overflow-tooltip
            min-width="105"
            sortable="custom"
          />
          <el-table-column
            prop="Qty"
            min-width="105"
            label="应领数量"
            show-overflow-tooltip
            sortable="custom"
          />
        </el-table>
        <!--分页-->
        <pagination
          style="margin-top: 10px;"
          :total="tableDataDetailTotal"
          :page.sync="formDetail.page"
          :limit.sync="formDetail.rows"
          align="right"
          layout="total,prev, pager, next,sizes,jumper"
          popper-class="select_bottom"
          @pagination="getErpOrderSubItemSearch"
        />
      </div>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button v-waves @click="dialogVisibleDetailCancel">返 回</el-button>
          <!--          <el-button-->
          <!--            v-waves-->
          <!--            type="primary"-->
          <!--            :loading="$store.state.app.buttonIsDisabled"-->
          <!--            :disabled="$store.state.app.buttonIsDisabled"-->
          <!--            @click="dialogVisibleDeatilConfirm"-->
          <!--          >确 定</el-button>-->
        </div>
      </span>
    </el-dialog>
  </div>
</template>
@@ -543,8 +712,8 @@
import waves from '@/directive/waves'
import {
  ClosedErpOrder,
  DeleteErpOrder,
  ErpOrderSearch,
  DeleteErpOrder, ErpOrderExcelSearch,
  ErpOrderSearch, ErpOrderSubItemSearch,
  MarkBatchSaveErpOrder,
  MarkSaveErpOrder
} from '@/api/WorkOrder'
@@ -659,7 +828,18 @@
          return time.getTime() < Date.now() - 8.64e7
        }
      },
      multipleSelection: []
      multipleSelection: [],
      dialogDetailVisible: false,
      tableDataDetail: [],
      tableDataDetailTotal: 10,
      formDetail: {
        MoDID: '', // 生产订单明细ID
        prop: 'SortSeq', // 排序字段
        order: 'asc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
      }
      // expireTimeOption: {
      //   disabledDate(time) {
@@ -680,6 +860,49 @@
    this.getHeight()
  },
  methods: {
    // 订单导出
    async download() {
      const res = await ErpOrderExcelSearch(this.form)
      window.location.href = res.data
    },
    // 明细
    orderDetail(val) {
      this.formDetail.MoDID = val
      this.getErpOrderSubItemSearch()
      this.dialogDetailVisible = true
    },
    // 获取明细接口
    async getErpOrderSubItemSearch() {
      const res = await ErpOrderSubItemSearch(this.formDetail)
      this.tableDataDetail = res.data
      this.tableDataDetailTotal = res.count
    },
    handleDetailClose() {
      this.tableDataDetail = []
      this.formDetail = {
        MoDID: '', // 生产订单明细ID
        prop: 'SortSeq', // 排序字段
        order: 'asc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
      }
    },
    dialogVisibleDetailCancel() {
      this.dialogDetailVisible = false
    },
    // 排序改变时
    sortChange2({ column, prop, order }) {
      if (order === 'descending') {
        order = 'desc'
      } else if (order === 'ascending') {
        order = 'asc'
      } else {
        order = 'desc'
      }
      this.form.order = order
      this.form.prop = prop
      this.getErpOrderSearch()
    },
    async getPrentOrganizationNoCompany() {
      const { data: res } = await PrentOrganizationNoCompany()
      this.wkshopcodeArr = res