Просмотр исходного кода

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
修改

1004749546@qq.com 4 лет назад
Родитель
Сommit
6732846b7e

+ 25 - 17
src/config/router.config.js

@@ -67,24 +67,32 @@ export const asyncRouterMap = [{
       }
       }
     }]
     }]
   },
   },
-  // 考评方案管理
+  // 考评管理
   {
   {
-	  path: '/evaluationPlan',
-	  redirect: '/evaluationPlan/list',
-	  component: PageView,
-	  meta: {
-	    title: '考评方案管理',
-	    icon: 'team'
-	  },
-	  children: [{
-	    path: '/evaluationPlan/list',
-	    name: 'EvaluationPlanList',
-	    component: () => import(/* webpackChunkName: "tenants" */ '@/views/evaluationPlan/EvaluationPlanList.vue'),
-	    meta: {
-	      title: '考评方案管理列表',
-	      icon: 'team'
-	    }
-	  }]
+    path: '/evaluation',
+    redirect: '/evaluation/evaluationItem',
+    component: PageView,
+    meta: {
+      title: '考评管理',
+      icon: 'team'
+    },
+    children: [{
+      path: '/evaluation/evaluationItem',
+      name: 'EvaluationItem',
+      component: () => import(/* webpackChunkName: "evaluation" */ '@/views/evaluation/evaluationItem/EvaluationItem.vue'),
+      meta: {
+        title: '考评项目',
+        icon: 'team'
+      }
+    }, {
+      path: '/evaluation/evaluationPlan',
+      name: 'EvaluationPlan',
+      component: () => import(/* webpackChunkName: "evaluation" */ '@/views/evaluation/evaluationPlan/EvaluationPlan.vue'),
+      meta: {
+        title: '考评方案',
+        icon: 'team'
+      }
+    }]
   },
   },
   // 业务 设置setting
   // 业务 设置setting
   {
   {

+ 194 - 0
src/views/evaluation/evaluationItem/AddEvaModal.vue

@@ -0,0 +1,194 @@
+<template>
+  <div>
+    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel" :width="600">
+      <a-form :form="form" ref="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 考评项目名称 -->
+            <a-form-item label="考评项目名称:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input
+                allowClear
+                :maxLength="128"
+                v-decorator="[
+                  'formData.name',
+                  { initialValue: formData.name,
+                    rules: [{ required: true, message: '请输入考评项目名称!' }] },
+                ]"
+                placeholder="请输入考评项目名称" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 考评项目说明 -->
+            <a-form-item label="考评项目说明:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-textarea
+                allowClear
+                :maxLength="512"
+                Input.TextArea
+                :autoSize="{minRows:5}"
+                v-decorator="[
+                  'formData.remarks',
+                  { initialValue: formData.remarks },
+                ]"
+                placeholder="请输入考评项目说明" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button type="primary" @click="handleSubmit()">
+            确定
+          </a-button>
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  saveAuth
+} from '@/api/tenants.js'
+export default {
+  name: 'AddEvaModal',
+  components: {
+    STable,
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的方案id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaModal'
+      }),
+      formData: {
+        name: '', // 方案名称
+        scopeType: [], // 适用类型
+        remarks: '' // 方案说明
+      }
+
+    }
+  },
+  computed: {
+    // 弹框标题
+    titleText () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
+  methods: {
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+    // 使用权限改变
+    scopeTypeChange (v) {
+      this.formData.scopeType = v
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log(values.formData, ' formData.type222222222')
+          // const params = Object.assign({
+          //   id: this.itemData.id
+          // }, values.formData)
+          // params.expireDate = moment(params.expireDate).format('YYYY-MM-DD')
+          // console.log(params, 'ppppppppppppp')
+          // saveAuth(params).then(res => {
+          //   console.log(res, 'res--save')
+          //   if (res.status + '' === '200') {
+          //     this.$message.success(res.message ? res.message : '保存成功')
+          //     this.$emit('refresh')
+          //     setTimeout(function () {
+          //       _this.cancel()
+          //     }, 300)
+          //   } else {
+          //     // this.$message.warning(res.message)
+          //   }
+          // })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.clear()
+          _this.cancel()
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+	  // 重置时 下拉框不起作用,对下拉框单独设置
+	  this.form.setFields({ 'formData.scopeType': { value: [], errors: '' } })
+    }
+
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'AddEvaModal'
+    })
+  }
+
+}
+</script>
+
+<style>
+	.modalBox {}
+
+	.ant-modal-footer {
+		display: none;
+	}
+
+	.time-text {
+		color: #1890FF;
+		padding: 0px 20px;
+		cursor: pointer;
+	}
+
+	.labelT {
+		position: absolute;
+		left: -135px;
+		top: 20px;
+		color: rgba(0, 0, 0, 0.85);
+	}
+</style>

+ 266 - 0
src/views/evaluation/evaluationItem/EvaluationItem.vue

