Commit 6cd09a6ac9c94b7576801239f9436019535feced

Authored by gesilong
1 parent bd9b16de

commit:化验送样单联调提交

@@ -5,6 +5,16 @@ import { ContentTypeEnum } from '@/utils/httpEnum' @@ -5,6 +5,16 @@ import { ContentTypeEnum } from '@/utils/httpEnum'
5 const baseUrl = '/procurement/assay/apply' 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 * params: pageIndex, pageSize, weighingTicketCode, productName, 19 * params: pageIndex, pageSize, weighingTicketCode, productName,
10 * planCode, approvalStatus, createBy, deleted(boolean) 20 * planCode, approvalStatus, createBy, deleted(boolean)
@@ -2,6 +2,19 @@ @@ -2,6 +2,19 @@
2 <view class="page"> 2 <view class="page">
3 <scroll-view class="scroll" scroll-y> 3 <scroll-view class="scroll" scroll-y>
4 <uni-list> 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 <uni-list-item class="select-item" :class="form.weighingTicketCode ? 'is-filled' : 'is-empty'" clickable 19 <uni-list-item class="select-item" :class="form.weighingTicketCode ? 'is-filled' : 'is-empty'" clickable
7 @click="openTicketSheet" :rightText="form.weighingTicketCode || '请选择码单'" showArrow> 20 @click="openTicketSheet" :rightText="form.weighingTicketCode || '请选择码单'" showArrow>
@@ -67,6 +80,7 @@ @@ -67,6 +80,7 @@
67 <script> 80 <script>
68 import RelateSelectSheet from '@/components/relate-select/index.vue' 81 import RelateSelectSheet from '@/components/relate-select/index.vue'
69 import { 82 import {
  83 + assayApplyGenerateCodeApi,
70 assayApplyTicketPageApi, 84 assayApplyTicketPageApi,
71 assayApplyTicketDataApi, 85 assayApplyTicketDataApi,
72 assayApplyBreedOptionsApi, 86 assayApplyBreedOptionsApi,
@@ -80,6 +94,7 @@ export default { @@ -80,6 +94,7 @@ export default {
80 data() { 94 data() {
81 return { 95 return {
82 form: { 96 form: {
  97 + code: '',
83 weighingTicketId: '', 98 weighingTicketId: '',
84 weighingTicketCode: '', 99 weighingTicketCode: '',
85 procurementPlanId: '', 100 procurementPlanId: '',
@@ -118,6 +133,7 @@ export default { @@ -118,6 +133,7 @@ export default {
118 created() { 133 created() {
119 this.ticketSheet.fetchFn = this.fetchTickets.bind(this) 134 this.ticketSheet.fetchFn = this.fetchTickets.bind(this)
120 this.loadDicData() 135 this.loadDicData()
  136 + this.onGenerateCode()
121 }, 137 },
122 methods: { 138 methods: {
123 async loadDicData() { 139 async loadDicData() {
@@ -128,6 +144,13 @@ export default { @@ -128,6 +144,13 @@ export default {
128 this.dicOptions.DEPARTMENT = [] 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 fetchTickets({ pageIndex, pageSize, extra }) { 155 fetchTickets({ pageIndex, pageSize, extra }) {
133 const keyword = (extra && extra.keyword) || '' 156 const keyword = (extra && extra.keyword) || ''
@@ -226,6 +249,7 @@ export default { @@ -226,6 +249,7 @@ export default {
226 }, 249 },
227 validate() { 250 validate() {
228 const f = this.form 251 const f = this.form
  252 + if (!f.code) return this.tip('请生成送样编号')
229 if (!f.weighingTicketId) return this.tip('请选择码单编号') 253 if (!f.weighingTicketId) return this.tip('请选择码单编号')
230 if (!f.procurementPlanId) return this.tip('请选择计划编号') 254 if (!f.procurementPlanId) return this.tip('请选择计划编号')
231 if (!f.productId) return this.tip('请选择品种') 255 if (!f.productId) return this.tip('请选择品种')
@@ -244,6 +268,7 @@ export default { @@ -244,6 +268,7 @@ export default {
244 if (!(confirmRes && confirmRes.confirm)) return 268 if (!(confirmRes && confirmRes.confirm)) return
245 uni.showLoading({ title: '提交中...', mask: true }) 269 uni.showLoading({ title: '提交中...', mask: true })
246 assayApplyCreateApi({ 270 assayApplyCreateApi({
  271 + code: this.form.code,
247 weighingTicketId: this.form.weighingTicketId, 272 weighingTicketId: this.form.weighingTicketId,
248 procurementPlanId: this.form.procurementPlanId, 273 procurementPlanId: this.form.procurementPlanId,
249 productId: this.form.productId, 274 productId: this.form.productId,
@@ -365,10 +390,40 @@ export default { @@ -365,10 +390,40 @@ export default {
365 color: rgba(0, 0, 0, 0.9) !important; 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 .picker-value { 427 .picker-value {
373 font-size: 32rpx; 428 font-size: 32rpx;
374 color: rgba(0, 0, 0, 0.9); 429 color: rgba(0, 0, 0, 0.9);
@@ -4,7 +4,8 @@ @@ -4,7 +4,8 @@
4 <view class="detail-page"> 4 <view class="detail-page">
5 <!-- 基础信息 --> 5 <!-- 基础信息 -->
6 <view class="section"> 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 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(form.planCode) }}</text></view> 9 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(form.planCode) }}</text></view>
9 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view> 10 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view>
10 <view class="row"><text class="label">科室</text><text class="value">{{ departmentName }}</text></view> 11 <view class="row"><text class="label">科室</text><text class="value">{{ departmentName }}</text></view>
@@ -2,6 +2,16 @@ @@ -2,6 +2,16 @@
2 <view class="page"> 2 <view class="page">
3 <scroll-view class="scroll" scroll-y> 3 <scroll-view class="scroll" scroll-y>
4 <uni-list> 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 <uni-list-item class="select-item" :class="form.weighingTicketCode ? 'is-filled' : 'is-empty'" clickable 16 <uni-list-item class="select-item" :class="form.weighingTicketCode ? 'is-filled' : 'is-empty'" clickable
7 @click="openTicketSheet" :rightText="form.weighingTicketCode || '请选择码单'" showArrow> 17 @click="openTicketSheet" :rightText="form.weighingTicketCode || '请选择码单'" showArrow>
@@ -82,6 +92,7 @@ export default { @@ -82,6 +92,7 @@ export default {
82 return { 92 return {
83 id: '', 93 id: '',
84 form: { 94 form: {
  95 + code: '',
85 weighingTicketId: '', 96 weighingTicketId: '',
86 weighingTicketCode: '', 97 weighingTicketCode: '',
87 procurementPlanId: '', 98 procurementPlanId: '',
@@ -144,6 +155,7 @@ export default { @@ -144,6 +155,7 @@ export default {
144 .then(res => { 155 .then(res => {
145 const data = res && res.data ? res.data : {} 156 const data = res && res.data ? res.data : {}
146 this.form = { 157 this.form = {
  158 + code: data.code || '',
147 weighingTicketId: data.weighingTicketId || '', 159 weighingTicketId: data.weighingTicketId || '',
148 weighingTicketCode: data.weighingTicketCode || '', 160 weighingTicketCode: data.weighingTicketCode || '',
149 procurementPlanId: data.procurementPlanId || '', 161 procurementPlanId: data.procurementPlanId || '',
@@ -310,6 +322,7 @@ export default { @@ -310,6 +322,7 @@ export default {
310 uni.showLoading({ title: '提交中...', mask: true }) 322 uni.showLoading({ title: '提交中...', mask: true })
311 assayApplyUpdateApi({ 323 assayApplyUpdateApi({
312 id: this.id, 324 id: this.id,
  325 + code: this.form.code,
313 weighingTicketId: this.form.weighingTicketId, 326 weighingTicketId: this.form.weighingTicketId,
314 procurementPlanId: this.form.procurementPlanId, 327 procurementPlanId: this.form.procurementPlanId,
315 productId: this.form.productId, 328 productId: this.form.productId,
@@ -438,6 +451,20 @@ export default { @@ -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 .picker-value { 468 .picker-value {
442 font-size: 32rpx; 469 font-size: 32rpx;
443 color: rgba(0, 0, 0, 0.9); 470 color: rgba(0, 0, 0, 0.9);
@@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
3 <scroll-view class="scroll" scroll-y> 3 <scroll-view class="scroll" scroll-y>
4 <!-- 基础信息 --> 4 <!-- 基础信息 -->
5 <view class="section"> 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 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(form.planCode) }}</text></view> 8 <view class="row"><text class="label">计划编号</text><text class="value">{{ safeText(form.planCode) }}</text></view>
8 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view> 9 <view class="row"><text class="label">品种</text><text class="value">{{ safeText(form.productName) }}</text></view>
9 <view class="row"><text class="label">科室</text><text class="value">{{ departmentName }}</text></view> 10 <view class="row"><text class="label">科室</text><text class="value">{{ departmentName }}</text></view>