|
|
@@ -33,6 +33,7 @@ $(function () {
|
|
|
colModel: [
|
|
|
{ label: 'id', name: 'id', index: 'id', width: 50, key: true ,hidden: true},
|
|
|
{ label: '任务名称', name: 'taskName', index: 'taskName', width: 70 },
|
|
|
+ { label: '任务标题', name: 'taskTitle', index: 'taskTitle', width: 70 },
|
|
|
{ label: '任务类型', name: 'taskType', index: 'taskType', width: 60, sortable: false,formatter: function (cellvalue, options, rowdata) {
|
|
|
for (const item of vm.type) {
|
|
|
if(cellvalue == item.value) {
|
|
|
@@ -50,6 +51,7 @@ $(function () {
|
|
|
}
|
|
|
}
|
|
|
}},
|
|
|
+ { label: '任务描述', name: 'taskDesc', index: 'taskDesc', width: 100 },
|
|
|
],
|
|
|
viewrecords: true,
|
|
|
height: 385,
|
|
|
@@ -105,6 +107,18 @@ var vm = new Vue({
|
|
|
this.$nextTick(function(){
|
|
|
$('#qstaffguid').selectpicker('refresh');
|
|
|
})
|
|
|
+ },
|
|
|
+ // 监听任务类型变化
|
|
|
+ 'work.taskType'(newVal) {
|
|
|
+ if (newVal === 1) { // 每日任务
|
|
|
+ // 设置默认值(仅当值为空时)
|
|
|
+ if (!vm.work.taskNum) {
|
|
|
+ vm.work.taskNum = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 切换为非每日任务时清空任务次数
|
|
|
+ vm.work.taskNum = '';
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -178,6 +192,15 @@ layui.use([ 'layer', 'form'],function() {
|
|
|
var $ = layui.jquery, layer = layui.layer, form = layui.form;
|
|
|
|
|
|
form.on('submit(go)', function(data){
|
|
|
+ // 每日任务必填验证
|
|
|
+ if (vm.work.taskType === 1 && (!vm.work.taskNum || vm.work.taskNum === '')) {
|
|
|
+ layer.alert('每日任务必须填写任务次数', {
|
|
|
+ icon: 2,
|
|
|
+ title: '验证失败'
|
|
|
+ });
|
|
|
+ return false; // 阻止表单提交
|
|
|
+ }
|
|
|
+
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: baseURL + 'qmjz/taskManage/update',
|