From c64c8f43ec1a3d88feb1f915fd488040b6358e7d Mon Sep 17 00:00:00 2001
From: shj <1790240199@qq.com>
Date: 星期二, 09 八月 2022 19:04:12 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/gtqtOut

---
 src/views/goalManagement/IncentiveRecording/component/DailogSearch.vue |  175 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 115 insertions(+), 60 deletions(-)

diff --git a/src/views/goalManagement/IncentiveRecording/component/DailogSearch.vue b/src/views/goalManagement/IncentiveRecording/component/DailogSearch.vue
index 89ce0d3..aabfa03 100644
--- a/src/views/goalManagement/IncentiveRecording/component/DailogSearch.vue
+++ b/src/views/goalManagement/IncentiveRecording/component/DailogSearch.vue
@@ -6,8 +6,8 @@
 				<el-form ref="ruleFormRef" :model="ruleForm" status-icon>
 					<el-row>
 						<el-col :span="12">
-							<el-form-item>
-								<el-input v-model="ruleForm.pass" placeholder="奖惩名称" />
+							<el-form-item size="default">
+								<el-input v-model="ruleForm.searchParams.standardType" placeholder="奖惩类型" />
 							</el-form-item>
 						</el-col>
 						<!-- <el-col :span="6" :offset="1">
@@ -17,103 +17,149 @@
 				</el-col> -->
 						<el-col :span="11" :offset="1">
 							<el-form-item>
-								<el-button type="primary" @click="submitForm(ruleFormRef)">查询</el-button>
-								<el-button @click="resetForm(ruleFormRef)">重置</el-button>
+								<el-button size="default" type="primary" @click="listApi">查询</el-button>
+								<el-button size="default" @click="resetForm">重置</el-button>
 							</el-form-item>
 						</el-col>
 					</el-row>
 				</el-form>
-				<el-button size="default" :icon="Delete">清除选择</el-button>
+				<el-button size="default" :icon="Delete" @click="clear">清除选择</el-button>
 				<el-table :data="tableData" style="width: 100%; margin-top: 20px">
-					<el-table-column align="center" type="selection" />
-					<el-table-column align="center" prop="date" label="奖惩名称" width="180" />
-					<el-table-column align="center" prop="name" label="奖惩类型" width="180" />
-					<el-table-column align="center" prop="address" label="奖惩内容" />
+					<el-table-column align="center">
+						<template #default="scope">
+							<el-radio-group v-model="radio1">
+								<el-radio :label="scope.row.id" @click="radio(scope.row)" size="large">{{ null }}</el-radio>
+							</el-radio-group>
+						</template>
+					</el-table-column>
+					<el-table-column align="center" prop="qname" label="奖惩名称" width="180" />
+					<el-table-column align="center" label="奖惩类型" width="180">
+						<template #default="scope">
+							<span v-if="scope.row.standardType == 1">奖励</span>
+							<span v-if="scope.row.standardType == 2">惩罚</span>
+							<span></span>
+						</template>
+					</el-table-column>
+					<el-table-column align="center" prop="content" label="奖惩内容" />
 				</el-table>
 				<el-pagination
 					style="padding: 20px 0; border-bottom: 1px solid #dedede"
 					v-model:currentPage="currentPage4"
 					v-model:page-size="pageSize4"
-					:page-sizes="[100, 200, 300, 400]"
-					:small="small"
-					:disabled="disabled"
-					:background="background"
+					:page-sizes="[10, 20, 30, 40]"
 					layout="total, sizes, prev, pager, next, jumper"
-					:total="400"
+					:total="total"
 					@size-change="handleSizeChange"
 					@current-change="handleCurrentChange"
 				/>
 			</el-col>
 			<el-col :span="7">
-				<el-tag
-					v-for="tag in dynamicTags"
-					:key="tag"
-					class="mx-1"
-					style="margin: 5px"
-					closable
-					:disable-transitions="false"
-					@close="handleClose(tag)"
-				>
-					{{ tag }}
-				</el-tag>
+				<div v-if="dynamicTags[0] == '' ? false : true">
+					<el-tag
+						v-for="tag in dynamicTags"
+						:key="tag"
+						class="mx-1"
+						style="margin: 5px"
+						closable
+						:disable-transitions="false"
+						@close="handleClose(tag)"
+					>
+						{{ tag.qname }}
+					</el-tag>
+				</div>
 			</el-col>
 		</el-row>
 		<template #footer>
 			<span class="dialog-footer">
 				<el-button @click="dialogVisible = false" size="default">关闭</el-button>
