gaoluyang
2025-04-18 ff6d23c5d61d1c6bee47e5863b57a915d98f7be1
1.设备使用授权页面开发、联调
已修改2个文件
77 ■■■■■ 文件已修改
src/api/cnas/resourceDemand/device.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/resourceDemand/device.js
@@ -1320,3 +1320,11 @@
    data: query,
  });
}
//设备使用授权 提价批准通知
export function submitReviewImpowerStatus(query) {
  return request({
    url: "/deviceImpower/submitReviewImpowerStatus",
    method: "post",
    data: query,
  });
}
src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
@@ -98,6 +98,19 @@
        <el-button :loading="submitFormLoading" type="primary" @click="changeMachineName">确认</el-button>
      </span>
    </el-dialog>
    <el-dialog :visible.sync="notificationDia" title="提交审核" width="30%" @close="closeNotificationDia">
      <span style="margin-top: 10px;display: inline-block">
        请选择审核人:
        <el-select v-model="auditId" clearable filterable size="small" style="width: 90%;">
          <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button :loading="notificationLoading" @click="closeNotificationDia">取 消</el-button>
        <el-button :loading="notificationLoading" type="primary" @click="notification">提 交</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -106,10 +119,11 @@
import {
  addImpower,
  deleteImpower, deviceScopeSearch, getImpowerDetail, reviewImpowerStatus,
  selectDeviceImpowerByPage, updateImpower
  selectDeviceImpowerByPage, submitReviewImpowerStatus, updateImpower
} from "@/api/cnas/resourceDemand/device";
import {exportQualityMonitorDetail} from "@/api/cnas/process/ensureResults/qualityMonitor";
import {selectUserCondition} from "@/api/system/user";
import {mapGetters} from "vuex";
export default {
  name: '',
@@ -177,13 +191,23 @@
              },
            },
            {
              name: '授权',
              name: '审核通知',
              type: 'text',
              clickFun: (row) => {
                this.tellApprove(row.impowerId);
              },
              disabled: (row) => {
                return row.status === 1;
              },
            },
            {
              name: '审核',
              type: 'text',
              clickFun: (row) => {
                this.openDia('check', row);
              },
              disabled: (row) => {
                return row.status === 1;
                return row.status === 1 || this.userId !== row.auditId;
              },
            },
            {
@@ -211,7 +235,10 @@
        impowerYear: ''
      },
      delegatedUser: [],
      impowerId: ''
      impowerId: '',
      notificationDia: false,
      auditId: '',
      notificationLoading: false,
    };
  },
  mounted() {
@@ -240,6 +267,37 @@
      }).catch(err => {
        this.tableLoading = false
      })
    },
    // 打开提交批准弹框
    tellApprove(impowerId) {
      this.getUserList()
      this.notificationDia = true
      this.impowerId = impowerId
    },
    // 提交批准通知
    notification() {
      if (!this.auditId) {
        this.$message.warning('请选择审核人')
        return
      }
      this.notificationLoading = true
      submitReviewImpowerStatus({
        auditId: this.auditId,
        impowerId: this.impowerId,
      }).then(res => {
        this.notificationLoading = false
        if (res.code == 200) {
          this.closeNotificationDia()
          this.refreshTableList()
        }
      }).catch(err => {
        this.notificationLoading = false
      })
    },
    // 关闭提交批准弹框
    closeNotificationDia() {
      this.notificationDia = false
      this.auditId = ''
    },
    // 打开操作弹框
    openDia (type, row) {
@@ -400,6 +458,9 @@
      }
    },
  },
  computed: {
    ...mapGetters(["userId"]),
  },
};
</script>