소스 검색

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
考评管理 提交

1004749546@qq.com 4 년 전
부모
커밋
e921f0bbf8

+ 89 - 0
src/api/evaluationItem.js

@@ -0,0 +1,89 @@
+import { axios } from '@/utils/request'
+
+// 列表分页查询
+export const getItemListByPage = (params) => {
+  const url = `/assess/item/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 列表查询 (不带分页)
+export const getItemList = (params) => {
+  const url = `/assess/item/queryList`
+  return axios({
+    url: url,
+    data: {},
+    method: 'post'
+  })
+}
+// 保存考评项目
+export const itemSave = (params) => {
+  return axios({
+    url: '/assess/item/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 考评项目启删除
+export const itemDelete = (params) => {
+  return axios({
+    url: `/assess/item/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评项目启禁用
+export const itemEnable = (params) => {
+  return axios({
+    url: `/assess/item/enable/${params.id}/${params.status}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评项目详情
+export const itemDetail = (params) => {
+  return axios({
+    url: `/assess/item/find/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+/**
+ * 考评指标管理
+ */
+// 考评指标列表查询
+export const itemIndexQuery = (params) => {
+  return axios({
+    url: `/assess/target/query`,
+    data: params,
+    method: 'post'
+  })
+}
+// 考评指标删除
+export const itemIndexDelete = (params) => {
+  return axios({
+    url: `/assess/target/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评指标详情
+export const itemIndexDetail = (params) => {
+  return axios({
+    url: `/assess/target/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评指标保存
+export const itemIndexSave = (params) => {
+  return axios({
+    url: `/assess/target/save`,
+    data: params,
+    method: 'post'
+  })
+}

+ 92 - 0
src/api/evaluationPlan.js

@@ -0,0 +1,92 @@
+import { axios } from '@/utils/request'
+
+// 列表分页查询
+export const planQueryByPage = (params) => {
+  const url = `/assess/scheme/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 列表查询 (不带分页)
+export const planQuery = (params) => {
+  const url = `/assess/scheme/queryList`
+  return axios({
+    url: url,
+    data: {},
+    method: 'post'
+  })
+}
+// 保存考评项目
+export const planSave = (params) => {
+  return axios({
+    url: '/assess/scheme/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 删除
+export const planDelete = (params) => {
+  return axios({
+    url: `/assess/scheme/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 启禁用
+export const planEnable = (params) => {
+  return axios({
+    url: `/assess/scheme/enable/${params.id}/${params.status}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评方案详情
+export const planDetail = (params) => {
+  return axios({
+    url: `/assess/scheme/find/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+/**
+ * 为考评方案选择项目
+ */
+// 考评方案包含项目查询
+export const planItemQuery = (params) => {
+  return axios({
+    url: `/assess/scheme/item/query`,
+    data: params,
+    method: 'post'
+  })
+}
+// 保存考评方案项目
+export const planItemSave = (params) => {
+  return axios({
+    url: `/assess/scheme/item/save`,
+    data: params,
+    method: 'post'
+  })
+}
+/**
+ * 设置默认方案
+ */
+// 默认考评配置查询
+export const planDefaultQuery = (params) => {
+  return axios({
+    url: `/assess/default/query`,
+    data: {},
+    method: 'post'
+  })
+}
+// 保存默认考评配置
+export const planDefaultSave = (params) => {
+  return axios({
+    url: `/assess/default/save`,
+    data: params,
+    method: 'post'
+  })
+}

+ 86 - 60
src/config/router.config.js

@@ -44,6 +44,35 @@ export const asyncRouterMap = [{
     }
     ]
   },
+  // 考评管理
+  {
+    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'
+      }
+    }]
+  },
   // 基础设置 BasicSettings
   {
     path: '/BasicSettings',
@@ -54,27 +83,26 @@ export const asyncRouterMap = [{
       icon: 'apartment'
       // permission: 'M_yyAuth_0'
     },
-    children: [
-      {
-        path: '/BasicSettings/Organization',
-        name: 'Organization',
-        component: () => import(/* webpackChunkName: "auth" */ '@/views/BasicSettings/Organization.vue'),
-        meta: {
-          title: '组织机构',
-          icon: 'user'
-          // permission: 'M_auth_yyUser'
-        }
-      },
-      {
-        path: '/BasicSettings/StoreManagement',
-        name: 'StoreManagement',
-        component: () => import(/* webpackChunkName: "auth" */ '@/views/BasicSettings/StoreManagement.vue'),
-        meta: {
-          title: '门店管理',
-          icon: 'user'
-          // permission: 'M_auth_yyUser'
-        }
+    children: [{
+      path: '/BasicSettings/Organization',
+      name: 'Organization',
+      component: () => import(/* webpackChunkName: "auth" */ '@/views/BasicSettings/Organization.vue'),
+      meta: {
+        title: '组织机构',
+        icon: 'user'
+        // permission: 'M_auth_yyUser'
+      }
+    },
+    {
+      path: '/BasicSettings/StoreManagement',
+      name: 'StoreManagement',
+      component: () => import(/* webpackChunkName: "auth" */ '@/views/BasicSettings/StoreManagement.vue'),
+      meta: {
+        title: '门店管理',
+        icon: 'user'
+        // permission: 'M_auth_yyUser'
       }
+    }
     ]
   },
   {
@@ -86,27 +114,26 @@ export const asyncRouterMap = [{
       icon: 'apartment',
       permission: 'M_yyAuth_0'
     },
-    children: [
-      {
-        path: '/auth/userList',
-        name: 'powerUserList',
-        component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
-        meta: {
-          title: '用户管理',
-          icon: 'user',
-          permission: 'M_auth_yyUser'
-        }
-      },
-      {
-        path: '/auth/roleList',
-        name: 'powerRoleList',
-        component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
-        meta: {
-          title: '角色管理',
-          icon: 'solution',
-          permission: 'M_auth_yyRole'
-        }
+    children: [{
+      path: '/auth/userList',
+      name: 'powerUserList',
+      component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
+      meta: {
+        title: '用户管理',
+        icon: 'user',
+        permission: 'M_auth_yyUser'
+      }
+    },
+    {
+      path: '/auth/roleList',
+      name: 'powerRoleList',
+      component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
+      meta: {
+        title: '角色管理',
+        icon: 'solution',
+        permission: 'M_auth_yyRole'
       }
+    }
     ]
   },
   {
@@ -118,27 +145,26 @@ export const asyncRouterMap = [{
       icon: 'wallet',
       permission: 'M_kqAuth_0'
     },
-    children: [
-      {
-        path: '/CardVoucherAuth/userList',
-        name: 'CardUserList',
-        component: () => import(/* webpackChunkName: "CardVoucherAuth" */ '@/views/CardVoucherAuth/user/userList.vue'),
-        meta: {
-          title: '用户管理',
-          icon: 'user',
-          permission: 'M_auth_kqUser'
-        }
-      },
-      {
-        path: '/CardVoucherAuth/roleList',
-        name: 'CardRoleList',
-        component: () => import(/* webpackChunkName: "CardVoucherAuth" */ '@/views/CardVoucherAuth/role/roleList.vue'),
-        meta: {
-          title: '角色管理',
-          icon: 'solution',
-          permission: 'M_auth_kqRole'
-        }
+    children: [{
+      path: '/CardVoucherAuth/userList',
+      name: 'CardUserList',
+      component: () => import(/* webpackChunkName: "CardVoucherAuth" */ '@/views/CardVoucherAuth/user/userList.vue'),
+      meta: {
+        title: '用户管理',
+        icon: 'user',
+        permission: 'M_auth_kqUser'
       }
+    },
+    {
+      path: '/CardVoucherAuth/roleList',
+      name: 'CardRoleList',
+      component: () => import(/* webpackChunkName: "CardVoucherAuth" */ '@/views/CardVoucherAuth/role/roleList.vue'),
+      meta: {
+        title: '角色管理',
+        icon: 'solution',
+        permission: 'M_auth_kqRole'
+      }
+    }
     ]
   }
   ]

+ 179 - 0
src/views/evaluation/evaluationItem/AddEvaIndexModal.vue

@@ -0,0 +1,179 @@
+<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
+				id="addEvaIndexModal-name"
+                :maxLength="128"
+                v-decorator="[
+                  'formData.name',
+                  { initialValue: formData.name,
+                    rules: [{ required: true, message: '请输入考评指标名称!' }] },
+                ]"
+                placeholder="请输入考评指标名称" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button :loading="loading" id="addEvaIndexModal-submit" type="primary" @click="handleSubmit()">
+            确定
+          </a-button>
+          <a-button id="addEvaIndexModal-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  itemIndexSave,
+  itemIndexDetail
+} from '@/api/evaluationItem.js'
+export default {
+  name: 'AddEvaIndexModal',
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 关联的考评项id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 要编辑的考评指标id
+    itemIndexId: {
+	  type: [String, Number],
+	  default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+		  // 编辑 查数据
+        if (this.itemIndexId) {
+          this.getData(this.itemIndexId)
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaIndexModal'
+      }),
+      formData: {
+        name: '' // 指标名称
+      },
+	  loading: false // 确定按钮loading
+
+    }
+  },
+  computed: {
+    // 弹框标题
+    titleText () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
+  methods: {
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+    // 编辑时,获取数据详情
+    getData (id) {
+      itemIndexDetail({ id: id }).then(res => {
+        if (res.status == 200) {
+          // console.log(res, 'rrrrrrrrrr')
+          this.form.setFieldsValue({ 'formData.name': res.data.name })
+        }
+      })
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+			this.loading = true
+          const params = this.itemIndexId ? Object.assign({ assessItemId: this.itemId, id: this.itemIndexId }, values.formData) : Object.assign({ assessItemId: this.itemId }, values.formData)
+          // console.log(params, 'ppppppppppppp')
+          itemIndexSave(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)
+            }
+			this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.clear()
+          _this.cancel()
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+    }
+
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'AddEvaIndexModal'
+    })
+  }
+
+}
+</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>

+ 205 - 0
src/views/evaluation/evaluationItem/AddEvaItemModal.vue

@@ -0,0 +1,205 @@
+<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
+                id="addEvaItemModal-name"
+                :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
+                id="addEvaItemModal-desc"
+                :maxLength="500"
+                Input.TextArea
+                :autoSize="{minRows:5}"
+                v-decorator="[
+                  'formData.desc',
+                  { initialValue: formData.desc },
+                ]"
+                placeholder="请输入考评项目说明" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button :loading="loading" id="addEvaItemModal-submit" type="primary" @click="handleSubmit()">
+            确定
+          </a-button>
+          <a-button id="addEvaItemModal-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  itemDetail,
+  itemSave
+} from '@/api/evaluationItem.js'
+export default {
+  name: 'AddEvaItemModal',
+  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) {
+        this.form.resetFields()
+        // 编辑查详情
+        if (this.itemId) {
+          this.getFormData(this.itemId)
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaItemModal'
+      }),
+      formData: {
+        name: '', // 方案名称
+        desc: '' // 方案说明
+      },
+	  loading: false // 确定按钮loading
+    }
+  },
+  computed: {
+    // 弹框标题
+    titleText () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
+  methods: {
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.formData.name = ''
+      this.formData.desc = ''
+      this.$emit('close')
+    },
+    // 查详情
+    getFormData (id) {
+      itemDetail({
+        id: id
+      }).then(res => {
+        if (res.status == 200) {
+          // console.log(res, 'rrrrrrrrrr')
+          this.formData = Object.assign(this.formData, res.data)
+          console.log(this.formData, 'this.formData')
+        }
+      })
+    },
+    // 保存提交
+    handleSubmit () {
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+          const params = this.itemId ? Object.assign({
+            id: this.itemId
+          }, values.formData) : values.formData
+          // console.log(params, 'ppppppppppppp')
+          itemSave(params).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(() => {
+                this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.cancel()
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+    }
+
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'AddEvaItemModal'
+    })
+  }
+
+}
+</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 id="evaluationItem-name" allowClear v-model.trim="queryParam.name" placeholder="请输入考评项目名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select
+                id="evaluationItem-status"
+                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 id="evaluationItem-search" type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="evaluationItem-reset" type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button id="evaluationItem-add" 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 id="evaluationItem-edit" type="edit" class="actionBtn blue" v-if="record.status == '0'" @click="openModal(record)" />
+        <a-icon id="evaluationItem-delete" type="delete" class="actionBtn red" v-if="record.status == '0'" @click="delect(record)" />
+        <a-icon id="evaluationItem-setting" type="setting" class="actionBtn orange" @click="handleSet(record)" />
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <a-switch id="evaluationItem-enableStatus" checkedChildren="启用" unCheckedChildren="禁用" v-model="row.status" @change="changeFlagHandle(row)"/>
+      </template>
+    </s-table>
+    <!-- 新增/编辑 弹窗 -->
+    <add-evaItemModal :itemId="itemId" :visible="openAddModal" @refresh="$refs.table.refresh()" @close="openAddModal=false"></add-evaItemModal>
+    <!-- 设置弹窗 -->
+    <set-evaItemModal :itemId="itemId" :itemName="itemName" :visible="openSetting" @close="openSetting=false"></set-evaItemModal>
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  getItemListByPage,
+  itemDelete,
+  itemEnable
+} from '@/api/evaluationItem.js'
+import addEvaItemModal from './AddEvaItemModal.vue'
+import setEvaItemModal from './SetEvaItemModal.vue'
+import moment from 'moment'
+export default {
+  name: 'EvaluationPlanList',
+  components: {
+    STable,
+    VSelect,
+    addEvaItemModal,
+    setEvaItemModal
+  },
+  data () {
+    return {
+      moment,
+      pageNo: 1,
+      pageSize: 10,
+      openAddModal: false, // 打开新增弹窗
+	  openSetting: false, // 打开设置弹窗
+      itemId: '', // 要编辑的考评项id
+      itemName: '', // 要编辑的考评项名称
+      // 查询参数
+      queryParam: {
+        name: '', // 项目名称
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '考评项目名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '考评项目说明',
+        dataIndex: 'desc',
+        width: '120',
+        align: 'center'
+      },
+      {
+        title: '状态',
+        width: '200',
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getItemListByPage(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'
+            }
+            res.data.count = Number(res.data.count)
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.reset()
+    })
+  },
+  methods: {
+    // 修改状态
+    changeFlagHandle (record) {
+      console.log(record, '222222222')
+      const _data = {
+        id: record.id,
+        status: record.status ? '1' : '0'
+      }
+      itemEnable(_data).then(res => {
+        console.log(res.status)
+        if (res.status == '200') {
+          this.$message.success(res.message)
+          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 () {
+          itemDelete({
+          	id: row.id
+          }).then(res => {
+          	if (res.status == 200) {
+          		_this.$message.success(res.message)
+          		_this.$refs.table.refresh()
+          	}
+          })
+        }
+      })
+    },
+    // 打开设置弹框
+    handleSet (row) {
+      this.openSetting = true
+	  this.itemId = row.id
+	  this.itemName = row.name
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+	.table-operator {
+		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>

+ 175 - 0
src/views/evaluation/evaluationItem/SetEvaItemModal.vue

@@ -0,0 +1,175 @@
+<template>
+  <div>
+    <a-modal class="modalBox" title="设置考评指标" v-model="isshow" @cancle="cancel" :width="'60%'">
+      <a-row :gutter="24" class="header">
+        <span>请给考评项目为【{{ itemName }}】设置考评指标</span>
+        <a-button id="setEvaItemModal-add" type="primary" @click="openModal">新增</a-button>
+      </a-row>
+      <a-table
+        ref="table"
+        size="default"
+        :pagination="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :dataSource="list"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-icon id="setEvaItemModal-edit" type="edit" class="actionBtn blue" @click="openModal(record)" />
+          <a-icon id="setEvaItemModal-delete" type="delete" class="actionBtn red" @click="delect(record)" />
+        </template>
+      </a-table>
+      <!-- 新增/编辑 弹窗 -->
+      <add-evaIndexModal :itemId="itemId" :itemIndexId="itemIndexId" :visible="openAddModal" @refresh="getList" @close="openAddModal=false"></add-evaIndexModal>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  itemIndexQuery,
+  itemIndexDelete
+} from '@/api/evaluationItem.js'
+import addEvaIndexModal from './AddEvaIndexModal.vue'
+export default {
+  name: 'SetEvaItemModal',
+  components: {
+    addEvaIndexModal
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的考评项id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 要编辑的考评项名称
+    itemName: {
+      type: String,
+      default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        this.getList()
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      openAddModal: false, // 是否打开编辑/新增弹框
+      itemIndexId: '', // 考评指标id
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '考评指标名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      list: []
+    }
+  },
+  computed: {},
+  methods: {
+    // 获取列表数据
+    getList () {
+      itemIndexQuery({
+        assessItemId: this.itemId
+      }).then(res => {
+        if (res.status == 200) {
+          res.data.map((item, index) => {
+            item.no = index + 1
+          })
+          this.list = res.data
+        } else {
+          this.list = []
+        }
+      })
+    },
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.$emit('close')
+    },
+    // 打开新增/编辑 弹窗
+    openModal (row) {
+      this.itemIndexId = row ? row.id : ''
+      this.openAddModal = true
+    },
+    // 删除考评指标
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        content: '删除后原数据不可恢复,是否删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          itemIndexDelete({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.getList()
+            }
+          })
+        }
+      })
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'SetEvaItemModal'
+    })
+  }
+
+}
+</script>
+
+<style scoped>
+	.header {
+		font-size: 16px;
+		font-weight: 600;
+		margin-bottom: 20px;
+	}
+
+	.header span {
+		margin-right: 20px;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.red {
+		color: red;
+	}
+</style>

+ 260 - 0
src/views/evaluation/evaluationPlan/AddEvaModal.vue

@@ -0,0 +1,260 @@
+<template>
+  <div>
+    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel" :width="600">
+      <a-form :form="form" :model="formData" 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
+                id="addEvaModal-name"
+                :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 }">
+              <!-- <v-select
+                ref="orgType"
+				id="addEvaModal-scopeType"
+                allowClear
+                mode="multiple"
+                @change="scopeTypeChange"
+                v-decorator="[
+                  'formData.scopeType',
+                  { initialValue: formData.scopeType,
+                    rules: [{ required: true, message: '请选择适用模式!' }] },
+                ]"
+                code="STORE_AUTH_TYPE"></v-select> -->
+              <a-select
+                mode="multiple"
+                allowClear
+                id="addEvaModal-scopeType"
+                placeholder="请选择适用模式"
+                @change="scopeTypeChange"
+                v-decorator="[
+                  'formData.scopeType',
+                  { initialValue: formData.scopeType,
+                    rules: [{ required: true, message: '请选择适用模式!' }] },
+                ]">
+                <a-select-option v-for="item in options" :key="item.code" :value="item.code">
+                  {{ item.dispName }}
+                </a-select-option>
+              </a-select>
+            </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
+                id="addEvaModal-desc"
+                :maxLength="500"
+                Input.TextArea
+                :autoSize="{minRows:5}"
+                v-decorator="[
+                  'formData.desc',
+                  { initialValue: formData.desc },
+                ]"
+                placeholder="请输入考评方案说明" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button :loading="loading" id="addEvaModal-submit" type="primary" @click="handleSubmit()">
+            确定
+          </a-button>
+          <a-button id="addEvaModal-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  VSelect
+} from '@/components'
+import {
+  planSave,
+  planDetail
+} from '@/api/evaluationPlan.js'
+export default {
+  name: 'AddEvaModal',
+  components: {
+    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) {
+        this.form.resetFields()
+        // 编辑查详情
+        if (this.itemId) {
+          this.getFormData(this.itemId)
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaModal'
+      }),
+      formData: {
+        name: '', // 方案名称
+        scopeType: [], // 适用类型
+        desc: '' // 方案说明
+      },
+	  loading: false, // 确定按钮loading
+      options: [{
+        code: 'VIDEO_INSPECTION',
+        dispName: '视频巡店',
+        id: 1
+      },
+      {
+        code: 'SPOT_INSPECTION',
+        dispName: '现场巡店',
+        id: 12
+      },
+      {
+        code: 'POINT_INSPECTION',
+        dispName: '点检',
+        id: 13
+      }
+      ]
+    }
+  },
+  computed: {
+    // 弹框标题
+    titleText () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
+  methods: {
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.formData = {
+        name: '', // 方案名称
+        scopeType: [], // 适用类型
+        desc: '' // 方案说明
+      }
+      this.$emit('close')
+    },
+    // 查详情
+    getFormData (id) {
+      planDetail({
+        id: id
+      }).then(res => {
+        if (res.status == 200) {
+          // console.log(res, 'rrrrrrrrrr')
+          this.formData = Object.assign(this.formData, res.data)
+          this.formData.scopeType = this.formData.scopeType.split(',')
+        }
+      })
+    },
+    // 使用模式改变
+    scopeTypeChange (v) {
+      this.formData.scopeType = v
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+          const params = this.itemId ? Object.assign({
+            id: this.itemId
+          }, values.formData) : values.formData
+          params.scopeType = params.scopeType.join(',')
+          // console.log(params, 'ppppppppppppp')
+          planSave(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)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.cancel()
+        }
+      })
+    }
+  },
+  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>