-				<el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button>
+				<el-button type="primary" @click="submitForm" size="default">确定</el-button>
 			</span>
 		</template>
 	</el-dialog>
 </template>
 <script lang="ts">
-import { defineComponent, reactive, ref } from 'vue';
+import { defineComponent, reactive, ref, onMounted } from 'vue';
 import { Delete, FullScreen } from '@element-plus/icons-vue';
+import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus';
+import { goalManagementApi } from '/@/api/goalManagement';
 export default defineComponent({
-	setup() {
-		const dialogVisible = ref<boolean>(false);
-		const openDailog = () => {
-			dialogVisible.value = true;
-		};
+	setup(props, { emit }) {
 		// 搜索条件
 		const ruleForm = reactive({
-			pass: '',
-			checkPass: '',
+			pageSize: 10,
+			pageIndex: 1,
+			searchParams: {
+				standardType: '', ////奖惩类型 1:奖励 2:惩罚
+			},
 		});
+		// 重置
+		const resetForm = () => {
+			ruleForm.searchParams.standardType = '';
+			listApi();
+		};
+		const listApi = () => {
+			goalManagementApi()
+				.getrewardPunishmentStandardList(ruleForm)
+				.then((res) => {
+					if (res.data.code == 200) {
+						tableData.value = res.data.data;
+						currentPage4.value = res.data.pageIndex;
+						pageSize4.value = res.data.pageSize;
+						total.value = res.data.total;
+					} else {
+						ElMessage.error(res.data.msg);
+					}
+				});
+		};
+		//
+		const handleClick = (val: any) => {
+			let targetType = JSON.parse(JSON.stringify(val));
+			ruleForm.searchParams.standardType = targetType.paneName;
+			listApi();
+		};
+		onMounted(() => {});
+		// const onAddorUpdata = () => {
+		// 	listApi();
+		// };
 		// 表格
-		const tableData = [
-			{
-				date: '2016-05-03',
-				name: 'Tom',
-				address: 'No. 189, Grove St, Los Angeles',
-			},
-			{
-				date: '2016-05-02',
-				name: 'Tom',
-				address: 'No. 189, Grove St, Los Angeles',
-			},
-			{
-				date: '2016-05-04',
-				name: 'Tom',
-				address: 'No. 189, Grove St, Los Angeles',
-			},
-			{
-				date: '2016-05-01',
-				name: 'Tom',
-				address: 'No. 189, Grove St, Los Angeles',
-			},
-		];
-		const pageSize4 = ref(100);
+		const tableData = ref();
+		const currentPage4 = ref();
+		const pageSize4 = ref();
+		const total = ref();
 		const handleSizeChange = (val: number) => {
-			console.log(`${val} items per page`);
+			// console.log(`${val} items per page`);
+			ruleForm.pageSize = val;
+			listApi();
 		};
 		const handleCurrentChange = (val: number) => {
-			console.log(`current page: ${val}`);
+			// console.log(`current page: ${val}`);
+			ruleForm.pageIndex = val;
+			listApi();
+		};
+		// 打开弹窗
+		const dialogVisible = ref(false);
+		const openDailog = () => {
+			dialogVisible.value = true;
+			listApi();
 		};
 		// 右方点击添加后显示标签
-		const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']);
+		const dynamicTags = ref(['']);
 		const handleClose = (tag: string) => {
 			dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
+			radio1.value = '';
+		};
+		const radio1 = ref('');
+		const radio = (event: any) => {
+			dynamicTags.value[0] = event;
+		};
+		const clear = () => {
+			dynamicTags.value = [''];
+			radio1.value = '';
+		};
+		const submitForm = () => {
+			let obj = JSON.parse(JSON.stringify(dynamicTags.value));
+			emit('backNum', obj[0]);
+			dialogVisible.value = false;
 		};
 		//全屏
 		const full = ref(false);
@@ -125,14 +171,23 @@
 			}
 		};
 		return {
+			submitForm,
+			radio,
+			radio1,
+			clear,
 			dialogVisible,
 			openDailog,
 			ruleForm,
+			resetForm,
 			tableData,
+			currentPage4,
 			pageSize4,
+			total,
 			handleSizeChange,
 			handleCurrentChange,
 			dynamicTags,
+			listApi,
+			handleClick,
 			handleClose,
 			Delete,
 			full,

--
Gitblit v1.9.2