Commit a41fe73c9d665cb7fcd13d81f9188b8b9e8d5752
1 parent
660c16d6
feat: 订货单-卡片-增加 审核状态筛选,卡片增加审核状态,标签样式
Showing
1 changed file
with
65 additions
and
9 deletions
| @@ -23,9 +23,11 @@ | @@ -23,9 +23,11 @@ | ||
| 23 | <view class="card-header"> | 23 | <view class="card-header"> |
| 24 | <text class="title omit2">{{ item.orderingUnitName }}</text> | 24 | <text class="title omit2">{{ item.orderingUnitName }}</text> |
| 25 | <text v-if="item.status" :class="['status', `status_${item.status}`]">{{ filterStatus(item.status) | 25 | <text v-if="item.status" :class="['status', `status_${item.status}`]">{{ filterStatus(item.status) |
| 26 | - }}</text> | 26 | + }}</text> |
| 27 | </view> | 27 | </view> |
| 28 | <view class="info-row"><text>订单编号</text><text>{{ item.orderNo }}</text></view> | 28 | <view class="info-row"><text>订单编号</text><text>{{ item.orderNo }}</text></view> |
| 29 | + <view class="info-row"><text>审核状态</text><text><span :class="['status', `status_${item.examineStatus}`]">{{ | ||
| 30 | + filterExamineStatus(item.examineStatus) }}</span></text></view> | ||
| 29 | <view class="info-row"><text>生产厂</text><text>{{ item.workshopName }}</text></view> | 31 | <view class="info-row"><text>生产厂</text><text>{{ item.workshopName }}</text></view> |
| 30 | <view class="info-row"><text>办事处</text><text>{{ item.deptName }}</text></view> | 32 | <view class="info-row"><text>办事处</text><text>{{ item.deptName }}</text></view> |
| 31 | <view class="info-row"><text>订货日期</text><text>{{ item.orderDate }}</text></view> | 33 | <view class="info-row"><text>订货日期</text><text>{{ item.orderDate }}</text></view> |
| @@ -40,7 +42,8 @@ | @@ -40,7 +42,8 @@ | ||
| 40 | <view class="filter-form"> | 42 | <view class="filter-form"> |
| 41 | <view class="form-item"> | 43 | <view class="form-item"> |
| 42 | <view class="label">办事处</view> | 44 | <view class="label">办事处</view> |
| 43 | - <uni-easyinput v-model="model.deptName" placeholder="请输入办事处" :inputBorder="false" /> | 45 | + <uni-easyinput v-model="model.deptName" placeholder="请输入办事处" :inputBorder="false" |
| 46 | + placeholderStyle="font-size:14px" /> | ||
| 44 | </view> | 47 | </view> |
| 45 | 48 | ||
| 46 | <view class="form-item"> | 49 | <view class="form-item"> |
| @@ -56,6 +59,12 @@ | @@ -56,6 +59,12 @@ | ||
| 56 | </view> | 59 | </view> |
| 57 | 60 | ||
| 58 | <view class="form-item"> | 61 | <view class="form-item"> |
| 62 | + <view class="label">审核状态</view> | ||
| 63 | + <uni-data-checkbox mode="tag" :multiple="false" :value-field="'value'" :text-field="'text'" | ||
| 64 | + v-model="model.examineStatus" @change="onExamineStatusChange" :localdata="examineStatusOptions" /> | ||
| 65 | + </view> | ||
| 66 | + | ||
| 67 | + <view class="form-item"> | ||
| 59 | <view class="label">订货日期</view> | 68 | <view class="label">订货日期</view> |
| 60 | <uni-datetime-picker type="daterange" v-model="model.dateRange" start="2023-01-01" /> | 69 | <uni-datetime-picker type="daterange" v-model="model.dateRange" start="2023-01-01" /> |
| 61 | </view> | 70 | </view> |
| @@ -93,6 +102,7 @@ export default { | @@ -93,6 +102,7 @@ export default { | ||
| 93 | }, | 102 | }, |
| 94 | workshopOptions: [], | 103 | workshopOptions: [], |
| 95 | statusOptions: [], | 104 | statusOptions: [], |
| 105 | + examineStatusOptions: [], | ||
| 96 | query: {}, | 106 | query: {}, |
| 97 | extraParams: {}, | 107 | extraParams: {}, |
| 98 | currentItems: [] | 108 | currentItems: [] |
| @@ -105,6 +115,7 @@ export default { | @@ -105,6 +115,7 @@ export default { | ||
| 105 | ] | 115 | ] |
| 106 | this.extraParams = { type: this.tabValue } | 116 | this.extraParams = { type: this.tabValue } |
| 107 | this.loadStatusOptions() | 117 | this.loadStatusOptions() |
| 118 | + this.loadExamineStatusOptions() | ||
| 108 | this.loadWorkshopOptions() | 119 | this.loadWorkshopOptions() |
| 109 | }, | 120 | }, |
| 110 | onReachBottom() { | 121 | onReachBottom() { |
| @@ -118,11 +129,19 @@ export default { | @@ -118,11 +129,19 @@ export default { | ||
| 118 | const res = await getDicByCodeApi('ORDER_STATUS') | 129 | const res = await getDicByCodeApi('ORDER_STATUS') |
| 119 | const list = res.data || [] | 130 | const list = res.data || [] |
| 120 | this.statusOptions = list.map(it => ({ text: it.name || '', value: it.code || '' })); | 131 | this.statusOptions = list.map(it => ({ text: it.name || '', value: it.code || '' })); |
| 121 | - console.log('this.statusOptions', this.statusOptions) | ||
| 122 | } catch (e) { | 132 | } catch (e) { |
| 123 | this.statusOptions = [] | 133 | this.statusOptions = [] |
| 124 | } | 134 | } |
| 125 | }, | 135 | }, |
| 136 | + async loadExamineStatusOptions() { | ||
| 137 | + try { | ||
| 138 | + const res = await getDicByCodeApi('AUDIT_STATUS') | ||
| 139 | + const list = res.data || [] | ||
| 140 | + this.examineStatusOptions = list.map(it => ({ text: it.name || '', value: it.code || '' })); | ||
| 141 | + } catch (e) { | ||
| 142 | + this.examineStatusOptions = [] | ||
| 143 | + } | ||
| 144 | + }, | ||
| 126 | async loadWorkshopOptions() { | 145 | async loadWorkshopOptions() { |
| 127 | try { | 146 | try { |
| 128 | const res = await workshopQueryApi({ pageIndex: 1, pageSize: 9999 }) | 147 | const res = await workshopQueryApi({ pageIndex: 1, pageSize: 9999 }) |
| @@ -179,6 +198,10 @@ export default { | @@ -179,6 +198,10 @@ export default { | ||
| 179 | const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '') | 198 | const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '') |
| 180 | this.filterForm.status = raw | 199 | this.filterForm.status = raw |
| 181 | }, | 200 | }, |
| 201 | + onExamineStatusChange(e) { | ||
| 202 | + const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '') | ||
| 203 | + this.filterForm.examineStatus = raw | ||
| 204 | + }, | ||
| 182 | onWorkshopChange(e) { | 205 | onWorkshopChange(e) { |
| 183 | const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '') | 206 | const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '') |
| 184 | this.filterForm.workshopId = raw | 207 | this.filterForm.workshopId = raw |
| @@ -201,13 +224,8 @@ export default { | @@ -201,13 +224,8 @@ export default { | ||
| 201 | let records = _data.datas || _data.list || _data.records || [] | 224 | let records = _data.datas || _data.list || _data.records || [] |
| 202 | const totalCount = _data.totalCount || _data.count || 0 | 225 | const totalCount = _data.totalCount || _data.count || 0 |
| 203 | const hasNext = _data.hasNext || false | 226 | const hasNext = _data.hasNext || false |
| 204 | - const statusTextMap = (this.statusOptions || []).reduce((acc, it) => { | ||
| 205 | - acc[String(it.value)] = it.text | ||
| 206 | - return acc | ||
| 207 | - }, {}) | ||
| 208 | records = records.map(it => ({ | 227 | records = records.map(it => ({ |
| 209 | - ...it, | ||
| 210 | - statusName: statusTextMap[String(it.status)] || '' | 228 | + ...it |
| 211 | })) | 229 | })) |
| 212 | return { records, totalCount, hasNext } | 230 | return { records, totalCount, hasNext } |
| 213 | }).catch(() => { | 231 | }).catch(() => { |
| @@ -218,6 +236,9 @@ export default { | @@ -218,6 +236,9 @@ export default { | ||
| 218 | filterStatus(status) { | 236 | filterStatus(status) { |
| 219 | return this.statusOptions.filter(item => item.value === status)[0].text || ''; | 237 | return this.statusOptions.filter(item => item.value === status)[0].text || ''; |
| 220 | }, | 238 | }, |
| 239 | + filterExamineStatus(status) { | ||
| 240 | + return this.examineStatusOptions.filter(item => item.value === status)[0].text || ''; | ||
| 241 | + }, | ||
| 221 | onCardClick(item) { | 242 | onCardClick(item) { |
| 222 | const id = (item && (item.id || item.code)) || '' | 243 | const id = (item && (item.id || item.code)) || '' |
| 223 | if (!id) return | 244 | if (!id) return |
| @@ -383,6 +404,41 @@ export default { | @@ -383,6 +404,41 @@ export default { | ||
| 383 | &:last-child { | 404 | &:last-child { |
| 384 | color: rgba(0, 0, 0, 0.9); | 405 | color: rgba(0, 0, 0, 0.9); |
| 385 | } | 406 | } |
| 407 | + | ||
| 408 | + .status { | ||
| 409 | + display: inline-block; | ||
| 410 | + padding: 4rpx 12rpx; | ||
| 411 | + border-radius: 6rpx; | ||
| 412 | + font-size: 24rpx; | ||
| 413 | + color: #fff; | ||
| 414 | + line-height: 40rpx; | ||
| 415 | + | ||
| 416 | + // 审核中 | ||
| 417 | + &.status_AUDIT { | ||
| 418 | + background: rgb(242, 243, 255); | ||
| 419 | + color: $theme-primary; | ||
| 420 | + | ||
| 421 | + } | ||
| 422 | + | ||
| 423 | + // 审核通过 | ||
| 424 | + &.status_PASS { | ||
| 425 | + color: rgb(43, 164, 113); | ||
| 426 | + background-color: rgb(227, 249, 233); | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + // 已驳回 | ||
| 430 | + &.status_REFUSE { | ||
| 431 | + color: rgb(213, 73, 65); | ||
| 432 | + background-color: rgb(255, 240, 237); | ||
| 433 | + } | ||
| 434 | + | ||
| 435 | + // 已取消 | ||
| 436 | + &.status_CANCEL { | ||
| 437 | + background: #e7e7e7; | ||
| 438 | + color: rgba(0, 0, 0, 0.6); | ||
| 439 | + } | ||
| 440 | + } | ||
| 441 | + | ||
| 386 | } | 442 | } |
| 387 | } | 443 | } |
| 388 | 444 |