Ver código fonte

单项权益增加标签按钮

xz
zhoujie 10 meses atrás
pai
commit
a203c09ac4

+ 1
- 0
src/crud/components/UD.operation.vue Ver arquivo

@@ -18,6 +18,7 @@
@click="handleAudit(scope.$index, scope.row)">
<span style="font-family: `楷体`">审核</span>
</el-button>

<el-popover v-if="isDelete && !scope.row.noDelete" :key="scope.$index" trigger="click" :visible="scope.row.visible"
placement="top" :width="160">
<div>

+ 122
- 0
src/views/onlineBusinessHall/productManagement/equityProduct/components/labelsDialog.vue Ver arquivo

@@ -0,0 +1,122 @@
<template>
<el-dialog v-model="isShow" width="40%" title="标签管理">
<div class="content">
<el-button
type="success"
icon="Plus"
@click="addBtn"
style="margin-bottom: 10px"
>
添加
</el-button>
<el-table :data="labelsList" :border="true">
<el-table-column label="名称">
<template #header>名称</template>
<template v-slot="scope">
<div class="tab-con">
<el-input
maxlength="60"
v-trim
clearable
v-model="scope.row"
placeholder="请输入内容"
@input="
handleBeforeInput(scope.$index, scope.row)
"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="120">
<template v-slot="scope">
<el-button
class="op-btn"
type="danger"
@click="deleteHandle(scope.row, scope.$index)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="isShow = false">取消</el-button>
<el-button type="primary" @click="submit">
确定
</el-button>
</div>
</template>
</el-dialog>
</template>

<script setup lang="ts">
import { msgConfirm, typeTy } from '@/utils/msg'
import { computed } from 'vue'
import BaseService from '@/utils/baseService' //引入接口请求
import { ElMessage } from 'element-plus'

const props = defineProps({
modelValue: {
type: Boolean,
default: false,
},
labelsList: {
type: Array,
default: () => [],
},
currentLabel: {
type: Object,
default: () => ({}),
},
})
const emit = defineEmits(['update:modelValue', 'getLabelsList'])
const isShow = computed({
get: function () {
return props.modelValue
},
set: function (newValue) {
emit('update:modelValue', newValue)
},
})
const addBtn = () => {
console.log('添加')
props.labelsList.push('')
}
const deleteHandle = (row, index) => {
props.labelsList.splice(index, 1)

// msgConfirm(`确认是否 删除 ${row}?`, typeTy.warning).then(() => {
// submit(arr, '删除')
// })
}
const handleBeforeInput = (index, row) => {
console.log(index, row)
props.labelsList[index] = row
}
const submit = () => {
console.log('提交')
BaseService.postN('/managew/api/equity/single/changeLabel', {
id: props.currentLabel.id,
labels:props.labelsList,
}).then((res: any) => {
if (res && res.code === 0) {
ElMessage.success(`处理成功`)
isShow.value = false
} else {
ElMessage.error(res.message)
}
})
}
</script>
<style scoped lang="scss">
.content-mes {
border: 1px solid #ccc;
border-radius: 5px;
padding: 10px;
}
.dialog-footer{
padding-top: 30px
}
</style>

+ 66
- 18
src/views/onlineBusinessHall/productManagement/equityProduct/index.vue Ver arquivo

@@ -60,7 +60,10 @@
@updateModelValue="handleDescriptionData"
/> -->

