sunyanqiang 2 rokov pred
rodič
commit
fc5079d86f

+ 44 - 0
src/api/system/diaryset.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询要事日记设置列表
+export function listDiaryset(query) {
+  return request({
+    url: '/system/diaryset/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询要事日记设置详细
+export function getDiaryset(id) {
+  return request({
+    url: '/system/diaryset/' + id,
+    method: 'get'
+  })
+}
+
+// 新增要事日记设置
+export function addDiaryset(data) {
+  return request({
+    url: '/system/diaryset',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改要事日记设置
+export function updateDiaryset(data) {
+  return request({
+    url: '/system/diaryset',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除要事日记设置
+export function delDiaryset(id) {
+  return request({
+    url: '/system/diaryset/' + id,
+    method: 'delete'
+  })
+}

+ 6 - 4
src/views/combatduty/PeopleStatistics/index.vue

@@ -95,10 +95,12 @@ export default {
     getList() {
       this.loading = true;
       listPeopleStatistics(this.queryParams).then((response) => {
-        this.form = response.rows[0];
-        this.form.toggle = response.rows[0].toggle * 1;
-        this.total = response.total;
-        this.loading = false;
+        if (response.rows.length > 0) {
+          this.form = response.rows[0];
+          this.form.toggle = response.rows[0].toggle * 1;
+          this.total = response.total;
+          this.loading = false;
+        }
       });
     },
     // 取消按钮

+ 327 - 0
src/views/system/diaryset/index.vue

@@ -0,0 +1,327 @@
+<template>
+  <div class="app-container">
+    <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="${comment}" prop="setnum">
+        <el-input
+          v-model="queryParams.setnum"
+          placeholder="请输入${comment}"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="${comment}" prop="upname">
+        <el-input
+          v-model="queryParams.upname"
+          placeholder="请输入${comment}"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="${comment}" prop="update">
+        <el-date-picker clearable
+          v-model="queryParams.update"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="请选择${comment}">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="${comment}" prop="types">
+        <el-input
+          v-model="queryParams.types"
+          placeholder="请输入${comment}"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form> -->
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:diaryset:edit']"
+          >修改</el-button
+        >
+      </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:diaryset:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:diaryset:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:diaryset:export']"
+        >导出</el-button>
+      </el-col> -->
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="diarysetList"
+      @selection-change="handleSelectionChange"
+      :header-cell-style="{ background: '#003C69', color: 'white' }"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="序号" align="center" prop="id" />
+      <el-table-column label="是否开启" align="center" prop="setnum" />
+      <el-table-column label="更新人" align="center" prop="upname" />
+      <el-table-column
+        label="更新时间"
+        align="center"
+        prop="update"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.update, "{y}-{m}-{d}") }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="类别" align="center" prop="types" />
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:diaryset:edit']"
+            >修改</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:diaryset:remove']"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改要事日记设置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="${comment}" prop="setnum">
+          <el-input v-model="form.setnum" placeholder="请输入${comment}" />
+        </el-form-item>
+        <el-form-item label="${comment}" prop="upname">
+          <el-input v-model="form.upname" placeholder="请输入${comment}" />
+        </el-form-item>
+        <el-form-item label="${comment}" prop="update">
+          <el-date-picker
+            clearable
+            v-model="form.update"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="请选择${comment}"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="${comment}" prop="types">
+          <el-input v-model="form.types" placeholder="请输入${comment}" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listDiaryset,
+  getDiaryset,
+  delDiaryset,
+  addDiaryset,
+  updateDiaryset,
+} from "@/api/system/diaryset";
+
+export default {
+  name: "Diaryset",
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 要事日记设置表格数据
+      diarysetList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        setnum: null,
+        upname: null,
+        update: null,
+        types: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询要事日记设置列表 */
+    getList() {
+      this.loading = true;
+      listDiaryset(this.queryParams).then((response) => {
+        this.diarysetList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        setnum: null,
+        upname: null,
+        update: null,
+        types: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加要事日记设置";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getDiaryset(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) {
+            updateDiaryset(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addDiaryset(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal
+        .confirm('是否确认删当前的数据项?')
+        .then(function () {
+          return delDiaryset(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "system/diaryset/export",
+        {
+          ...this.queryParams,
+        },
+        `diaryset_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
+};
+</script>

+ 5 - 5
src/views/taishi/index.vue

@@ -963,7 +963,7 @@
                 <div class="right3-r-main-item-r">
                   <div class="s1">本周打印数量</div>
                   <div class="s2">
-                    <b style="color: #30fdff">{{ this.wylist.total }}</b
+                    <b style="color: #30fdff">{{ wylist.total }}</b
                     >份
                   </div>
                 </div>
@@ -975,7 +975,7 @@
                 <div class="right3-r-main-item-r">
                   <div class="s1">归还数量</div>
                   <div class="s2">
-                    <b style="color: #2bf1b2">{{ this.wylist.returnNumber }}</b
+                    <b style="color: #2bf1b2">{{wylist.returnNumber }}</b
                     >份
                   </div>
                 </div>
@@ -988,7 +988,7 @@
                   <div class="s1">未归还数量</div>
                   <div class="s2">
                     <b style="color: #ff5a5a">{{
-                      this.wylist.weiReturnNumber
+                      wylist.weiReturnNumber
                     }}</b
                     >份
                   </div>
@@ -1002,7 +1002,7 @@
                   <div class="s1">无需归还数量</div>
                   <div class="s2">
                     <b style="color: #738c97">{{
-                      this.wylist.noReturnNumber
+                      wylist.noReturnNumber
                     }}</b
                     >份
                   </div>
@@ -1195,7 +1195,6 @@ export default {
     zaiweipeople().then((res) => {
       if (res.code == 200) {
         // this.zwlist = res.data[0];
-        console.log(res);
         let arr = res.data[0];
         for (var i in arr) {
           this.zsz(arr, i);
@@ -1245,6 +1244,7 @@ export default {
     //集中文印
     rizongwenyin().then((res) => {
       this.wylist = res.data;
+      console.log(res.data);
       // if (this.wylist[1]) {
       // } else {
       //   this.wylist[1] = 0;