Blame view

pages/work/case/manage.vue 6.13 KB
46b6767c   刘淇   init 提交到库
1
2
  <template>
  	<view class="container">
d8fce1e2   刘淇   页面onShow 加载
3
  		<z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false">
46b6767c   刘淇   init 提交到库
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  		<template #top>
  			<tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs>
  		</template>
  		<view class="ul fs-p20">
  			<view class="li fs-bg__white fs-p30 fs-size__h4 fs-radius__sm fs-mt20" v-for="(item, index) in dataList">
  				<view @click="toDetails(item.id, item.problemNo, item.taskStatus)">
  					<view>问题单号:{{item.problemNo}}</view>
  					<view class="fs-mt16 fs-flex__between">
  						<view>
  							任务状态:
  							<tui-text v-if="item.taskStatus == 1" text="处理中" type="danger"></tui-text>
  							<tui-text v-else-if="item.taskStatus == 2" text="已处理" type="primary"></tui-text>
  							<tui-text v-else-if="item.taskStatus == 3" text="已确认" type="success"></tui-text>
  							<tui-text v-else-if="item.taskStatus == 4" text="已驳回" type="danger"></tui-text>
  							<tui-text v-else-if="item.taskStatus == 5" text="已拒绝" type="danger"></tui-text>
  						</view>
  						<view>紧急程度:
  							<tui-text v-if="item.pressingType == 1" type="primary" text="特急"></tui-text>
  							<tui-text v-else-if="item.pressingType == 2" type="primary" text="紧急"></tui-text>
  							<tui-text v-else-if="item.pressingType == 3" type="primary" text="一般"></tui-text>
  						</view>
  					</view>
  					<view class="fs-mt16 fs-flex__between">
f883eafa   刘淇   首次加载
27
28
  						<view class="fs-ellipsis fs-mr20">养护类型:{{item.maintainTypeName}}</view>
  						<view class="fs-ellipsis fs-flex__1">植物类型:{{item.plantTypeName}}</view>