<equityDescription v-model="crudRef.form['productIntro']" v-if="equityDescriptionShow"/>
<equityDescription
v-model="crudRef.form['productIntro']"
v-if="equityDescriptionShow"
/>
</template>
<template #descriptionInfo>
<!-- <equityDescription
@@ -71,6 +74,15 @@
查看简介
</el-button>
</template>
<template #operation="{ scope }">
<el-button
type="primary"
size="small"
@click.stop="handleLabels(scope.row)"
>
标签
</el-button>
</template>
</crud-template>
<!-- 审核接口 -->
<el-dialog v-model="check" width="30%" title="审核">
@@ -93,9 +105,20 @@
<el-radio label="1">审核不通过</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核原因" prop="examineDes" v-if="autdis.examine == '1'">
<el-input v-trim clearable type="textarea" v-model="autdis.examineDes" :placeholder="`审核不通过原因`"
maxlength="200" show-word-limit></el-input>
<el-form-item
label="审核原因"
prop="examineDes"
v-if="autdis.examine == '1'"
>
<el-input
v-trim
clearable
type="textarea"
v-model="autdis.examineDes"
:placeholder="`审核不通过原因`"
maxlength="200"
show-word-limit
></el-input>
</el-form-item>
</el-form>
<template #footer>
@@ -106,31 +129,34 @@
</template>
</el-dialog>
<descriptionInfoDialog v-model="isdescriptionInfoShow" :crudRef="crudRef" />
<labelsDialog v-model="isLabelsShow" :labelsList="labelsList" :currentLabel='currentLabel'
@getLabelsList="getLabels"
/>
</div>
</template>
<!-- 单项权益管理 -->
<script setup lang="ts">
import { ref, toRaw, onMounted, computed, onBeforeMount, onActivated,nextTick } from 'vue'
import {
ref,
toRaw,
onMounted,
computed,
onBeforeMount,
onActivated,
nextTick,
} from 'vue'
// @ts-ignore crudFrom模板
import CrudTemplate from '@/crud/index.vue'
import $storeinitData from '@/store/initData' //引入tab vuex
import BaseService from '@/utils/baseService' //引入接口请求
import { ElMessage } from 'element-plus' //提示
import {
singleInterestList,
singleInterestEdit,
singleInterestAdd,
interestedPartyList,
singleInterestDel,
singleInterestAudit,
singleInterestStart,
deductionChannel,
} from '@/api/onlineBusinessHall/productManagement'

import { useRoute } from 'vue-router'
import { IsPermission } from '@/router/routerUtil'
import moment from 'moment'
import descriptionInfoDialog from './components/descriptionInfoDialog.vue'
import equityDescription from './components/equityDescription.vue'
import labelsDialog from './components/labelsDialog.vue'
import { msgConfirm, typeTy } from '@/utils/msg'
//或取路由传入过来的对象数据
const route = useRoute()
@@ -180,13 +206,12 @@ const searchForm = ref({
let tableData: any = ref([])
const typeOption = ref('')
onActivated(() => {
console.log('onActivated内层');
console.log('onActivated内层')
getAgenCy()
getEquity()
equityDescriptionShow.value = false
nextTick(() => {
equityDescriptionShow.value = true

})
})
onMounted(() => {
@@ -201,6 +226,29 @@ function handleEdit(idx: any, row: any) {
function handleInfo(value, row) {
customSelectorSelection(row.validityFormat, validityFormat, {})
}
function handleLabels(item) {
console.log(item, 'label数据')
isLabelsShow.value = true
currentLabel.value = item

getLabels()
}
const labelsList = ref([])
const isLabelsShow = ref(false)
const currentLabel = ref({})
function getLabels() {
BaseService.post('/managew/api/equity/single/getLabel', {
id: currentLabel.value.id,
}).then((res: any) => {
if (res && res.statusCode === 0) {
let data = res.data.labels || []
console.log(data, 'label数据')
labelsList.value = data
} else {
ElMessage.error(res.message)
}
})
}
const equityDescriptionShow = ref(true) //修改
// 新增
function add() {
@@ -515,7 +563,7 @@ function getList() {
//数据转换
let bizContent = res.data
let data = bizContent.data || []
console.log(data,'数据');
console.log(data, '数据')
data.forEach((item) => {
if (item.cardType) {
item.cardType = item.cardType.map((i) => i.toString())

Carregando…
Cancelar
Salvar