Commit a41fe73c9d665cb7fcd13d81f9188b8b9e8d5752
1 parent
660c16d6
feat: 订货单-卡片-增加 审核状态筛选,卡片增加审核状态,标签样式
Showing
1 changed file
with
65 additions
and
9 deletions
| ... | ... | @@ -23,9 +23,11 @@ |
| 23 | 23 | <view class="card-header"> |
| 24 | 24 | <text class="title omit2">{{ item.orderingUnitName }}</text> |
| 25 | 25 | <text v-if="item.status" :class="['status', `status_${item.status}`]">{{ filterStatus(item.status) |
| 26 | - }}</text> | |
| 26 | + }}</text> | |
| 27 | 27 | </view> |
| 28 | 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 | 31 | <view class="info-row"><text>生产厂</text><text>{{ item.workshopName }}</text></view> |
| 30 | 32 | <view class="info-row"><text>办事处</text><text>{{ item.deptName }}</text></view> |
| 31 | 33 | <view class="info-row"><text>订货日期</text><text>{{ item.orderDate }}</text></view> |
| ... | ... | @@ -40,7 +42,8 @@ |
| 40 | 42 | <view class="filter-form"> |
| 41 | 43 | <view class="form-item"> |
| 42 | 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 | 47 | </view> |
| 45 | 48 | |
| 46 | 49 | <view class="form-item"> |
| ... | ... | @@ -56,6 +59,12 @@ |
| 56 | 59 | </view> |
| 57 | 60 | |
| 58 | 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 | 68 | <view class="label">订货日期</view> |
| 60 | 69 | <uni-datetime-picker type="daterange" v-model="model.dateRange" start="2023-01-01" /> |
| 61 | 70 | </view> |
| ... | ... | @@ -93,6 +102,7 @@ export default { |
| 93 | 102 | }, |
| 94 | 103 | workshopOptions: [], |
| 95 | 104 | statusOptions: [], |
| 105 | + examineStatusOptions: [], | |
| 96 | 106 | query: {}, |
| 97 | 107 | extraParams: {}, |
| 98 | 108 | currentItems: [] |
| ... | ... | @@ -105,6 +115,7 @@ export default { |
| 105 | 115 | ] |
| 106 | 116 | this.extraParams = { type: this.tabValue } |
| 107 | 117 | this.loadStatusOptions() |
| 118 | + this.loadExamineStatusOptions() | |
| 108 | 119 | this.loadWorkshopOptions() |
| 109 | 120 | }, |
| 110 | 121 | onReachBottom() { |
| ... | ... | @@ -118,11 +129,19 @@ export default { |
| 118 | 129 | const res = await getDicByCodeApi('ORDER_STATUS') |
| 119 | 130 | const list = res.data || [] |
| 120 | 131 | this.statusOptions = list.map(it => ({ text: it.name || '', value: it.code || '' })); |
| 121 | - console.log('this.statusOptions', this.statusOptions) | |
| 122 | 132 | } catch (e) { |
| 123 | 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 | 145 | async loadWorkshopOptions() { |
| 127 | 146 | try { |
| 128 | 147 | const res = await workshopQueryApi({ pageIndex: 1, pageSize: 9999 }) |
| ... | ... | @@ -179,6 +198,10 @@ export default { |
| 179 | 198 | const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '') |
| 180 | 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 | 205 | onWorkshopChange(e) { |
| 183 | 206 | const raw = e && e.detail && e.detail.value !== undefined ? e.detail.value : (e && e.value !== undefined ? e.value : '') |
| 184 | 207 | this.filterForm.workshopId = raw |
| ... | ... | @@ -201,13 +224,8 @@ export default { |
| 201 | 224 | let records = _data.datas || _data.list || _data.records || [] |
| 202 | 225 | const totalCount = _data.totalCount || _data.count || 0 |
| 203 | 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 | 227 | records = records.map(it => ({ |
| 209 | - ...it, | |
| 210 | - statusName: statusTextMap[String(it.status)] || '' | |
| 228 | + ...it | |
| 211 | 229 | })) |
| 212 | 230 | return { records, totalCount, hasNext } |
| 213 | 231 | }).catch(() => { |
| ... | ... | @@ -218,6 +236,9 @@ export default { |
| 218 | 236 | filterStatus(status) { |
| 219 | 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 | 242 | onCardClick(item) { |
| 222 | 243 | const id = (item && (item.id || item.code)) || '' |
| 223 | 244 | if (!id) return |
| ... | ... | @@ -383,6 +404,41 @@ export default { |
| 383 | 404 | &:last-child { |
| 384 | 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 | ... | ... |