xiangpei
2024-11-29 69b01c1de544bdaedfa12aaf13600239dabbcb3c
src/views/projectManage/progress/index.vue
@@ -189,7 +189,7 @@
</template>
<script>
import { getList, getRecord, delRecord, addRecord, updateRecord } from "@/api/projectPlan/index";
import { getList, getManagerFlag } from "@/api/projectPlan/index";
export default {
  name: "Index",
@@ -280,46 +280,7 @@
      this.open = true;
      this.title = "添加项目计划记录";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getRecord(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改项目计划记录";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateRecord(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addRecord(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除项目计划记录编号为"' + ids + '"的数据项?').then(function() {
        return delRecord(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('plan/record/export', {
@@ -328,11 +289,16 @@
    },
    /** 查看项目计划记录 */
    handlePlanRecord(row) {
      this.$router.push({
        path: '/projectManage/progressRecord',
        query: {
          data: JSON.stringify(row)
        }
      // 获得主管标志
      getManagerFlag(row.id).then(res => {
        this.managerFlag = res.data;
        row.managerFlag = this.managerFlag;
        this.$router.push({
          path: '/projectManage/progressRecord',
          query: {
            data: row
          }
        })
      })
    }
  }