石广澎
2023-12-12 122f6d1db1e0af5ede6f96cd390f393e5f222e99
admin-web/src/views/dashboard/index.vue
@@ -13,7 +13,8 @@
            </el-radio-group>
            <div class="to-more" @click="nav('/stock/transfer/transferissue')">查看更多 ></div>
          </div>
          <el-table v-loading="waitLoading" :data="waitWorkData" class="top-tb" height="265" :show-header="false" size="medium">
          <el-table v-loading="waitLoading" :data="waitWorkData" class="top-tb" height="220" :show-header="false"
                    size="medium">
            <el-table-column prop="businessFormCode" align="center" width="130"></el-table-column>
            <el-table-column prop="inWarehouseName" align="left" min-width="130">
              <template slot-scope="{row}">
@@ -33,7 +34,7 @@
            </el-table-column>
            <el-table-column prop="date" label="操作" fixed="right" align="center" width="80">
              <template slot-scope="scope">
                <el-button @click.native.prevent="aduitThis(scope.row)" size="mini" type="primary">处理</el-button>
                <el-button style="padding: 4px 15px" @click.native.prevent="aduitThis(scope.row)" size="mini" type="primary">处理</el-button>
              </template>
            </el-table-column>
            <el-empty slot="empty" description="暂无数据"></el-empty>
@@ -48,12 +49,13 @@
          <div class="f-r f-r-between m-b-10">
            <el-radio-group size="mini" v-model="earlyWarningType" @change="changeEarlyWarning">
              <el-radio-button label="">全部</el-radio-button>
              <el-radio-button label="2">缺货(12)</el-radio-button>
              <el-radio-button label="1">超出(3)</el-radio-button>
              <el-radio-button label="2">缺货 <span v-if="warningTypeNum.lowNum">({{warningTypeNum.lowNum}})</span></el-radio-button>
              <el-radio-button label="1">超出 <span v-if="warningTypeNum.upNum">({{warningTypeNum.upNum}})</span></el-radio-button>
            </el-radio-group>
            <div class="to-more" @click="nav('/stock/ledger/alertQuery')">查看更多 ></div>
          </div>
          <el-table v-loading="earlyLoading" :data="earlyWarningData" class="top-tb" height="265" :show-header="false" size="medium">
          <el-table v-loading="earlyLoading" :data="earlyWarningData" class="top-tb" height="220" :show-header="false"
                    size="medium">
            <el-table-column prop="baseGoodsTemplateName" align="left" min-width="130">
              <template slot-scope="{row}">
                <el-tooltip class="item" effect="dark" :content="row.baseGoodsTemplateName " placement="top-start">
@@ -138,8 +140,7 @@
// 创建Context
import {LongToDateTime} from "@/utils/DateFormatter";
import {transfeIncome, transferList, transferOutput} from "@/api/stock/transfer";
import {geWarningList} from '@/api/stock/ledger'
import transfer from "@/views/mixins/transfer";
import {getWarningTypeNum, geWarningList} from '@/api/stock/ledger'
const ComponentContext = require.context('./components', false, /\.vue$/i);
let res_components = {};
@@ -172,6 +173,11 @@
      waitType: '0',
      waitWorkData: [], // 待办工作
      earlyWarningType: '',
      warningTypeNum: {
        lowNum: 0,
        totalNum: 0,
        upNum: 0,
      },
      earlyWarningData: [] // 预警通知
    };
  },
@@ -179,7 +185,10 @@
    this.getAuditList()
    this.getWarningList()
    getGoodsNumPrice().then(res => {
      this.goodsNumPrice = res
      if(res){
        this.goodsNumPrice = res
      }
    })
  },
  methods: {
@@ -215,9 +224,9 @@
        this.waitLoading = false
      });
    },
    aduitThis(row){
    aduitThis(row) {
      if (this.waitType === '0') {
       this.handleOutput(row)
        this.handleOutput(row)
      } else {
        this.handleIncome(row)
      }
@@ -229,7 +238,7 @@
          if (action == 'confirm') {
            instance.confirmButtonLoading = true;
            instance.confirmButtonText = '执行中...';
            transfeIncome({ id: row.id })
            transfeIncome({id: row.id})
                .then((res) => {
                  this.$message.success('接收入库成功!');
                  done();
@@ -252,7 +261,7 @@
          if (action == 'confirm') {
            instance.confirmButtonLoading = true;
            instance.confirmButtonText = '执行中...';
            transferOutput({ id: row.id })
            transferOutput({id: row.id})
                .then((res) => {
                  this.$message.success('调拨出库成功!');
                  done();
@@ -279,16 +288,20 @@
    getWarningList() {
      this.earlyLoading = true
      this.earlyWarningData = []
      geWarningList({
        warningType: this.earlyWarningType,
        pageNum: 1,
        pageSize: 5,
      }).then(res => {
        this.earlyLoading = false
        this.earlyWarningData = res.datas;
      }).catch(() => {
        this.waitLoading = false
      });
      getWarningTypeNum().then(res => {
        this.warningTypeNum = res
        geWarningList({
          warningType: this.earlyWarningType,
          pageNum: 1,
          pageSize: 5,
        }).then(res => {
          this.earlyLoading = false
          this.earlyWarningData = res.datas;
        }).catch(() => {
          this.waitLoading = false
        });
      })
    },
    //  跳转
    nav(url) {
@@ -324,9 +337,10 @@
.total-item {
  width: 19%;
  padding: 12px 20px;
  border-radius: 8px;
  border-radius: 4px;
  margin-right: 1%;
  background-color: #FFFFFF;
  border-left: 4px solid #fb6260;
}
.total-item:last-child {