From 09da100729793848bc01b51f7b05ca3f1e7ec64f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 20 六月 2024 14:05:35 +0800
Subject: [PATCH] 提交一把
---
company/src/views/business/solutions.vue | 141 ++++++++++++++++++++++++++++++++--------------
1 files changed, 97 insertions(+), 44 deletions(-)
diff --git a/company/src/views/business/solutions.vue b/company/src/views/business/solutions.vue
index 3b1c2b0..7fe6a82 100644
--- a/company/src/views/business/solutions.vue
+++ b/company/src/views/business/solutions.vue
@@ -5,10 +5,16 @@
<el-form-item label="淇濋櫓鏂规" prop="name">
<el-input v-model="searchForm.name" placeholder="璇疯緭鍏�" @keypress.enter.native="search"></el-input>
</el-form-item>
- <el-form-item label="鍚敤鐘舵��" prop="status">
+ <el-form-item label="鍚敤鐘舵��" prop="status" v-if="userInfo.type !== 1">
<el-select v-model="searchForm.status" placeholder="璇烽�夋嫨" @keypress.enter.native="search">
<el-option label="鍚敤" value="0"></el-option>
<el-option label="绂佺敤" value="1"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="绫诲瀷" prop="type" >
+ <el-select v-model="searchForm.type" placeholder="璇烽�夋嫨" @keypress.enter.native="search">
+ <el-option label="鐩翠繚" value="0"></el-option>
+ <el-option label="濮旀墭鎶曚繚" value="1"></el-option>
</el-select>
</el-form-item>
<section>
@@ -19,30 +25,56 @@
<!-- 琛ㄦ牸鍜屽垎椤� -->
<template v-slot:table-wrap>
<ul class="toolbar" v-permissions="['business:solutions:create']">
- <li><el-button type="primary" @click="$refs.operaSolutionsWindow.open('鏂板缓淇濋櫓鏂规')" icon="el-icon-plus" v-permissions="['business:solutions:create']">鏂板缓</el-button></li>
+ <template v-if="userInfo.type !== 1">
+ <li><el-button type="primary" @click="$refs.operaSolutionsWindow.open('鏂板缓淇濋櫓鏂规')" v-permissions="['business:solutions:create']">娣诲姞鏂规</el-button></li>
+ </template>
</ul>
<el-table
v-loading="isWorking.search"
:data="tableData.list"
stripe
>
- <el-table-column prop="name" label="淇濋櫓鏂规" min-width="100px"></el-table-column>
- <el-table-column prop="insuranceId" label="淇濋櫓鍏徃" min-width="100px"></el-table-column>
- <el-table-column prop="insuranceId" label="鎶曚繚骞撮緞" min-width="100px"></el-table-column>
+ <el-table-column label="搴忓彿" width="50px">
+ <template slot-scope="scope">
+ <span>{{scope.$index + 1}}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="name" label="淇濋櫓鏂规" min-width="150px"></el-table-column>
+ <el-table-column prop="insuranceName" label="淇濋櫓鍏徃" min-width="100px"></el-table-column>
+ <el-table-column label="鎶曚繚骞撮緞" min-width="100px">
+ <template slot-scope="{row}">
+ <span>{{row.minAge}}鑷硔{row.maxAge}}宀�</span>
+ </template>
+ </el-table-column>
<el-table-column label="鎶曚繚鐢熸晥鏃ユ湡" min-width="100px">
<template slot-scope="{row}">
- <span v-if="row.validType === 0">鏃ュ悗鐢熸晥</span>
+ <span v-if="row.validType === 0">{{row.validTypeNum}}鏃ュ悗鐢熸晥</span>
<span v-if="row.validType === 1">娆℃湀鐢熸晥</span>
</template>
</el-table-column>
- <el-table-column label="淇濋櫓璐圭敤" min-width="100px">
+<!-- <el-table-column prop="addValidDays" label="鎵瑰鐢熸晥鏃堕棿" min-width="100px"> </el-table-column>
+ <el-table-column prop="delValidDays" label="鎵瑰噺鐢熸晥鏃堕棿" min-width="100px"> </el-table-column>-->
+ <el-table-column label="鏂规璐圭敤" min-width="100px">
<template slot-scope="{row}">
- <span>{{row.price}}鍏�/浜�/鏈�</span>
+ <span>{{row.price}}鍏�/浜�/</span>
+ <span v-if="row.timeUnit === 0">澶�</span>
+<!-- <span v-if="row.timeUnit === 1">鍗婃湀</span>-->
+ <span v-if="row.timeUnit === 2">鏈�</span>
+ <span v-if="row.timeUnit === 3">瀛e害</span>
+ <span v-if="row.timeUnit === 4">鍗婂勾</span>
+ <span v-if="row.timeUnit === 5">骞�</span>
</template>
</el-table-column>
- <el-table-column prop="status" label="鍚敤鐘舵��" min-width="100px">
+ <el-table-column label="鎶曚繚绫诲瀷" min-width="120px" align="center">
+ <template slot-scope="{row}">
+ <span v-if="row.type === 0">鐩翠繚</span>
+ <span v-if="row.type === 1">濮旀墭<div style="color: blue;display: block" >{{row.shopName||'-'}}</div></span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="status" label="鍚敤鐘舵��" min-width="100px" v-if="userInfo.type !== 1">
<template slot-scope="{row}">
<el-switch
+ @change="changeStatus($event, row)"
v-model="row.status"
active-color="#13ce66"
inactive-color="#ff4949"
@@ -51,19 +83,18 @@
</el-switch>
</template>
</el-table-column>
-
- <el-table-column prop="minAge" label="鏈�浣庡勾榫�" min-width="100px"></el-table-column>
- <el-table-column prop="maxAge" label="鏈�楂樺勾榫�" min-width="100px"></el-table-column>
-
+ <el-table-column prop="createDate" label="鏂规鏃ユ湡" min-width="100px"></el-table-column>
<el-table-column
v-if="containPermissions(['business:solutions:update', 'business:solutions:delete'])"
label="鎿嶄綔"
- min-width="120"
+ min-width="150"
fixed="right"
>
<template slot-scope="{row}">
- <el-button type="text" @click="$refs.operaSolutionsWindow.open('鏂规璇︽儏', row)" icon="el-icon-edit" v-permissions="['business:solutions:update']">鏌ョ湅璇︽儏</el-button>
- <el-button type="text" @click="$refs.operaSolutionsWindow.open('缂栬緫淇濋櫓鏂规', row)" icon="el-icon-edit" v-permissions="['business:solutions:update']">淇敼</el-button>
+ <el-button type="text" @click="$refs.OperaSolutionsDescWindow.open('鏂规璇︽儏', { id: row.id })" icon="el-icon-edit" v-permissions="['business:solutions:update']">鏌ョ湅璇︽儏</el-button>
+ <template v-if="userInfo.type !== 1">
+ <el-button type="text" @click="$refs.operaSolutionsWindow.open('缂栬緫淇濋櫓鏂规', { id: row.id })" icon="el-icon-edit" v-permissions="['business:solutions:update']">淇敼</el-button>
+ </template>
</template>
</el-table-column>
</el-table>
@@ -80,34 +111,56 @@
<OperaSolutionsDescWindow ref="OperaSolutionsDescWindow" @success="handlePageChange"/>
</TableLayout>
</template>
-
<script>
- import BaseTable from '@/components/base/BaseTable'
- import TableLayout from '@/layouts/TableLayout'
- import Pagination from '@/components/common/Pagination'
- import OperaSolutionsWindow from '@/components/business/OperaSolutionsWindow'
- import OperaSolutionsDescWindow from '@/components/business/OperaSolutionsDescWindow'
- export default {
- name: 'Solutions',
- extends: BaseTable,
- components: { TableLayout, Pagination, OperaSolutionsWindow, OperaSolutionsDescWindow },
- data () {
- return {
- // 鎼滅储
- searchForm: {
- name: '',
- status: ''
- }
- }
- },
- created () {
- this.config({
- module: '淇濋櫓鏂规淇℃伅琛�',
- api: '/business/solutions',
- 'field.id': 'id',
- 'field.main': 'id'
- })
- this.search()
- }
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import OperaSolutionsWindow from '@/components/business/OperaSolutionsWindow'
+import OperaSolutionsDescWindow from '@/components/business/OperaSolutionsDescWindow'
+import { updateStatus } from '@/api/business/solutions'
+import { mapState } from 'vuex'
+export default {
+ name: 'Solutions',
+ extends: BaseTable,
+ components: { TableLayout, Pagination, OperaSolutionsWindow, OperaSolutionsDescWindow },
+ data () {
+ return {
+ // 鎼滅储
+ searchForm: {
+ name: '',
+ status: '',
+ type: ''
+ }
}
+ },
+ computed: {
+ ...mapState(['userInfo'])
+ },
+ created () {
+ this.config({
+ module: '淇濋櫓鏂规淇℃伅琛�',
+ api: '/business/solutions',
+ 'field.id': 'id',
+ 'field.main': 'id'
+ })
+ if (this.userInfo.type === 1) {
+ this.searchForm.status = '0'
+ } else {
+ this.searchForm.status = ''
+ }
+ this.search()
+ },
+ methods: {
+ // 淇敼鐘舵��
+ changeStatus (status, row) {
+ updateStatus({ id: row.id, status })
+ .then(res => {
+ this.search()
+ })
+ .catch(err => {
+ row.status = row.status === 0 ? 1 : 0
+ })
+ }
+ }
+}
</script>
--
Gitblit v1.9.3