|
@@ -2,69 +2,53 @@
|
|
|
<div>
|
|
|
<div class="box">
|
|
|
<el-tabs v-model="active">
|
|
|
- <el-tab-pane :disabled="loading" label="待领取" name="unclaimed"></el-tab-pane>
|
|
|
- <el-tab-pane :disabled="loading" label="已领取" name="received"></el-tab-pane>
|
|
|
+ <el-tab-pane :disabled="loading" label="正在抢单" name="waiting"></el-tab-pane>
|
|
|
+ <!-- <el-tab-pane :disabled="loading" label="抢单结束" name="catch"></el-tab-pane> -->
|
|
|
+ <el-tab-pane :disabled="loading" label="我抢到的" name="myTask"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <div v-show="active === 'unclaimed'">
|
|
|
- <el-table :data="list" style="width: 100%" v-loading="loading" @row-click="openDetail">
|
|
|
- <el-table-column label="任务内容" prop="task_name">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span class="font-flex-word" style="max-width: 200px;">{{scope.row.task_name}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="积分" prop="base_point">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.base_point > 0" class="red">+{{scope.row.base_point}} {{$getTypsName(scope.row.pt_id)}}</span>
|
|
|
- <span v-else class="green">{{scope.row.base_point}} {{$getTypsName(scope.row.pt_id)}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="截止时间" prop="expire_time"></el-table-column>
|
|
|
- <el-table-column label="操作" prop="owner_id">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-link type="primary" :underline="false">查看</el-link>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <template slot="empty">
|
|
|
- <noData></noData>
|
|
|
- </template>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
|
|
|
- <div v-show="active === 'received'">
|
|
|
- <el-table :data="list" style="width: 100%" v-loading="loading" @row-click="openDetail">
|
|
|
- <el-table-column label="执行人" prop="receiver_id">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="display:flex">
|
|
|
- <userImage
|
|
|
- class="fl"
|
|
|
- :id="scope.row.receiver_id"
|
|
|
- :user_name="scope.row.receiver_name"
|
|
|
- :img_url="scope.row.receiver_img_url"
|
|
|
- width="50px"
|
|
|
- height="50px"
|
|
|
- ></userImage>
|
|
|
- <span style="line-height: 50px; padding-left: 10px;">{{ scope.row.receiver_name }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="任务内容" prop="task_name">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span class="font-flex-word" style="max-width: 200px;">{{scope.row.task_name}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="积分" prop="base_point">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.base_point > 0" class="red">+{{scope.row.base_point}} {{$getTypsName(scope.row.pt_id)}}</span>
|
|
|
- <span v-else class="green">{{scope.row.base_point}} {{$getTypsName(scope.row.pt_id)}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="截止时间" prop="expire_time"></el-table-column>
|
|
|
- <template slot="empty">
|
|
|
- <noData></noData>
|
|
|
+ <el-table :data="list" v-loading="loading" class="cursor" @row-click="openDetail">
|
|
|
+
|
|
|
+ <el-table-column label="任务内容" prop="task_name">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span class="font-flex-word" style="max-width: 200px;">{{scope.row.task_name}}</span>
|
|
|
</template>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
-
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="积分" v-if="active=='myTask'">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span class="red" v-if="scope.row.point_config.base_point > 0">
|
|
|
+ +{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
|
|
|
+ </span>
|
|
|
+ <span class="green" v-else>
|
|
|
+ {{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="积分" v-else>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.base_point > 0" class="red">+{{scope.row.base_point}} {{$getTypsName(scope.row.pt_id)}}</span>
|
|
|
+ <span v-else class="green">{{scope.row.base_point}} {{$getTypsName(scope.row.pt_id)}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="截止时间" prop="expire_time"></el-table-column>
|
|
|
+ <el-table-column label="操作" prop="owner_id" v-if="active=='waiting'">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link :underline="false">查看</el-link>
|
|
|
+ <el-link type="primary" style="padding-left: 10px;" :underline="false" v-if="!userInfo.is_creator&&scope.row.owner_id!=userInfo.id&&scope.row.reviewer_id!=userInfo.id">抢任务</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" prop="owner_id" v-if="active=='myTask'">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="primary" v-if="scope.row.status==1" :underline="false" @click.stop="completeBtn(scope.row)">完成任务</el-link>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <template slot="empty">
|
|
|
+ <noData></noData>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+
|
|
|
<center style="padding: 20px 0;">
|
|
|
<el-pagination
|
|
|
background
|
|
@@ -77,151 +61,73 @@
|
|
|
:total="total"
|
|
|
></el-pagination>
|
|
|
</center>
|
|
|
-
|
|
|
- <el-drawer :custom-class="'drawer_details'" :visible.sync="detailShow" :with-header="false" size="500px">
|
|
|
- <div class="details_title flex-box-ce">
|
|
|
- <span class="flex-1">任务详情</span>
|
|
|
- <i @click="detailShow=false" style="cursor: pointer;" class="el-icon-close"></i>
|
|
|
- </div>
|
|
|
- <div class="details_content" v-loading="detail_loading">
|
|
|
- <el-row style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
|
|
|
- <el-col :span="24">
|
|
|
- <div class="flex-box flex-v-ce">
|
|
|
- <userImage
|
|
|
- :user_name="active == 'unclaimed' ? detailInfo.owner_name : detailInfo.receiver_name"
|
|
|
- :img_url="active == 'unclaimed' ? detailInfo.owner_img_url : detailInfo.receiver_img_url"
|
|
|
- width="50px"
|
|
|
- height="50px"
|
|
|
- ></userImage>
|
|
|
- <span style="line-height:50px; margin-left:10px;margin-right:4px;">
|
|
|
- {{ active == 'unclaimed' ? detailInfo.owner_name : detailInfo.receiver_name }}
|
|
|
- </span>
|
|
|
- <span class="red point" v-show="detailInfo.point_config.base_point >= 0">+{{ detailInfo.point_config.base_point }}</span>
|
|
|
- <span class="green point" v-show="detailInfo.point_config.base_point < 0">{{ detailInfo.point_config.base_point }}</span>
|
|
|
- <span style="margin-left: 5px;">{{ $getTypsName(detailInfo.pt_id)}}</span>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.task_name !== ''">
|
|
|
- <el-col :span="4">任务内容</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.task_name }}</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.task_remark !== ''">
|
|
|
- <el-col :span="4">任务描述</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.task_remark }}</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <!-- 发布时的图片 -->
|
|
|
- <el-row v-if="detailInfo.task_file_list !== null && detailInfo.task_file_list.length !== 0">
|
|
|
- <el-col :span="20" :offset="4">
|
|
|
- <el-image
|
|
|
- v-for="(item, index) in detailInfo.task_file_list"
|
|
|
- :key="index"
|
|
|
- style="width: 100px; height: 100px;margin-right:8px"
|
|
|
- :src="item"
|
|
|
- :preview-src-list="detailInfo.task_file_list"
|
|
|
- ></el-image>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.type_mark !== ''">
|
|
|
- <el-col :span="4">任务类型</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.type_mark }}</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row>
|
|
|
- <el-col :span="4">任务积分</el-col>
|
|
|
- <el-col :span="20">
|
|
|
- <span class="red point" v-show="detailInfo.point_config.base_point >= 0">+{{ detailInfo.point_config.base_point }}</span>
|
|
|
- <span class="green point" v-show="detailInfo.point_config.base_point < 0">{{ detailInfo.point_config.base_point }}</span>
|
|
|
-
|
|
|
- {{ $getTypsName(detailInfo.pt_id) }}</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.reviewer_name">
|
|
|
- <el-col :span="4">审批人</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.reviewer_name }}</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.owner_name">
|
|
|
- <el-col :span="4">发布人</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.owner_name }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="detailInfo.create_time">
|
|
|
- <el-col :span="4">发布时间</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.create_time }}</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.expire_time !== ''">
|
|
|
- <el-col :span="4">截止时间</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.expire_time }}</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.point_config.ahead_award_point">
|
|
|
- <el-col :span="4">提前奖分</el-col>
|
|
|
- <el-col :span="20">{{ detailInfo.point_config.ahead_award_point }}{{ $getTypsName(detailInfo.pt_id) }}/天</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row v-if="detailInfo.point_config.timeout_deduction_point">
|
|
|
- <el-col :span="4">逾期扣分</el-col>
|
|
|
- <el-col :span="20">{{detailInfo.point_config.timeout_deduction_point}}{{ $getTypsName(detailInfo.pt_id) }}/天</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <div v-show="detailInfo.point_config && detailInfo.point_config.item_info">
|
|
|
- <p class="row_title">规则依据</p>
|
|
|
- <el-row :gutter="10" v-if="detailInfo.point_config.rule_info">
|
|
|
- <el-col :span="4">规则分类</el-col>
|
|
|
- <el-col :span="19">{{ detailInfo.point_config.rule_info.name }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="detailInfo.point_config.item_info">
|
|
|
- <el-col :span="4">积分规则</el-col>
|
|
|
- <el-col :span="19">{{ detailInfo.point_config.item_info.remark }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="detailInfo.point_config.item_info">
|
|
|
- <el-col :span="4">积分</el-col>
|
|
|
- <el-col :span="19" v-show="detailInfo.point_config.item_info.min_point == detailInfo.point_config.item_info.max_point">{{ detailInfo.point_config.item_info.min_point }} {{ $getTypsName(detailInfo.pt_id) }}</el-col>
|
|
|
- <el-col :span="19" v-show="detailInfo.point_config.item_info.min_point != detailInfo.point_config.item_info.max_point">
|
|
|
- {{ detailInfo.point_config.item_info.min_point }} ~ {{ detailInfo.point_config.item_info.max_point }} {{ $getTypsName(detailInfo.pt_id) }}
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- <el-row v-if="detailInfo.task_file_list !== null && detailInfo.task_file_list.length !== 0">
|
|
|
- <el-col :span="4">图片附件</el-col>
|
|
|
- <el-col :span="20">
|
|
|
- <el-image style="width: 100px; height: 100px" :src="detailInfo.task_file_list[0]" :preview-src-list="detailInfo.task_file_list"></el-image>
|
|
|
- </el-col>
|
|
|
- </el-row> -->
|
|
|
-
|
|
|
- <div
|
|
|
- style="position: absolute; bottom: 20px; display: block; right: 20px;"
|
|
|
- v-if="detailInfo.status == '1' && user_id != detailInfo.owner_id && detailInfo.reviewer_id != user_id && !this.$authoritys('creator')"
|
|
|
- >
|
|
|
- <el-button plain @click="detailShow = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="collectTask" :loading="receiveLoad">领取任务</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-drawer>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 抢单任务详情弹窗 -->
|
|
|
+ <rewardTaskDetailsPopup :visible.sync="detailShow" v-if="detailShow" :id="detailId" :title="'任务详情'"></rewardTaskDetailsPopup>
|
|
|
+
|
|
|
+ <!-- 详情弹窗 -->
|
|
|
+ <taskDetailsPopup :visible.sync="showDetailPopup" v-if="showDetailPopup" :id="detailId" :title="'任务详情'"></taskDetailsPopup>
|
|
|
+
|
|
|
+ <el-drawer :custom-class="'drawer_details'" :visible.sync="completeShow" wrapperClosable :with-header="false" size="500px">
|
|
|
+ <div class="details_title flex-box-ce">
|
|
|
+ <span class="flex-1">完成任务</span>
|
|
|
+ <i @click="completeShow=false" style="cursor: pointer;" class="el-icon-close"></i>
|
|
|
+ </div>
|
|
|
+ <div class="details_content">
|
|
|
+ <el-form :model="detail_form" ref="detail_form" label-width="80px">
|
|
|
+ <el-form-item label="任务备注" prop="remark" :rules="[{ required: true, message: '请填写任务备注(限200字)', trigger: 'blur' }]">
|
|
|
+ <el-input v-model="detail_form.remark" type="textarea" :rows="4" maxlength="200" show-word-limit></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图片">
|
|
|
+ <upload
|
|
|
+ :headers="Xtoken"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="'https://' + 'integralsys.oss-cn-shenzhen.aliyuncs.com'"
|
|
|
+ :show-file-list="true"
|
|
|
+ :file-list="detail_form.fileList"
|
|
|
+ :on-success="handleFilesSuccess"
|
|
|
+ :on-preview="onFilePreView"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ :on-remove="onFileRemove"
|
|
|
+ :limit="3"
|
|
|
+ accept="image/jpeg,image/png"
|
|
|
+ :multiple="true"
|
|
|
+ ref="clearPicture"
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
+ (最多选择3张)
|
|
|
+ </upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="resetForm('detail_form')">取消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit('detail_form')">提交</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
+import rewardTaskDetailsPopup from '@/views/common/rewardTaskDetailsPopup';
|
|
|
+import taskDetailsPopup from '@/views/common/taskDetailsPopup'
|
|
|
+import upload from '@/components/upload';
|
|
|
export default {
|
|
|
+ components:{rewardTaskDetailsPopup,taskDetailsPopup,upload},
|
|
|
name: 'get_task',
|
|
|
data() {
|
|
|
return {
|
|
|
- active: 'unclaimed',
|
|
|
+ active: 'waiting',
|
|
|
list: [],
|
|
|
loading: false,
|
|
|
receiveLoad: false,
|
|
|
total: null,
|
|
|
formData: {
|
|
|
page: 1,
|
|
|
- page_size: 10
|
|
|
+ page_size: 10,
|
|
|
+ hall_type:'waiting',
|
|
|
},
|
|
|
detailShow: false,
|
|
|
detail_loading: false,
|
|
@@ -229,7 +135,18 @@ export default {
|
|
|
point_config: {},
|
|
|
task_file_list: []
|
|
|
},
|
|
|
- user_id: this.$getUserData().id
|
|
|
+ userInfo: this.$getUserData(),
|
|
|
+ detailId:0,
|
|
|
+ showDetailPopup:false,
|
|
|
+ detail_form: {
|
|
|
+ id: '',
|
|
|
+ remark: '',
|
|
|
+ fileList: [],
|
|
|
+ files: [],
|
|
|
+ },
|
|
|
+ completeShow:false,
|
|
|
+ //图片附件
|
|
|
+ Xtoken: { 'X-Token': this.$getToken() },
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -238,87 +155,159 @@ export default {
|
|
|
|
|
|
watch: {
|
|
|
active(val) {
|
|
|
+ this.formData.page=1;
|
|
|
this.list = [];
|
|
|
- this.get_list();
|
|
|
+ if(val=='myTask'){
|
|
|
+ this.get_myTask();
|
|
|
+ }else{
|
|
|
+ this.get_list();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ showDetailPopup(val){
|
|
|
+ if(!val){
|
|
|
+ this.get_myTask();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 领取任务
|
|
|
- collectTask() {
|
|
|
- let self = this;
|
|
|
- self.receiveLoad = true;
|
|
|
- self.$axios('POST', '/api/integral/task', { task_id: this.detailInfo.id })
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 1) {
|
|
|
- self.$message.success('领取成功');
|
|
|
- self.list.forEach((element, index) => {
|
|
|
- if (element.id == self.detailInfo.id) {
|
|
|
- self.list.splice(index, 1);
|
|
|
- }
|
|
|
- });
|
|
|
- self.detailShow = false;
|
|
|
- } else {
|
|
|
- self.$message.error(res.data.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- self.receiveLoad = false;
|
|
|
- });
|
|
|
+ //提交完成任务
|
|
|
+ onSubmit(formName) {
|
|
|
+ this.$refs[formName].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ let data = {
|
|
|
+ work_id: this.detail_form.id,
|
|
|
+ progress: '100',
|
|
|
+ remark: this.detail_form.remark,
|
|
|
+ state: '1',
|
|
|
+ files: this.detail_form.files
|
|
|
+ };
|
|
|
+ this.$axios('post', '/api/integral/work', data).then(res => {
|
|
|
+ this.$message.success(res.data.msg);
|
|
|
+ this.resetForm(formName);
|
|
|
+ this.get_myTask();
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //重置表单
|
|
|
+ resetForm(formName) {
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
+ this.completeShow = false;
|
|
|
+ this.detail_form.fileList = []
|
|
|
+ this.detail_form.files = []
|
|
|
+ },
|
|
|
+ handleFilesSuccess(response, file, fileList) {
|
|
|
+ let fileListData=fileList.filter(e=>{
|
|
|
+ return e.url
|
|
|
+ })
|
|
|
+ this.fileFun(file, fileList)
|
|
|
+ },
|
|
|
+ onFilePreView(file) {
|
|
|
+ if (file.response) {
|
|
|
+ window.open(file.response.url, '_blank');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onFileRemove(file, fileList) {
|
|
|
+ this.fileFun(file, fileList)
|
|
|
+ },
|
|
|
+ fileFun(file, fileList){
|
|
|
+ this.detail_form.fileList = fileList;
|
|
|
+ this.detail_form.files = []
|
|
|
+ fileList.forEach((item, index) => {
|
|
|
+ this.detail_form.files.push(item.url);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 附件上传
|
|
|
+ beforeUpload(file) {
|
|
|
+ const isJPG = /^image\/(jpeg|png|jpg)$/.test(file.type);
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 5;
|
|
|
+ if (!isJPG) {
|
|
|
+ this.$message.error('上传图片只能是 JPEG,PNG,JPG 格式!');
|
|
|
+ }
|
|
|
+ if (!isLt2M) {
|
|
|
+ this.$message.error('上传图片大小不能超过 5MB!');
|
|
|
+ }
|
|
|
+ return isJPG && isLt2M;
|
|
|
+ },
|
|
|
+ // 点击完成
|
|
|
+ completeBtn(data) {
|
|
|
+ this.detail_form.id = data.id;
|
|
|
+ this.completeShow = true;
|
|
|
},
|
|
|
// 页面变更
|
|
|
handleCurrentChange(val) {
|
|
|
this.formData.page = val;
|
|
|
- this.get_list();
|
|
|
+
|
|
|
+ if(this.active=='myTask'){
|
|
|
+ this.get_myTask();
|
|
|
+ }else{
|
|
|
+ this.get_list();
|
|
|
+ }
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
this.formData.page_size = val;
|
|
|
- this.get_list();
|
|
|
+ if(this.active=='myTask'){
|
|
|
+ this.get_myTask();
|
|
|
+ }else{
|
|
|
+ this.get_list();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 打开详情弹窗
|
|
|
openDetail(item) {
|
|
|
- this.detailShow = true;
|
|
|
- this.getDetailInfo(item);
|
|
|
+ this.detailId=item.id
|
|
|
+ if(this.active=='myTask'){
|
|
|
+ this.showDetailPopup = true;
|
|
|
+ }else{
|
|
|
+ this.detailShow = true;
|
|
|
+ }
|
|
|
},
|
|
|
// 获取详情信息
|
|
|
getDetailInfo(item) {
|
|
|
- let self = this;
|
|
|
- self.detail_loading = true;
|
|
|
+ this.detail_loading = true;
|
|
|
let data = { task_id: item.id };
|
|
|
- self.$axios('get', '/api/integral/task', data)
|
|
|
+ this.$axios('get', '/api/integral/task', data)
|
|
|
.then(res => {
|
|
|
if (res.data.code == 1) {
|
|
|
- self.detailInfo = JSON.parse(JSON.stringify(res.data.data));
|
|
|
+ this.detailInfo = JSON.parse(JSON.stringify(res.data.data));
|
|
|
} else {
|
|
|
- self.$message.error(res.data.data.msg);
|
|
|
+ this.$message.error(res.data.data.msg);
|
|
|
}
|
|
|
})
|
|
|
.finally(() => {
|
|
|
- self.detail_loading = false;
|
|
|
+ this.detail_loading = false;
|
|
|
});
|
|
|
},
|
|
|
// 获取列表信息
|
|
|
get_list() {
|
|
|
- let self = this;
|
|
|
- self.loading = true;
|
|
|
+ this.loading = true;
|
|
|
let data = JSON.parse(JSON.stringify(this.formData));
|
|
|
- if (self.active == 'unclaimed') {
|
|
|
- data.hall_type = 'waiting';
|
|
|
- } else {
|
|
|
- data.hall_type = 'catch';
|
|
|
+ data.hall_type=this.active
|
|
|
+ this.$axios('get', '/api/integral/task/hall', data).then(res => {
|
|
|
+ this.list = res.data.data.list;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ get_myTask() {
|
|
|
+ this.loading = true;
|
|
|
+ let data={
|
|
|
+ status:'all',
|
|
|
+ page:this.formData.page,
|
|
|
+ page_size:this.formData.page_size,
|
|
|
+ source_type:2,
|
|
|
+ sort: 'publish',
|
|
|
+ today: 0
|
|
|
}
|
|
|
- self.$axios('get', '/api/integral/task/hall', data)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 1) {
|
|
|
- self.list = res.data.data.list;
|
|
|
- self.total = res.data.data.total;
|
|
|
- } else {
|
|
|
- self.$message.error(res.data.data.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- self.loading = false;
|
|
|
- });
|
|
|
+ this.$axios('get', '/api/integral/work/list', data).then(res => {
|
|
|
+ this.list = res.data.data.list;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
}
|
|
|
};
|