+ 298 - 0
src/views/evaluation/evaluationPlan/EvaluationPlan.vue

@@ -0,0 +1,298 @@
+<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 id="evaluationPlan-name" allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select
+                id="evaluationPlan-status"
+                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 id="evaluationPlan-search" type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="evaluationPlan-reset" type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <a-row class="add-btn" type="flex" justify="space-between">
+      <a-button id="evaluationPlan-add" type="primary" icon="plus" @click="openModal">新建</a-button>
+      <a-col id="evaluationPlan-setDefaultPlan" @click="handleDefaultSet">
+        <a-icon type="setting" class="setting-icon" />
+        <span class="setting">默认方案设置</span>
+      </a-col>
+    </a-row>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon id="evaluationPlan-edit" type="edit" class="actionBtn blue" v-if="record.status == '0'" @click="openModal(record)" />
+        <a-icon id="evaluationPlan-delete" type="delete" class="actionBtn red" v-if="record.status == '0'" @click="delect(record)" />
+        <a-icon id="evaluationPlan-setting" type="setting" class="actionBtn orange" @click="handleSet(record)" />
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <a-switch id="evaluationPlan-enableStatus" checkedChildren="启用" unCheckedChildren="禁用" v-model="row.status" @change="changeFlagHandle(row)" />
+      </template>
+    </s-table>
+    <!-- 新增/编辑 弹窗 -->
+    <add-evaModal :itemId="itemId" :visible="openAddModal" @refresh="$refs.table.refresh()" @close="openAddModal=false"></add-evaModal>
+    <!-- 选择考评项弹窗 -->
+    <set-evaModal :itemId="itemId" :itemName="itemName" :visible="openSetting" @close="openSetting=false"></set-evaModal>
+    <!-- 设置默认方案弹窗 -->
+    <set-evaDefaultModal :itemId="itemId" :defaultPlanList="defaultPlanList" :visible="openDefaultSetting" @refresh="getDefaultPlan" @close="openDefaultSetting=false"></set-evaDefaultModal>
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  planQueryByPage,
+  planEnable,
+  planDefaultQuery,
+  planDelete
+} from '@/api/evaluationPlan.js'
+import addEvaModal from './AddEvaModal.vue'
+import setEvaModal from './SetEvaModal.vue'
+import setEvaDefaultModal from './SetEvaDefaultModal.vue'
+export default {
+  name: 'EvaluationPlanList',
+  components: {
+    STable,
+    VSelect,
+    addEvaModal,
+    setEvaModal,
+    setEvaDefaultModal
+  },
+  data () {
+    return {
+      pageNo: 1,
+      pageSize: 10,
+      openAddModal: false, // 打开新增弹窗
+      openSetting: false, // 打开选择考评项弹窗
+      openDefaultSetting: false, // 打开设置默认方案弹窗
+      itemId: '', // 要编辑的方案id
+      itemName: '', // 方案名称
+      defaultPlanList: [], // 默认方案列表
+      // 查询参数
+      queryParam: {
+        name: '',
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '考评方案名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '考评方案说明',
+        dataIndex: 'desc',
+        width: '120',
+        align: 'center'
+      },
+      {
+        title: '适用模式',
+        width: '120',
+        align: 'center',
+        dataIndex: 'scopeType'
+      },
+      {
+        title: '状态',
+        width: '250',
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return planQueryByPage(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.reset()
+      vm.getDefaultPlan()
+    })
+  },
+  methods: {
+    // 默认方案查询
+    getDefaultPlan () {
+      planDefaultQuery().then(res => {
+        // console.log(res, 'rrrrrrrr')
+        if (res.status == 200) {
+          this.defaultPlanList = res.data
+        } else {
+          this.defaultPlanList = []
+        }
+      })
+    },
+    // 修改状态
+    changeFlagHandle (record) {
+      const _data = {
+        id: record.id,
+        status: record.status ? '1' : '0'
+      }
+      planEnable(_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
+    },
+    // 打开默认方案设置弹窗
+    handleDefaultSet () {
+      this.openDefaultSetting = true
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      // 判断当前方案是否为默认方案
+      const has = this.defaultPlanList.find(item => item.assessId == row.id)
+      if (has) {
+        this.$warning({
+          title: '警告',
+          content: '该考评方案为当前默认考评方案,不能删除,请取消该方案的默认后再进行删除!'
+        })
+      } else {
+        this.$confirm({
+          title: '警告',
+          content: '删除后原数据不可恢复,是否删除?',
+          okText: '确定',
+          cancelText: '取消',
+          onOk () {
+            planDelete({
+              id: row.id
+            }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.$refs.table.refresh()
+              }
+            })
+          }
+        })
+      }
+    },
+    // 打开设置弹框
+    handleSet (row) {
+      this.itemId = row.id
+      this.itemName = row.name
+      this.openSetting = true
+      console.log(this.openSetting)
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style scoped>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.add-btn {
+		margin-bottom: 10px;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.setting-icon {
+		font-size: 20px;
+		margin-right: 5px;
+		color: #1890FF;
+	}
+
+	.setting {
+		font-size: 16px;
+		color: #1890FF;
+		border-bottom: 1px solid #1890FF;
+		cursor: pointer;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.red {
+		color: red;
+	}
+
+	.orange {
+		color: #ffaa00;
+	}
+</style>

+ 237 - 0
src/views/evaluation/evaluationPlan/SetEvaDefaultModal.vue

@@ -0,0 +1,237 @@
+<template>
+  <div>
+    <a-modal class="modalBox" title="默认方案设置" v-model="isshow" @cancle="cancel" :width="600">
+      <a-form :form="form" ref="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <!-- 视频巡店默认方案 -->
+            <a-form-item label="视频巡店默认方案:" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
+              <a-select
+                id="setEvaDefaultModal-videoType"
+                @change="videoTypeChange"
+                v-decorator="[
+                  'formData.videoType',
+                  { initialValue: formData.videoType,
+                    rules: [{ required: true, message: '请选择考评方案(单选)!' }] },
+                ]"
+                placeholder="请选择考评方案(单选)"
+              >
+                <a-select-option v-for="item in planList" :key="item.id" :value="item.id">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <!-- 现场巡店默认方案 -->
+            <a-form-item label="现场巡店默认方案:" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
+              <a-select
+                id="setEvaDefaultModal-spotType"
+                placeholder="请选择考评方案(单选)"
+                @change="spotTypeChange"
+                v-decorator="[
+                  'formData.spotType',
+                  { initialValue: formData.spotType,
+                    rules: [{ required: true, message: '请选择考评方案(单选)!' }] },
+                ]">
+                <a-select-option v-for="item in planList" :key="item.id" :value="item.id">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="22">
+            说明:如果默认方案被删除,系统将自动获取对应类别下最新一条启用的模板作为默认方案模板
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button :loading="loading" id="setEvaDefaultModal-submit" type="primary" @click="handleSubmit()">
+            确定
+          </a-button>
+          <a-button id="setEvaDefaultModal-cancle" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  planQuery,
+  planDefaultSave
+} from '@/api/evaluationPlan.js'
+export default {
+  name: 'AddEvaModal',
+  components: {
+    STable,
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的方案id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 默认方案
+    defaultPlanList: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        this.form.resetFields()
+        // 默认方案回显
+        this.pageInit()
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaModal'
+      }),
+	  // 默认值设为undefined, 解决placeholder不生效问题
+      formData: {
+        videoType: undefined, // 视频巡店默认方案
+        spotType: undefined // 现场巡店默认方案
+      },
+      planList: [], // 考评方案列表
+	  loading: false // 确定按钮loading
+    }
+  },
+  computed: {},
+  mounted () {
+    // 获取方案列表数据
+    this.getPlanList()
+  },
+  methods: {
+    pageInit () {
+      if (this.defaultPlanList.length) {
+        this.formData.videoType = this.defaultPlanList.find(item => item.scopeType == 'VIDEO_INSPECTION').assessId
+        this.formData.spotType = this.defaultPlanList.find(item => item.scopeType == 'SPOT_INSPECTION').assessId
+      }
+    },
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.formData.videoType = undefined
+      this.formData.spotType = undefined
+      this.$emit('close')
+    },
+    // 获取方案列表数据
+    getPlanList () {
+      planQuery().then(res => {
+        if (res.status == 200) {
+          this.planList = res.data
+        } else {
+          this.planList = []
+        }
+      })
+    },
+    // 视频巡店默认方案改变
+    videoTypeChange (v) {
+      this.formData.videoType = v
+    },
+    // 现场巡店默认方案改变
+    spotTypeChange (v) {
+      this.formData.spotType = v
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+          const params = [{
+            assessId: values.formData.videoType,
+            scopeType: 'VIDEO_INSPECTION'
+          },
+          {
+            assessId: values.formData.spotType,
+            scopeType: 'SPOT_INSPECTION'
+          }
+          ]
+          planDefaultSave(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)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.cancel()
+        }
+      })
+    }
+  },
+  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>

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