@@ -0,0 +1,266 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="考评项目名称">
+              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="CHECK_ENABLE_STATE"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-button type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button type="primary" icon="plus" @click="openModal">新建</a-button>
+    </div>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon type="edit" class="actionBtn blue" v-if="record.status == '0'" @click="openModal(record)" />
+        <a-icon type="delete" class="actionBtn red" v-if="record.status == '0'" @click="delect(record)" />
+        <a-icon type="setting" class="actionBtn orange" @click="handleSet(record)" />
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <a-switch checkedChildren="已启用" unCheckedChildren="已禁用" v-model="row.status" @change="changeFlagHandle(text, row)"/>
+      </template>
+    </s-table>
+    <!-- 新增/编辑 弹窗 -->
+    <add-evaModal :itemId="itemId" :visible="openAddModal" @refresh="$refs.table.refresh()" @close="openAddModal=false"></add-evaModal>
+    <!-- 设置弹窗 -->
+    <!-- <set-evaModal :itemId="itemId" :visible="openSetting" @refresh="$refs.table.refresh()" @close="openSetting=false"></set-evaModal> -->
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  getTenantsList,
+  enable
+} from '@/api/tenants.js'
+import addEvaModal from './AddEvaModal.vue'
+// import setEvaModal from './SetEvaModal.vue'
+import moment from 'moment'
+export default {
+  name: 'EvaluationPlanList',
+  components: {
+    STable,
+    VSelect,
+    addEvaModal
+    // setEvaModal
+  },
+  data () {
+    return {
+      moment,
+      pageNo: 1,
+      pageSize: 10,
+      openAddModal: false, // 打开新增弹窗
+	  openSetting: false, // 打开设置弹窗
+      itemId: '', // 要编辑的租户id
+      // 查询参数
+      queryParam: {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '考评方案名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '考评方案说明',
+        dataIndex: 'orgType',
+        width: '120',
+        align: 'center'
+      },
+      {
+        title: '适用模式',
+        width: '120',
+        align: 'center',
+        dataIndex: 'contactPhone'
+      },
+      {
+        title: '状态',
+        width: '200',
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+              _item.status = _item.status + '' === '1'
+            }
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.$refs.table.refresh()
+    })
+  },
+  methods: {
+    // 修改状态
+    changeFlagHandle (text, record) {
+      const _data = {
+        id: record.id,
+        status: record.status ? '1' : '0'
+      }
+      if (!record.expireDate && _data.status == '1') {
+        this.$message.success('请确认授权设置无误并点击【确定】后,再进行启用!')
+        record.status = !record.status
+      } else {
+        enable(_data).then(res => {
+          console.log(res.status)
+          if (res.status == '200') {
+            this.$message.success('修改成功')
+            this.$refs.table.refresh()
+          } else {
+            record.status = !record.status
+          }
+        })
+      }
+    },
+    // 打开新增弹窗
+    openModal (row) {
+      this.itemId = row ? row.id : ''
+      this.openAddModal = true
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        content: '删除后无法恢复,确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          // deleteItem({
+          // 	id: row.id
+          // }).then(res => {
+          // 	if (res.status == 200) {
+          // 		_this.$message.success('删除成功')
+          // 		_this.$refs.table.refresh()
+          // 	}
+          // })
+        }
+      })
+    },
+    // 打开设置弹框
+    handleSet (row) {
+      this.openSetting = true
+	  console.log(this.openSetting)
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        contactPhone: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh()
+    }
+  }
+}
+</script>
+<style>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.textCount {
+		border: 1px solid #91d5ff;
+		background-color: #e6f7ff;
+		padding: 10px 0;
+		border-radius: 5px;
+		padding-left: 20px;
+		margin: 10px 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.red {
+		color: red;
+	}
+	.orange {
+		color: #ffaa00;
+	}
+</style>

+ 1 - 1
src/views/evaluationPlan/AddEvaModal.vue → src/views/evaluation/evaluationPlan/AddEvaModal.vue

@@ -45,7 +45,7 @@
                 allowClear
                 allowClear
                 :maxLength="512"
                 :maxLength="512"
                 Input.TextArea
                 Input.TextArea
-                :autoSize="{minRows:3}"
+                :autoSize="{minRows:5}"
                 v-decorator="[
                 v-decorator="[
                   'formData.remarks',
                   'formData.remarks',
                   { initialValue: formData.remarks },
                   { initialValue: formData.remarks },

+ 0 - 11
src/views/evaluationPlan/EvaluationPlanList.vue → src/views/evaluation/evaluationPlan/EvaluationPlan.vue

@@ -148,17 +148,6 @@ export default {
     })
     })
   },
   },
   methods: {
   methods: {
-    // 地址拼接
-    getAddr (row) {
-      const provinceName = row.provinceName ? row.provinceName : ''
-      const cityName = row.cityName ? row.cityName : ''
-      const districtName = row.districtName ? row.districtName : ''
-      const addrDetail = row.addrDetail ? row.addrDetail : ''
-      if (provinceName === cityName) {
-        return cityName + districtName + addrDetail
-      }
-      return provinceName + cityName + districtName + addrDetail
-    },
     // 修改状态
     // 修改状态
     changeFlagHandle (text, record) {
     changeFlagHandle (text, record) {
       const _data = {
       const _data = {

+ 0 - 0
src/views/evaluationPlan/SetEvaModal.vue → src/views/evaluation/evaluationPlan/SetEvaModal.vue