Browse Source

增加反馈页面

ljb 9 months ago
parent
commit
5fcc442abf

+ 38 - 0
src/api/system/feedback.js

@@ -0,0 +1,38 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/kd-scientific/feedback/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/kd-scientific/feedback/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/kd-scientific/feedback/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+// 回复
+export const reply = (row) => {
+  return request({
+    url: '/api/kd-scientific/feedback/reply',
+    method: 'post',
+    data: row
+  })
+}

+ 15 - 0
src/config/dict.js

@@ -10,6 +10,21 @@ export const ZC_STATUS = [{
   value: 2
 }];
 
+// 系统反馈类型
+export const FEEDBACK_TYPE_DICTS = [{
+  label: '建议意见',
+  value: 1
+}, {
+  label: '技术服务问题',
+  value: 2
+}, {
+  label: '系统应用问题',
+  value: 3
+}, {
+  label: '其他',
+  value: 4
+}]
+
 // 高新领域
 export const HIGH_TECH_FIELDS = [{
   value: 1,

+ 11 - 10
src/option/RDSystemManage/list.js

@@ -21,6 +21,7 @@ export default {
   dialogClickModal: false,
   dialogType: "drawer",
   dialogWidth: 520,
+
   addBtnText: "上传制度",
   column: [
     {
@@ -47,7 +48,7 @@ export default {
       label: '企业制度的文件名称',
       prop: 'zdwjdz',
       type: "upload",
-      search: true,
+      search: false,
       multiple: true,
       span: 24,
       action: '/api/kd-resource/oss/endpoint/put-file',
@@ -103,14 +104,14 @@ export default {
         },
       ],
     },
-    {
-      label: '制度上传时间',
-      prop: 'createTime',
-      span: 24,
-      display: false,
-      align: 'center',
-      width: 140,
-      search: true,
-    },
+    // {
+    //   label: '制度上传时间',
+    //   prop: 'createTime',
+    //   span: 24,
+    //   display: false,
+    //   align: 'center',
+    //   width: 140,
+    //   search: true,
+    // },
   ],
 };

+ 79 - 0
src/option/system/feedback.js

@@ -0,0 +1,79 @@
+import { FEEDBACK_TYPE_DICTS } from "@/config/dict";
+
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  addBtn: false,
+  delBtn: false,
+  editBtn: false,
+  menuWidth: 120,
+  dialogClickModal: false,
+  column: [
+    {
+      label: "反馈类型",
+      prop: "type",
+      type: "select",
+      width: 110,
+      align: "center",
+      search: true,
+      dicData: FEEDBACK_TYPE_DICTS
+    },
+    {
+      label: "详细描述",
+      minWidth: 360,
+      prop: "remark",
+      overHidden: true
+    },
+    {
+      label: "截图证明",
+      prop: "attachment",
+      type: "upload",
+      listType: "picture-card",
+      width: 300,
+      fileType: "img",
+      accept: "image/png, image/jpeg",
+      limit: 5,
+      propsHttp: {
+        res: "data",
+        url: 'link',
+      },
+      action: '/api/kd-resource/oss/endpoint/put-file',
+    },
+    {
+      label: "反馈用户",
+      prop: "userName",
+      search: true,
+      width: 100,
+      align: 'center'
+    },
+    {
+      label: "反馈公司",
+      prop: "tenantName",
+      search: true,
+      width: 160,
+      align: 'center'
+    },
+    {
+      label: "反馈时间",
+      align: "center",
+      type: "date",
+      prop: "createTime",
+      search: true,
+      width: 140
+    },
+    {
+      label: "状态",
+      align: "status",
+      type: 'select',
+      search: true,
+      align: 'center',
+      width: 120
+    }
+  ]
+};

+ 0 - 109
src/page/index/feedback/admin.vue

@@ -1,109 +0,0 @@
-<template>
-  <avue-crud
-    :option="option">
-    <template slot="menuLeft">
-      <el-button type="primary"
-        size="small"
-        icon="el-icon-plus"
-        @click="handleAdd"
-      >
-        提交反馈
-      </el-button>
-    </template>
-    <template slot="menu">
-      <el-button type="text">回复</el-button>
-    </template>
-  </avue-crud>
-</template>
-
-<script>
-const TYPE_DICTS = [{
-  label: '建议意见',
-  value: 1
-}, {
-  label: '技术服务问题',
-  value: 2
-}, {
-  label: '系统应用问题',
-  value: 3
-}, {
-  label: '其他',
-  value: 4
-}];
-
-export default {
-  name: "SystemFeedback",
-  data() {
-    return {
-      option: {
-        addBtn: false,
-        border: true,
-        index: true,
-        menuWidth: 90,        
-        headerAlign: "center",
-        column: [
-          {
-            label: "反馈类型",
-            prop: "type",
-            type: "select",
-            width: 110,
-            align: "center",
-            search: true,
-            dicData: TYPE_DICTS
-          },
-          {
-            label: "详细描述",
-            minWidth: 360,
-            prop: "desc",
-            overHidden: true
-          },
-          {
-            label: "截图证明",
-            prop: "message",
-            minWidth: 300
-          },
-          {
-            label: "反馈用户",
-            prop: "createUser",
-            search: true,
-            width: 120,
-          },
-          {
-            label: "反馈公司",
-            prop: "createUser",
-            search: true,
-            width: 190,
-          },
-          {
-            label: "反馈时间",
-            align: "center",
-            type: "date",
-            prop: "createDate",
-            search: true,
-            width: 160
-          },
-          {
-            label: "状态",
-            align: "center",
-            type: 'select',
-            search: true,
-            width: 120
-          }
-        ]
-      }
-    };
-  },
-  methods: {
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.code {
-  font-size: 12px;
-  display: block;
-  font-family: monospace;
-  white-space: pre;
-  margin: 1em 0px;
-}
-</style>

+ 0 - 109
src/page/index/feedback/comp.vue

@@ -1,109 +0,0 @@
-<template>
-  <avue-crud
-    :option="option">
-    <template slot="menuLeft">
-      <el-button type="primary"
-        size="small"
-        icon="el-icon-plus"
-        @click="handleAdd"
-      >
-        提交反馈
-      </el-button>
-    </template>
-    <template slot="menu">
-      <el-button type="text">回复</el-button>
-    </template>
-  </avue-crud>
-</template>
-
-<script>
-const TYPE_DICTS = [{
-  label: '建议意见',
-  value: 1
-}, {
-  label: '技术服务问题',
-  value: 2
-}, {
-  label: '系统应用问题',
-  value: 3
-}, {
-  label: '其他',
-  value: 4
-}];
-
-export default {
-  name: "SystemFeedback",
-  data() {
-    return {
-      option: {
-        addBtn: false,
-        border: true,
-        index: true,
-        menuWidth: 90,        
-        headerAlign: "center",
-        column: [
-          {
-            label: "反馈类型",
-            prop: "type",
-            type: "select",
-            width: 110,
-            align: "center",
-            search: true,
-            dicData: TYPE_DICTS
-          },
-          {
-            label: "详细描述",
-            minWidth: 360,
-            prop: "desc",
-            overHidden: true
-          },
-          {
-            label: "截图证明",
-            prop: "message",
-            minWidth: 300
-          },
-          {
-            label: "反馈用户",
-            prop: "createUser",
-            search: true,
-            width: 120,
-          },
-          {
-            label: "反馈公司",
-            prop: "createUser",
-            search: true,
-            width: 190,
-          },
-          {
-            label: "反馈时间",
-            align: "center",
-            type: "date",
-            prop: "createDate",
-            search: true,
-            width: 160
-          },
-          {
-            label: "状态",
-            align: "center",
-            type: 'select',
-            search: true,
-            width: 120
-          }
-        ]
-      }
-    };
-  },
-  methods: {
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.code {
-  font-size: 12px;
-  display: block;
-  font-family: monospace;
-  white-space: pre;
-  margin: 1em 0px;
-}
-</style>

+ 0 - 22
src/page/index/feedback/index.vue

@@ -1,22 +0,0 @@
-<template>
-  <div>1324</div>
-</template>
-
-<script>
-import admin from './admin.vue';
-import comp from './comp.vue';
-import { mapGetters } from 'vuex';
-
-export default {
-  components: {
-    admin,
-    comp
-  },
-  computed: {
-    ...mapGetters(['userInfo'])
-  },
-  mounted() {
-    console.log(this.userInfo)
-  }
-}
-</script>

+ 84 - 0
src/page/index/top/feedback/admin.vue

@@ -0,0 +1,84 @@
+<template>
+  <div>
+    <avue-crud
+      v-bind="bindVal"
+      v-on="onEvent"
+      v-model="form"
+      :page.sync="page"
+      :before-open="handleBeforeOpen"
+      :permission="permissionList"
+    >
+      <template slot="menuLeft">
+        <el-button
+          type="warning"
+          size="small"
+          plain
+          icon="el-icon-download"
+          @click="handleExport"
+        >
+          导出
+        </el-button>
+        <print-table-btn @click="printTable" />
+      </template>
+    
+    </avue-crud>
+
+    <WideTablePrinter
+      ref="printWideTable"
+      :columns="wideTableColumns"
+      :data="data"
+      :print-title="printTitle"
+      :rows-per-page="30"
+      :default-landscape="true"
+    />
+  </div>
+</template>
+
+<script>
+import {exportBloByPost} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
+import crudCommon from '@/mixins/crud';
+
+
+
+export default crudCommon({
+  data() {
+    return {
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  methods: {
+    handleExport() {
+      // exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+      //   downloadXls(res.data, `科研资产台账RD匹配表${this.params.yearAndMonth}.xlsx`);
+      // });
+    },
+    /**
+     * 打印表格
+     * @param isLandscape 是否横向打印
+     */
+    printTable(isLandscape) {
+      this.wideTableColumns = this.$refs.crud.columnOption;
+      this.printTitle = `反馈记录${this.params.yearAndMonth}`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
+    },
+  },
+}, {
+  // 模块路径
+  name: 'system/feedback',
+  res: ({ data }) => {
+    return data;
+  },
+});
+</script>

+ 95 - 0
src/page/index/top/feedback/comp.vue

@@ -0,0 +1,95 @@
+<template>
+  <el-tabs v-model="activeName">
+    <el-tab-pane label="问题反馈" name="submitForm">
+      <div style="width: 80%; margin: 0 auto;">
+        <avue-form v-model="feedbackForm" :option="option" @submit="handleSubmitFeedback"></avue-form>
+      </div>
+    </el-tab-pane>
+    <el-tab-pane label="历史反馈" name="history">
+
+    </el-tab-pane>
+  </el-tabs>
+</template>
+
+<script>
+import { getList, add, rep } from "@/api/system/feedback";
+import { FEEDBACK_TYPE_DICTS } from "@/config/dict";
+
+export default {
+  name: "CompFeedback",
+  data() {
+    return {
+      activeName: 'submitForm',
+      feedbackForm: {},
+      option: {
+        labelWidth: 100,
+        column: [
+         {
+            label:'反馈类型',
+            prop:'type',
+            type:'select',
+            dicData: FEEDBACK_TYPE_DICTS,
+            span: 24,
+            rules: [{
+              required: true,
+              message: '请选择反馈类型',
+              trigger: 'blur'
+            }]
+         },
+         {
+            label:'详细描述',
+            prop:'remark',
+            type: 'textarea',
+            span: 24,
+            rules: [{
+              required: true,
+              message: '请输入详细描述',
+              trigger: 'blur'
+            }]
+         },
+         {
+            label: "截图证明",
+            prop: "attachment",
+            type: "upload",
+            listType: "picture-card",
+            span: 24,
+            fileType: "img",
+            accept: "image/png, image/jpeg",
+            limit: 5,
+            propsHttp: {
+              res: "data",
+              url: 'link',
+            },
+            action: '/api/kd-resource/oss/endpoint/put-file',
+            tip: "支持png、jpg等格式",
+          },
+        ]
+      }
+    };
+  },
+  methods: {
+    handleSubmitFeedback(done) {
+      const params = { ...this.feedbackForm };
+      params.attachment = params.attachment.join(',');
+      add(params).then(({ data }) => {
+        done();
+        if (data.data.code == 200) {
+          this.$message.success("提交成功!");
+        }
+      }).catch(() => {
+        done();
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.code {
+  font-size: 12px;
+  display: block;
+  font-family: monospace;
+  white-space: pre;
+  margin: 1em 0px;
+}
+</style>

+ 1 - 1
src/page/index/top/index.vue

@@ -19,7 +19,7 @@
       </span>
     </div>
     <div class="top-bar__right">
-      <!-- <top-feedback></top-feedback> -->
+      <top-feedback></top-feedback>
       <el-tooltip v-if="showColor"
                   effect="dark"
                   :content="$t('navbar.color')"

+ 17 - 9
src/page/index/top/top-feedback.vue

@@ -1,31 +1,39 @@
 <template>
   <div style="margin-right: 10px;">
     <el-link style="color: #fff;" @click="handleOpen">问题反馈</el-link>
-    <el-dialog title="反馈记录"
+    <el-dialog
+      title="问题反馈"
       :visible.sync="box"
-      fullscreen
-      width="100%"
+      :fullscreen="isAdmin"
+      :width="isAdmin ? '100%' : '900px'"
       append-to-body>
-      <feedback></feedback>
+      <template v-if="box">
+        <admin v-if="isAdmin"></admin>
+        <comp v-else></comp>
+      </template>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import { mapGetters } from "vuex";
-import feedback from "@/page/index/feedback";
+import admin from './feedback/admin.vue';
+import comp from './feedback/comp.vue';
+
+
 export default {
   name: "top-feedback",
-  components: { feedback },
+  components: { admin, comp },
   data() {
     return {
       box: false
     };
   },
-  created() {},
-  mounted() {},
   computed: {
-    ...mapGetters(["logsFlag", "logsLen"])
+    ...mapGetters(["userInfo"]),
+    isAdmin() {
+      return this.userInfo.tenant_id == "000000";
+    }
   },
   props: [],
   methods: {

+ 5 - 4
src/views/RD-system-manage/list.vue

@@ -57,13 +57,13 @@
 
       <template slot="zdwjdz" slot-scope="{row}">
         <div v-for="(item, index) of row.zdwjdz" :key="index">
-          <el-link @click="handleDownFile(item)">{{ item.label }}</el-link>
+          <el-link type="primary" @click="handleDownFile(item)">{{ item.label }}</el-link>
         </div>
       </template>
 
       <template slot="zdsszm" slot-scope="{row}">
         <div v-for="(item, index) of row.zdsszm" :key="index">
-          <el-link @click="handleDownFile(item)">{{ item.label }}</el-link>
+          <el-link type="primary" @click="handleDownFile(item)">{{ item.label }}</el-link>
         </div>
       </template>
       
@@ -141,10 +141,10 @@ export default window.$crudCommon({
     getFormData() {
       const params = { ...this.form };
       let zdwjmc = [];
-      params.zdwjmc.forEach(item => {
+      params.zdwjdz.forEach(item => {
         zdwjmc.push(item.label);
       });
-      params.zdwjdz = JSON.stringify(params.zdwjmc);
+      params.zdwjdz = JSON.stringify(params.zdwjdz);
       params.zdwjmc = zdwjmc.join(',');
       params.zdsszm = JSON.stringify(params.zdsszm);
       params.yearAndMonth = this.params.yearAndMonth;
@@ -170,6 +170,7 @@ export default window.$crudCommon({
       window.open(file.value);
     }
   },
+
 }, {
   // 模块路径
   name: 'RDSystemManage/list',

+ 19 - 1
src/views/archive-manage/file-supplement.vue

@@ -8,13 +8,21 @@
     >
       <template slot="menuLeft">
         <el-button
+          type="primary"
+          size="small"
+          icon="el-icon-download"
+          @click="handleDownAll"
+        >
+          一键下载
+        </el-button>
+        <el-button
           type="warning"
           size="small"
           plain
           icon="el-icon-download"
           @click="handleExport"
         >
-          导出
+          一键导出
         </el-button>
 
 
@@ -23,6 +31,10 @@
         </div>
       </template>
 
+      <template slot="menu" slot-scope="{row}">
+        <el-button type="text" icon="el-icon-download" size="mini" @click="handleRowDown(row)">下载</el-button>
+      </template>
+
       <template slot="fileList" slot-scope="{row}">
         <el-link
           v-for="(item, index) of row.fileList"
@@ -155,6 +167,12 @@ export default window.$crudCommon({
       link.download = file.label; // 设置下载文件名
       link.click();
     },
+    handleDownAll() {
+      this.$message.warning("功能建设中...");
+    },
+    handleRowDown() {
+      this.$message.warning("功能建设中...");
+    },
     getFormData() {
       return { id: this.form.id, yearAndMonth: this.params.year, [`d${this.currIndex}`]: JSON.stringify(this.form.fileList) }
     },

+ 18 - 15
src/views/project-manage/components/apply-form.vue

@@ -33,21 +33,7 @@
               <el-input v-model="formData.xmbh" placeholder="请输入项目编号" :disabled="isEdit" />
             </td>
           </tr>
-          <tr>
-            <td class="doc-label">
-              <span style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目申请单位
-            </td>
-            <td colspan="3">
-              <second-unit-cascader
-                v-model="formData.xmsqdwid"
-                :yearAndMonth="yearAndMonth"
-                style="width: 100%;"
-                :disabled="isEdit"
-                @change="handleSecondUnitChange"
-              >
-              </second-unit-cascader>
-            </td>
-          </tr>
+
           <tr>
             <td class="doc-label">
               <span style="color: red; padding-right: 3px; font-size: 16px;">*</span>研发开始时间
@@ -76,6 +62,23 @@
               ></el-date-picker>
             </td>
           </tr>
+
+          <tr>
+            <td class="doc-label">
+              <span style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目申请单位
+            </td>
+            <td colspan="3">
+              <second-unit-cascader
+                v-model="formData.xmsqdwid"
+                :yearAndMonth="yearAndMonth"
+                style="width: 100%;"
+                :disabled="isEdit"
+                @change="handleSecondUnitChange"
+              >
+              </second-unit-cascader>
+            </td>
+          </tr>
+          
           <tr>
             <td class="doc-label">
               <span style="color: red; padding-right: 3px; font-size: 16px;">*</span>项目负责人