@@ -0,0 +1,388 @@
+<template>
+  <div>
+    <a-modal class="modalBox" title="选择考评项" v-model="isshow" @cancle="cancel" :width="'80%'">
+      <a-row :gutter="24">
+        <a-col class="title" :span="20">
+          <!-- 考评方案名称 -->
+          <span>考评方案名称: {{ itemName }}</span>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-form :form="form" ref="form" @submit="handleSubmit">
+          <a-card class="card-content">
+            <a-col :span="15">
+              <p>已选考评项目:</p>
+              <!-- 已选考评项列表 -->
+              <a-table
+                ref="table"
+                size="default"
+                :pagination="false"
+                :rowKey="(record) => record.id"
+                :columns="columns"
+                :dataSource="checkedList"
+                bordered>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record, index">
+                  <a-button
+                    id="setEvaModal-moveUp"
+                    type="primary"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveUp(index)"
+                    v-if="index>0"
+                    icon="arrow-up">上移</a-button>
+                  <a-button
+                    id="setEvaModal-moveDown"
+                    type="primary"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveDown(index)"
+                    v-if="index < checkedList.length-1"
+                    icon="arrow-down">下移</a-button>
+                  <a-button
+                    id="setEvaModal-moveTop"
+                    type="danger"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveTop(index)"
+                    v-if="index>0"
+                    icon="up">置顶</a-button>
+                  <a-button
+                    id="setEvaModal-moveBottom"
+                    type="danger"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveBottom(index)"
+                    v-if="index < checkedList.length-1"
+                    icon="down">置底</a-button>
+                </template>
+              </a-table>
+
+            </a-col>
+            <a-col span="1" class="divider">
+            </a-col>
+            <a-col span="8">
+              <a-row>
+                <p>请选择需要的考评项目:</p>
+              </a-row>
+              <s-table
+                ref="tableItem"
+                size="default"
+                :showPagination="false"
+                :row-selection="rowSelection"
+                :rowKey="(record) => record.id"
+                :columns="itemColumns"
+                :data="loadItemData"
+                bordered>
+                <!-- 启用禁用 -->
+                <template slot="enable" slot-scope="text, row">
+                  <span :class="[text==1 ? 'green' : 'grey']">{{ text==1 ? '启用' : '禁用' }}</span>
+                </template>
+              </s-table>
+            </a-col>
+          </a-card>
+          <a-form-item class="footer" :wrapper-col="{ span: 24, offset: 12 }">
+            <a-button :loading="loading" id="setEvaModal-submit" type="primary" @click="handleSubmit()">
+              保存
+            </a-button>
+            <a-button id="setEvaModal-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
+              取消
+            </a-button>
+          </a-form-item>
+        </a-form>
+      </a-row>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  planItemQuery,
+  planItemSave
+} from '@/api/evaluationPlan.js'
+import { getItemList } from '@/api/evaluationItem.js'
+export default {
+  name: 'AddEvaModal',
+  components: {
+    STable,
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的方案id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 要编辑的方案名字
+    itemName: {
+	  type: String,
+	  default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        // 获取已选列表数据
+        this.getCheckedList()
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'SetEvaModal'
+      }),
+	  loading: false, // 确定按钮loading
+      // 已选考评项数据
+      checkedList: [], // 已选考评项列表
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '考评项目名称',
+        dataIndex: 'assessItemName',
+        align: 'center'
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 考评项列表数据
+      itemColumns: [{
+        title: '考评项目名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '状态',
+        width: '200',
+        dataIndex: 'status',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadItemData: parameter => {
+        return getItemList().then(res => {
+          if (res.status == 200) {
+            //       res.data.map((item, index) => {
+			   // res.data.no = index + 1
+            //       })
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  computed: {
+    // 已选择的复选框
+    selectedRowKeys () {
+      const arr = []
+      this.checkedList.map(item => {
+        arr.push(item.assessItemId)
+      })
+      return arr
+    },
+    // 列表项是否可选择的配置
+    rowSelection () {
+      return {
+        columnTitle: '选择', // 选择框标题
+        columnWidth: 80, // 选择框宽度
+        selectedRowKeys: this.selectedRowKeys, // 指定选中项的 key 数组
+        // 选中项发生变化时的回调 selectedRowKeys:指定选中项的 key 数组 selectedRows:已选中的数组数据
+        onChange: (selectedRowKeys, selectedRows) => {
+          const arr = []
+          let index = 0
+  		  // 根据选择项的顺序展示已选列表
+          selectedRowKeys.map(item => {
+            index++
+            const p = selectedRows.find(row => row.id == item)
+            const row = {}
+            if (p) {
+              row.no = index
+			  row.assessItemId = p.id
+			  row.assessItemName = p.name
+			  row.assessSchemeId = this.itemId
+              arr.push(row)
+            }
+          })
+          this.checkedList = arr
+          // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+        },
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.status == '0' // 禁用状态不可选
+          }
+        })
+      }
+    }
+  },
+  methods: {
+    // 获取已选列表数据
+    getCheckedList () {
+      planItemQuery({ assessSchemeId: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.checkedList = res.data
+          this.checkedList.map((item, index) => {
+            item.no = index + 1
+          })
+        } else {
+          this.checkedList = []
+          this.$message.warning(res.message)
+        }
+      })
+    },
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+    // 上移
+    moveUp (index) {
+      this.moveArr(index, index - 1)
+    },
+    // 下移
+    moveDown (index) {
+      this.moveArr(index, index + 1)
+    },
+    // 置顶
+    moveTop (index) {
+      this.goToArr(index, 1)
+    },
+    // 置底
+    moveBottom (index) {
+      this.goToArr(index, 0)
+    },
+    // 置顶和置底
+    goToArr (index, type) {
+      const arr = this.checkedList
+      const row = arr[index]
+      arr.splice(index, 1)
+      if (type) {
+        arr.unshift(row)
+      } else {
+        arr.push(row)
+      }
+      arr.map((item, index) => {
+        item.no = index + 1
+      })
+    },
+    // 移动
+    moveArr (index1, index2) {
+      const arr = this.checkedList
+      arr[index1] = arr.splice(index2, 1, arr[index1])[0]
+      arr.map((item, index) => {
+        item.no = index + 1
+      })
+      this.checkedList = arr
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          if (!this.checkedList.length) {
+            return this.$message.warning('请先选择考评项目')
+          }
+		  this.loading = true
+          planItemSave(this.checkedList).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)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.clear()
+          _this.cancel()
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+    }
+
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'SetEvaModal'
+    })
+  }
+
+}
+</script>
+
+<style scoped>
+	.title {
+		font-size: 16px;
+		color: black;
+		padding-bottom: 30px;
+	}
+	.card-content {
+		max-height: 650px;
+		overflow-y: scroll;
+	}
+	.actionBtn {
+		font-size: 12px;
+		margin: 0 5px;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.grey {
+		color: rgb(153, 153, 153);
+	}
+
+	.footer {
+		margin-top: 20px;
+	}
+</style>