zhaojiale
2022-08-09 ba0f0245d0f2824034319fcc1e960a75cfd8ca87
src/views/goalManagement/IncentiveRecording/index.vue
@@ -38,11 +38,11 @@
         </div>
         <el-table ref="multipleTableRef" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
            <el-table-column type="selection" align="center" width="55" />
            <el-table-column property="createTime" align="center" label="奖惩日期" sortable />
            <el-table-column property="createTime" align="center" label="奖惩日期" :formatter="timeDate" sortable />
            <el-table-column label="奖惩类型" align="center" sortable>
               <template #default="scope">
               <span v-if="scope.row.standardType==1">奖励</span>
               <span v-if="scope.row.standardType==2">惩罚</span>
                  <span v-if="scope.row.standardType == 1">奖励</span>
                  <span v-if="scope.row.standardType == 2">惩罚</span>
               </template>
            </el-table-column>
            <el-table-column property="personId" align="center" label="被奖惩者" sortable />
@@ -68,12 +68,13 @@
            />
         </div>
         <DailogAdd ref="openAdd" @navAddorUpdata="onAddorUpdata"></DailogAdd>
         <DailogSearchUser ref="openUser"></DailogSearchUser>
         <DailogSearchUser ref="openUser" @SearchUser="userId"></DailogSearchUser>
      </div>
   </div>
</template>
<script lang="ts">
import DailogAdd from './component/DailogAdd.vue';
import {timeDate} from '/@/assets/index.ts'
import DailogSearchUser from '/@/components/DailogSearchUser/index.vue';
import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue';
import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus';
@@ -87,7 +88,7 @@
         pageSize: 10,
         pageIndex: 1,
         searchParams: {
            personId: '1', ////员工
            personId: '', ////员工
         },
      });
      // 重置
@@ -143,6 +144,8 @@
      };
      // 删除
      const onDelete = (id: number) => {
         let arr=[]
         arr.push(id)
         ElMessageBox.confirm('确定删除所选项吗?', 'Warning', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
@@ -150,7 +153,7 @@
         })
            .then(() => {
               goalManagementApi()
                  .getrewardPunishmentDelete(id)
                  .getrewardPunishmentDelete(arr)
                  .then((res) => {
                     if (res.data.code == 200) {
                        ElMessage({
@@ -180,7 +183,7 @@
         for (let i = 0; i < valId.length; i++) {
            arr.push(valId[i].id);
         }
         deletAll.value = arr.toString();
         deletAll.value = arr
         if (val.length == 1) {
            warning.value = false;
            danger.value = false;
@@ -220,12 +223,17 @@
               // });
            });
      };
      const openUser=ref()
      const openSearch=()=>{
         openUser.value.openDailog()
      }
      const openUser = ref();
      const openSearch = () => {
         openUser.value.openDailog();
      };
      const userId = (val: any) => {
         ruleForm.searchParams.personId = val.uid;
      };
      return {
         timeDate,
         ruleForm,
         userId,
         resetForm,
         listApi,
         handleClick,