liuguocan
2023-11-28 3f69b4dfc585c4dfbc3c07a6acf5cdd838033636
admin-web/src/views/stock/inventorycount/inventorytask/inventory.vue
@@ -1,6 +1,6 @@
<template>
  <win-md :title="setting.title" @close="close" :width="'1200px'">
    <el-form class="form" ref="ruleForm" :model="formData" :rules="rules">
    <el-form v-loading="loading" class="form" ref="ruleForm" :model="formData" :rules="rules">
      <el-row :gutter="20" style="margin-bottom: 20px" type="flex" align="middle">
        <el-col :span="6">盘点单号:{{ formData.businessFormCode }}</el-col>
        <el-col :span="6">盘点任务:{{ formData.businessFormName }}</el-col>
@@ -10,7 +10,6 @@
        </el-col>
      </el-row>
      <el-table
        v-loading="loading"
        :data="formData.formInventoryGoodsList"
        :rules="rules"
        height="500"
@@ -25,6 +24,7 @@
        <el-table-column prop="realNum" label="实盘数量" align="center">
          <template slot-scope="scope">
            <el-form-item
              style="margin-bottom: 0"
              label-width="0"
              :prop="`formInventoryGoodsList[${scope.$index}].realNum`"
              :rules="rules.realNum"
@@ -57,7 +57,7 @@
  },
  data() {
    return {
      loading: false,
      loading: true,
      btnLoading: false,
      formData: {
        businessFormCode: '',
@@ -75,17 +75,22 @@
  },
  created() {
    const info = JSON.parse(this.setting.info);
    console.log('info', info);
    if (info.states == 1) {
      // 继续盘点
      inventoryDetail({ id: this.setting.id }).then((res) => {
        this.loading = false
        this.formData = res;
        this.formData.id = this.setting.id;
      }).catch(()=>{
        this.loading = false
      });
    } else {
      inventoryQuery({ id: this.setting.id }).then((res) => {
        this.loading = false
        this.formData = res;
        this.formData.id = this.setting.id;
      }).catch(()=>{
        this.loading = false
      });
    }
  },
@@ -98,10 +103,14 @@
        id: this.formData.id,
        inventoryGoodsList: this.formData.formInventoryGoodsList,
      };
      this.loading = true
      inventoryTemporaryStorage(params).then(() => {
        this.loading = false
        this.$message.success('暂存成功!');
        this.close();
        this.$emit('search');
      }).catch(()=>{
        this.loading = false
      });
    },
    save() {
@@ -111,10 +120,13 @@
            ...this.formData,
            inventoryGoodsList: this.formData.formInventoryGoodsList,
          };
          this.loading = true
          inventoryFinish(params).then(() => {
            this.$message.success('暂存成功!');
            this.close();
            this.$emit('search');
          }).catch(()=>{
            this.loading = false
          });
        }
      });