46b6767c   刘淇   init 提交到库
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  					</view>
  					<view class="fs-mt16">道路名称:{{item.roadName}}</view>
  					<view class="fs-mt16 fs-ellipsis__2">任务描述:{{item.taskRemark}}</view>
  					<view class="fs-mt16">提交日期:{{item.createTime}}</view>
  				</view>
  				<view class="fs-mt16 fs-align__right">
  					<tui-tag type="primary" padding="12rpx 30rpx" shape="circle" plain @click="toCase(item.problemNo)">问题详情</tui-tag>
  					<tui-tag type="primary" padding="12rpx 30rpx" shape="circle" plain margin="0 0 0 20rpx" @click="toStep(item.problemNo)">处理进度</tui-tag>
  					<block v-if="item.taskStatus == 2">
  						<tui-tag type="danger" padding="12rpx 30rpx" shape="circle" plain margin="0 0 0 20rpx" @click="modalShow(item.problemNo)">驳回</tui-tag>
  						<tui-tag type="green" padding="12rpx 30rpx" shape="circle" plain margin="0 0 0 20rpx" @click="openModal(item.problemNo)">确认</tui-tag>
  					</block>
  					<tui-tag v-if="item.taskStatus == 5" type="green" padding="12rpx 30rpx" shape="circle" plain margin="0 0 0 20rpx" @click="toAllocation(item.id)">重新分配</tui-tag>
  				</view>
  			</view>
  		</view>
  		</z-paging>
  		<tui-modal :show="showModal" @click="confirm" @cancel="hideModal" content="您确定要完成吗?"></tui-modal>
  		<tui-modal :show="modal" custom padding="30rpx 30rpx">
  			<view class="fs-size__28 fs-mb20">问题单号:{{problemNo}}</view>
  			<tui-textarea placeholder="请输入驳回原因" isCounter v-model="content" :maxlength="60" textareaBorder borderColor="#577ee3" :size="28" :radius="20" height="130rpx" min-height="130rpx"></tui-textarea>
  			<tui-white-space size="large"></tui-white-space>
  			<view class="fs-flex__center">
  				<tui-button plain width="200rpx" height="60rpx" :size="28" shape="circle" margin="0 50rpx 0 0" @click="modalClose">取消</tui-button>
  				<tui-button width="200rpx" height="60rpx" :size="28" shape="circle" @click="confrim">确定</tui-button>
  		    </view>
  		</tui-modal>
  	</view>
  </template>
  
  <script>
  import { apiTaskLeaderList, apiCaseReject, apiTaskconfirm } from '@/api/work'
  export default {
  	data() {
  		return {
  			tabsList: [
  				{name: "全部", sign: ""},
  				{name: "处理中", sign: 1},
  				{name: "已处理", sign: 2},
  				{name: "已确认", sign: 3},
  				{name: "已驳回", sign: 4},
  				{name: "已拒绝", sign: 5}
  			],
  			currentTab: 0,
  			dataList: [],
  			showModal: false,
  			problemNo: '',
  			content: '',
  			modal: false
  		}
  	},
  	onLoad() {
  
  	},
d8fce1e2   刘淇   页面onShow 加载
83
84
85
86
87
    onShow(){
      if (this.$refs.paging) {
        this.$refs.paging.refresh() // 重置到第一页并触发query事件
      }
    },
46b6767c   刘淇   init 提交到库
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
  	methods: {
  		// 获取记录列表
  		queryList(pageNo, pageSize) {
  			const params = {
  				pageReq: {isAsc: 'desc', orderByColumn: 'id', pageNum: pageNo, pageSize: pageSize},
  				taskStatus: this.tabsList[this.currentTab].sign
  			}
  			apiTaskLeaderList({data:params}).then(res => {
  				this.$refs.paging.complete(res.rows)
  			})
  		},
  		// 刷新列表
  		refreshList() {
  			this.$refs.paging.refresh()
  		},
  		// 切换菜单
  		change(e) {
  			this.currentTab = e.index
  			this.$refs.paging.reload()
  		},
  		// 打开确认
  		openModal(problemNo) {
  			this.problemNo = problemNo
  			this.showModal = true
  		},
  		// 取消确认
  		hideModal() {
  			this.showModal = false
  		},
  		// 确认提交
  		confirm(e) {
  			this.hideModal()
  			if (e.index == 1) {
  				apiTaskconfirm({data:{problemNo:this.problemNo, leaderConfrimRemark:'OK'}}).then(res => {
  					this.$refs.paging.refresh()
  				})
  			}
  		},
  		// 处理详情
  		toDetails(id, problemNo, status) {
  			const path = (status == 1 || status == 5) ? `/pages/work/case/task?id=${id}` : `/pages/work/case/result?problem_no=${problemNo}`
  			uni.$tui.href(path)
  		},
  		// 问题详情
  		toCase(problemNo) {
  			uni.$tui.href(`/pages/work/daily/details?problem_no=${problemNo}`)
  		},
  		// 进度详情
  		toStep(problemNo) {
  			uni.$tui.href(`/pages/work/daily/step?problem_no=${problemNo}`)
  		},
  		// 重新分配
  		toAllocation(id) {
  			uni.$tui.href(`/pages/work/case/reassignment?id=${id}`)
  		},
  		// 领导驳回
  		modalShow(problemNo) {
  			this.problemNo = problemNo
  			this.content = ''
  			this.modal = true
  		},
  		// 关闭驳回弹窗
  		modalClose() {
  			this.modal = false
  		},
  		// 提交驳回
  		confrim() {
  			if (!this.content) {
  				uni.$tui.toast('请输入驳回原因')
  				return
  			}
  			this.modalClose()
  			apiCaseReject({data:{problemNo:this.problemNo,leaderRejectRemark:this.content}}).then(res => {
  				uni.$tui.toast('提交成功')
  				setTimeout(() => { this.$refs.paging.refresh() }, 1500)
  			})
  		}
  	}
  }
  </script>
  
  <style lang="scss" scoped>
  .ul .li:first-child {
  	margin-top: 0;
  }
  </style>