|
|
@@ -59,12 +59,20 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-has-permi="['course:checkinActivity:edit']">修改</el-button>
|
|
|
+ v-has-permi="['course:checkinActivity:edit']"
|
|
|
+ :disabled="scope.row.status === 1">修改</el-button>
|
|
|
<el-button size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-has-permi="['course:checkinActivity:remove']">删除</el-button>
|
|
|
+ v-has-permi="['course:checkinActivity:remove']"
|
|
|
+ :disabled="scope.row.status === 1">删除</el-button>
|
|
|
+ <el-button size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-document-copy"
|
|
|
+ @click="handleCopy(scope.row)"
|
|
|
+ v-has-permi="['course:checkinActivity:add']"
|
|
|
+ v-if="scope.row.status === 2">复制活动</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -146,7 +154,7 @@
|
|
|
|
|
|
<el-form-item v-if="form.prizeType === 1" label="红包金额" prop="redpacketAmount"
|
|
|
:rules="{ required: true, message: '红包金额不能为空', trigger: 'blur' }">
|
|
|
- <el-input-number v-model="form.redpacketAmount" :min="0.01" :precision="2" :step="0.1" size="small" style="width: 200px" />
|
|
|
+ <el-input-number v-model="form.redpacketAmount" :min="0.1" :precision="2" :step="0.1" size="small" style="width: 200px" />
|
|
|
<span style="margin-left: 10px; color: #999;">元</span>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -176,6 +184,28 @@
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 复制活动对话框 -->
|
|
|
+ <el-dialog title="复制活动" :visible.sync="copyOpen" width="500px" append-to-body>
|
|
|
+ <el-form :model="copyForm" ref="copyForm" :rules="copyRules" label-width="120px">
|
|
|
+ <el-form-item label="新活动时间" prop="timeRange">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="copyForm.timeRange"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ size="small"
|
|
|
+ style="width: 100%">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="copyOpen = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitCopy">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -233,6 +263,16 @@ export default {
|
|
|
{ required: true, message: "参与项目不能为空", trigger: "change" }
|
|
|
],
|
|
|
|
|
|
+ },
|
|
|
+ copyOpen: false,
|
|
|
+ copyForm: {
|
|
|
+ activityId: null,
|
|
|
+ timeRange: []
|
|
|
+ },
|
|
|
+ copyRules: {
|
|
|
+ timeRange: [
|
|
|
+ { required: true, message: "新活动时间不能为空", trigger: "change" }
|
|
|
+ ]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
@@ -391,6 +431,36 @@ export default {
|
|
|
this.msgSuccess("删除成功");
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
+ handleCopy(row) {
|
|
|
+ this.copyForm.activityId = row.activityId;
|
|
|
+ this.copyForm.timeRange = [];
|
|
|
+ this.copyOpen = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.copyForm) {
|
|
|
+ this.$refs.copyForm.clearValidate();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submitCopy() {
|
|
|
+ this.$refs.copyForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const params = {
|
|
|
+ activityId: this.copyForm.activityId,
|
|
|
+ startTime: this.copyForm.timeRange[0],
|
|
|
+ endTime: this.copyForm.timeRange[1]
|
|
|
+ };
|
|
|
+ request({
|
|
|
+ url: '/course/checkinActivity/copy',
|
|
|
+ method: 'post',
|
|
|
+ data: params
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("复制成功");
|
|
|
+ this.copyOpen = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.reset();
|