Showing
5 changed files
with
96 additions
and
2 deletions
| ... | ... | @@ -5,6 +5,16 @@ import { ContentTypeEnum } from '@/utils/httpEnum' |
| 5 | 5 | const baseUrl = '/procurement/assay/apply' |
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | + * 生成送样单编号(直接返回编号字符串) | |
| 9 | + */ | |
| 10 | +export function assayApplyGenerateCodeApi() { | |
| 11 | + return request({ | |
| 12 | + url: baseUrl + '/generateCode', | |
| 13 | + method: 'get' | |
| 14 | + }) | |
| 15 | +} | |
| 16 | + | |
| 17 | +/** | |
| 8 | 18 | * 分页查询化验送样单列表 |
| 9 | 19 | * params: pageIndex, pageSize, weighingTicketCode, productName, |
| 10 | 20 | * planCode, approvalStatus, createBy, deleted(boolean) | ... | ... |
| ... | ... | @@ -2,6 +2,19 @@ |
| 2 | 2 | <view class="page"> |
| 3 | 3 | <scroll-view class="scroll" scroll-y> |
| 4 | 4 | <uni-list> |
| 5 | + <!-- 送样编号 --> | |
| 6 | + <uni-list-item class="select-item" :class="form.code ? 'is-filled' : 'is-empty'"> | |
| 7 | + <template v-slot:body> | |
| 8 | + <view class="item-title"><text class="required">*</text><text>送样编号</text></view> | |
| 9 | + </template> | |
| 10 | + <template v-slot:footer> | |
| 11 | + <view class="serial-number-row"> | |
| 12 | + <text class="readonly-text value-code">{{ form.code || '-' }}</text> | |
| 13 | + <button class="generate-btn" @click="onGenerateCode">点此生成</button> | |
| 14 | + </view> | |
| 15 | + </template> | |
| 16 | + </uni-list-item> | |
| 17 | + | |
| 5 | 18 | <!-- 码单编号(弹窗选择) --> |
| 6 | 19 | <uni-list-item class="select-item" :class="form.weighingTicketCode ? 'is-filled' : 'is-empty'" clickable |
| 7 | 20 | @click="openTicketSheet" :rightText="form.weighingTicketCode || '请选择码单'" showArrow> |
| ... | ... | @@ -67,6 +80,7 @@ |
| 67 | 80 | <script> |
| 68 | 81 | import RelateSelectSheet from '@/components/relate-select/index.vue' |
| 69 | 82 | import { |
| 83 | + assayApplyGenerateCodeApi, | |
| 70 | 84 | assayApplyTicketPageApi, |
| 71 | 85 | assayApplyTicketDataApi, |
| 72 | 86 | assayApplyBreedOptionsApi, |
| ... | ... | @@ -80,6 +94,7 @@ export default { |
| 80 | 94 | data() { |
| 81 | 95 | return { |
| 82 | 96 | form: { |
| 97 | + code: '', | |
| 83 | 98 | weighingTicketId: '', |
| 84 | 99 | weighingTicketCode: '', |
| 85 | 100 | procurementPlanId: '', |
| ... | ... | @@ -118,6 +133,7 @@ export default { |
| 118 | 133 | created() { |
| 119 | 134 | this.ticketSheet.fetchFn = this.fetchTickets.bind(this) |
| 120 | 135 | this.loadDicData() |
| 136 | + this.onGenerateCode() | |
| 121 | 137 | }, |
| 122 | 138 | methods: { |
| 123 | 139 | async loadDicData() { |
| ... | ... | @@ -128,6 +144,13 @@ export default { |
| 128 | 144 | this.dicOptions.DEPARTMENT = [] |
| 129 | 145 | } |
| 130 | 146 | }, |
| 147 | + onGenerateCode() { | |
| 148 | + assayApplyGenerateCodeApi() | |
| 149 | + .then(res => { | |
| 150 | + this.form.code = (res && res.data) ? res.data : '' | |
| 151 | + }) | |
| 152 | + .catch(() => {}) | |
| 153 | + }, | |
| 131 | 154 | // 码单选择弹窗数据源(可选过磅码单分页) |
| 132 | 155 | fetchTickets({ pageIndex, pageSize, extra }) { |
| 133 | 156 | const keyword = (extra && extra.keyword) || '' |
| ... | ... | @@ -226,6 +249,7 @@ export default { |
| 226 | 249 | }, |
| 227 | 250 | validate() { |
| 228 | 251 | const f = this.form |
| 252 | + if (!f.code) return this.tip('请生成送样编号') | |
| 229 | 253 | if (!f.weighingTicketId) return this.tip('请选择码单编号') |
| 230 | 254 | if (!f.procurementPlanId) return this.tip('请选择计划编号') |
| 231 | 255 | if (!f.productId) return this.tip('请选择品种') |
| ... | ... | @@ -244,6 +268,7 @@ export default { |
| 244 | 268 | if (!(confirmRes && confirmRes.confirm)) return |
| 245 | 269 | uni.showLoading({ title: '提交中...', mask: true }) |
| 246 | 270 | assayApplyCreateApi({ |
| 271 | + code: this.form.code, | |
| 247 | 272 | weighingTicketId: this.form.weighingTicketId, |
| 248 | 273 | procurementPlanId: this.form.procurementPlanId, |
| 249 | 274 | productId: this.form.productId, |
| ... | ... | @@ -365,10 +390,40 @@ export default { |
| 365 | 390 | color: rgba(0, 0, 0, 0.9) !important; |
| 366 | 391 | } |
| 367 | 392 | } |
| 393 | + | |
| 394 | + .serial-number-row { | |
| 395 | + display: flex; | |
| 396 | + align-items: center; | |
| 397 | + | |
| 398 | + .generate-btn { | |
| 399 | + margin-left: 24rpx; | |
| 400 | + height: 48rpx; | |
| 401 | + line-height: 48rpx; | |
| 402 | + padding: 0 24rpx; | |
| 403 | + font-size: 24rpx; | |
| 404 | + border-radius: 8rpx; | |
| 405 | + background: $theme-primary; | |
| 406 | + color: #fff; | |
| 407 | + } | |
| 408 | + } | |
| 368 | 409 | } |
| 369 | 410 | } |
| 370 | 411 | } |
| 371 | 412 | |
| 413 | +.readonly-text { | |
| 414 | + color: rgba(0, 0, 0, 0.9); | |
| 415 | + font-size: 32rpx; | |
| 416 | + line-height: 48rpx; | |
| 417 | + text-align: right; | |
| 418 | + white-space: pre-wrap; | |
| 419 | + word-break: break-all; | |
| 420 | +} | |
| 421 | + | |
| 422 | +.value-code { | |
| 423 | + width: 260rpx; | |
| 424 | + text-align: left; | |
| 425 | +} | |
| 426 | + | |
| 372 | 427 | .picker-value { |
| 373 | 428 | font-size: 32rpx; |
| 374 | 429 | color: rgba(0, 0, 0, 0.9); | ... | ... |
| ... | ... | @@ -4,7 +4,8 @@ |
| 4 | 4 | <view class="detail-page"> |
| 5 | 5 | <!-- 基础信息 --> |
| 6 | 6 | <view class="section"> |
| 7 | - <text class="row company">{{ safeText(form.weighingTicketCode) }}</text> | |
| 7 | + <text class="row company">{{ safeText(form.code) }}</text> | |
| 8 | + <view class="row"><text class="label">码单编号</text><text class="value">{{ safeText(form.weighingTicketCode) }}</text></view> | |
| 8 | 9 | <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(form.planCode) }}</text></view> |
| 9 | 10 | <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view> |
| 10 | 11 | <view class="row"><text class="label">科室</text><text class="value">{{ departmentName }}</text></view> | ... | ... |
| ... | ... | @@ -2,6 +2,16 @@ |
| 2 | 2 | <view class="page"> |
| 3 | 3 | <scroll-view class="scroll" scroll-y> |
| 4 | 4 | <uni-list> |
| 5 | + <!-- 送样编号(只读) --> | |
| 6 | + <uni-list-item class="select-item" :class="form.code ? 'is-filled' : 'is-empty'"> | |
| 7 | + <template v-slot:body> | |
| 8 | + <view class="item-title"><text class="required">*</text><text>送样编号</text></view> | |
| 9 | + </template> | |
| 10 | + <template v-slot:footer> | |
| 11 | + <text class="readonly-text value-code">{{ form.code || '-' }}</text> | |
| 12 | + </template> | |
| 13 | + </uni-list-item> | |
| 14 | + | |
| 5 | 15 | <!-- 码单编号(弹窗选择) --> |
| 6 | 16 | <uni-list-item class="select-item" :class="form.weighingTicketCode ? 'is-filled' : 'is-empty'" clickable |
| 7 | 17 | @click="openTicketSheet" :rightText="form.weighingTicketCode || '请选择码单'" showArrow> |
| ... | ... | @@ -82,6 +92,7 @@ export default { |
| 82 | 92 | return { |
| 83 | 93 | id: '', |
| 84 | 94 | form: { |
| 95 | + code: '', | |
| 85 | 96 | weighingTicketId: '', |
| 86 | 97 | weighingTicketCode: '', |
| 87 | 98 | procurementPlanId: '', |
| ... | ... | @@ -144,6 +155,7 @@ export default { |
| 144 | 155 | .then(res => { |
| 145 | 156 | const data = res && res.data ? res.data : {} |
| 146 | 157 | this.form = { |
| 158 | + code: data.code || '', | |
| 147 | 159 | weighingTicketId: data.weighingTicketId || '', |
| 148 | 160 | weighingTicketCode: data.weighingTicketCode || '', |
| 149 | 161 | procurementPlanId: data.procurementPlanId || '', |
| ... | ... | @@ -310,6 +322,7 @@ export default { |
| 310 | 322 | uni.showLoading({ title: '提交中...', mask: true }) |
| 311 | 323 | assayApplyUpdateApi({ |
| 312 | 324 | id: this.id, |
| 325 | + code: this.form.code, | |
| 313 | 326 | weighingTicketId: this.form.weighingTicketId, |
| 314 | 327 | procurementPlanId: this.form.procurementPlanId, |
| 315 | 328 | productId: this.form.productId, |
| ... | ... | @@ -438,6 +451,20 @@ export default { |
| 438 | 451 | } |
| 439 | 452 | } |
| 440 | 453 | |
| 454 | +.readonly-text { | |
| 455 | + color: rgba(0, 0, 0, 0.9); | |
| 456 | + font-size: 32rpx; | |
| 457 | + line-height: 48rpx; | |
| 458 | + text-align: right; | |
| 459 | + white-space: pre-wrap; | |
| 460 | + word-break: break-all; | |
| 461 | +} | |
| 462 | + | |
| 463 | +.value-code { | |
| 464 | + width: 260rpx; | |
| 465 | + text-align: left; | |
| 466 | +} | |
| 467 | + | |
| 441 | 468 | .picker-value { |
| 442 | 469 | font-size: 32rpx; |
| 443 | 470 | color: rgba(0, 0, 0, 0.9); | ... | ... |
| ... | ... | @@ -3,7 +3,8 @@ |
| 3 | 3 | <scroll-view class="scroll" scroll-y> |
| 4 | 4 | <!-- 基础信息 --> |
| 5 | 5 | <view class="section"> |
| 6 | - <text class="row company">{{ safeText(form.weighingTicketCode) }}</text> | |
| 6 | + <text class="row company">{{ safeText(form.code) }}</text> | |
| 7 | + <view class="row"><text class="label">码单编号</text><text class="value">{{ safeText(form.weighingTicketCode) }}</text></view> | |
| 7 | 8 | <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(form.planCode) }}</text></view> |
| 8 | 9 | <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view> |
| 9 | 10 | <view class="row"><text class="label">科室</text><text class="value">{{ departmentName }}</text></view> | ... | ... |