|
@@ -14,27 +14,28 @@
|
|
</view>
|
|
</view>
|
|
</u-navbar>
|
|
</u-navbar>
|
|
<!-- 任务列表 -->
|
|
<!-- 任务列表 -->
|
|
- <view class="pageBody">
|
|
|
|
|
|
+ <scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
|
|
<view v-for="item in listData" :key="item.id" class="itemInfo">
|
|
<view v-for="item in listData" :key="item.id" class="itemInfo">
|
|
<view class="itemName">
|
|
<view class="itemName">
|
|
- <span class="name">{{item.name}}</span>
|
|
|
|
- <u-switch size="40" v-model="item.checked"></u-switch>
|
|
|
|
|
|
+ <span class="name">{{listData.name}}</span>
|
|
|
|
+ <u-switch size="40" v-model="listData.status"></u-switch>
|
|
</view>
|
|
</view>
|
|
<view class="itemName">
|
|
<view class="itemName">
|
|
- <span>{{item.time}}</span>
|
|
|
|
|
|
+ <span>{{listData.startDate}}- {{listData.endDate}}</span>
|
|
<span>
|
|
<span>
|
|
- <u-button v-if="item.checked==false" type="warning" size="mini" style="margin-right: 15upx;" @click="handetail">查看</u-button>
|
|
|
|
|
|
+ <u-button v-if="listData.status==1" type="warning" size="mini" style="margin-right: 15upx;" @click="handetail">查看</u-button>
|
|
<u-button type="primary" size="mini" style="margin-right: 15upx;" @click="handedit">编辑</u-button>
|
|
<u-button type="primary" size="mini" style="margin-right: 15upx;" @click="handedit">编辑</u-button>
|
|
- <u-button type="error" size="mini" @click="handelete">删除</u-button>
|
|
|
|
|
|
+ <u-button type="error" size="mini" @click="handelete(item)">删除</u-button>
|
|
</span>
|
|
</span>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </scroll-view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import {getCheckTaskConfigList,delCheckTaskConfig,enableCheckTaskConfig,saveBackLog} from '../../api/checkTaskConfig.js'
|
|
export default{
|
|
export default{
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
@@ -42,11 +43,13 @@
|
|
// 渐变色
|
|
// 渐变色
|
|
backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
|
|
backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
|
|
},
|
|
},
|
|
|
|
+ status: 'loadmore',
|
|
|
|
+ noDataText: '暂无数据',
|
|
listData:[
|
|
listData:[
|
|
- {name:'夏季活动',time:'2020-05-20',checked:true,controlStatus: false},
|
|
|
|
- {name:'夏季活动',time:'2020-05-20',checked:false},
|
|
|
|
- {name:'夏季活动',time:'2020-05-20',checked:true},
|
|
|
|
- {name:'夏季活动',time:'2020-05-20',checked:false},
|
|
|
|
|
|
+ // {name:'夏季活动',time:'2020-05-20',checked:true,controlStatus: false},
|
|
|
|
+ // {name:'夏季活动',time:'2020-05-20',checked:false},
|
|
|
|
+ // {name:'夏季活动',time:'2020-05-20',checked:true},
|
|
|
|
+ // {name:'夏季活动',time:'2020-05-20',checked:false},
|
|
]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -54,8 +57,8 @@
|
|
checked(val) {
|
|
checked(val) {
|
|
// 等于false,意味着用户手动关闭了switch
|
|
// 等于false,意味着用户手动关闭了switch
|
|
if (val == false) {
|
|
if (val == false) {
|
|
- if(this.controlStatus == true) {
|
|
|
|
- this.controlStatus = false;
|
|
|
|
|
|
+ if(this.listData.status == 0) {
|
|
|
|
+ this.listData.status = 1;
|
|
return ;
|
|
return ;
|
|
}
|
|
}
|
|
// 重新打开switch,并让它处于加载中的状态
|
|
// 重新打开switch,并让它处于加载中的状态
|
|
@@ -66,7 +69,22 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onLoad() {
|
|
|
|
+ this.getListData()
|
|
|
|
+ },
|
|
methods:{
|
|
methods:{
|
|
|
|
+ // 列表数据
|
|
|
|
+ getListData(){
|
|
|
|
+ getCheckTaskConfigList({pageNo:1,pageSize:10}).then(res=>{
|
|
|
|
+ console.log(res)
|
|
|
|
+ if(res.status==200){
|
|
|
|
+ this.listData=res.data[0].list[0]
|
|
|
|
+ this.listData.startDate=this.listData.startDate.substring(0,11)
|
|
|
|
+ this.listData.endDate=this.listData.endDate.substring(0,11)
|
|
|
|
+ console.log(this.listData.startDate)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
openAddPage(){
|
|
openAddPage(){
|
|
console.log('-------------------')
|
|
console.log('-------------------')
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -76,7 +94,7 @@
|
|
// 查看详情
|
|
// 查看详情
|
|
handetail(){
|
|
handetail(){
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url:'/pages/spotCheckConfigure/spotCheckDetail/spotCheckDetail'
|
|
|
|
|
|
+ url:'/pages/spotCheckConfigure/spotCheckDetail/spotCheckDetail?id=${listData.id}'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 编辑
|
|
// 编辑
|
|
@@ -86,8 +104,20 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 删除
|
|
// 删除
|
|
- handelete(){
|
|
|
|
-
|
|
|
|
|
|
+ handelete(item){
|
|
|
|
+ const _this=this
|
|
|
|
+ clzConfirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确认删除,删除后数据将无法恢复?',
|
|
|
|
+ // success: function(res) {
|
|
|
|
+ // if (res.confirm || res.index == 0) {
|
|
|
|
+ // _this.isClose = true
|
|
|
|
+ // uni.navigateBack({
|
|
|
|
+ // delta: 1
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -118,22 +148,17 @@
|
|
margin-right: 10upx;
|
|
margin-right: 10upx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .pageBody{
|
|
|
|
- .itemInfo{
|
|
|
|
- margin: 20upx;
|
|
|
|
- background-color: #fff;
|
|
|
|
- border-radius: 3px;
|
|
|
|
- .itemName{
|
|
|
|
- padding: 25upx 35upx;
|
|
|
|
- display: flex;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- }
|
|
|
|
- .itemName:first-child{
|
|
|
|
- border-bottom: 1px solid #f8f8f8;
|
|
|
|
- }
|
|
|
|
|
|
+ .itemInfo{
|
|
|
|
+ margin: 20upx;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ border-radius: 3px;
|
|
|
|
+ .itemName{
|
|
|
|
+ padding: 25upx 35upx;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ }
|
|
|
|
+ .itemName:first-child{
|
|
|
|
+ border-bottom: 1px solid #f8f8f8;
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|