Commit 0aa83bbb0858bc59e061c57157692b48c0f72ca7

Authored by gesilong
1 parent 35470045

commit:原料报告单是否继续审核

... ... @@ -8,7 +8,7 @@
8 8 </view>
9 9 <view class="body">
10 10 <view v-if="tab === 'base'">
11   - <component :is="componentName" :id="auditCtx.businessId" ref="basicRef" />
  11 + <component :is="componentName" :id="auditCtx.businessId" :node-code="nodeCode" ref="basicRef" />
12 12 </view>
13 13 <view v-else>
14 14 <FlowTimeline :nodeList="nodeList" :isEnd="isEnd" />
... ... @@ -144,6 +144,8 @@ export default {
144 144 data() {
145 145 return {
146 146 tab: 'base',
  147 + // 当前审核节点编码(flow/instance/getByBusinessId 返回,透传给业务审批组件自行处理)
  148 + nodeCode: '',
147 149 auditCtx: {
148 150 taskId: '',
149 151 instanceId: '',
... ... @@ -256,6 +258,8 @@ export default {
256 258 // 2.在映射的地方,如果审核和审批详情不一样 就映射成两一个组件
257 259 const _data = res && res.data ? res.data : {};
258 260 const _ext = JSON.parse(_data.ext || '{}');
  261 + // 审核节点编码(如 assay_report_yfcckzg 时需填写是否继续审批)
  262 + this.nodeCode = _data.nodeCode || ''
259 263 this.auditCtx = {
260 264 taskId: _data.taskId || '',
261 265 instanceId: _data.id || '',
... ...
... ... @@ -36,6 +36,21 @@
36 36 </view>
37 37 </view>
38 38 </view>
  39 +
  40 + <!-- 是否继续审批(assay_report_yfcckzg 节点必填) -->
  41 + <view v-if="showContinueApproval" class="section">
  42 + <view class="field-row">
  43 + <view class="field-label"><text class="required">*</text><text>是否继续审批</text></view>
  44 + <uni-data-checkbox
  45 + mode="tag"
  46 + :multiple="false"
  47 + :value-field="'value'"
  48 + :text-field="'text'"
  49 + v-model="continueApproval"
  50 + :localdata="continueApprovalOptions"
  51 + />
  52 + </view>
  53 + </view>
39 54 </scroll-view>
40 55 </view>
41 56 </template>
... ... @@ -47,12 +62,22 @@ import { assayReportDetailApi } from '@/api/procure-manage/assayReport.js'
47 62
48 63 export default {
49 64 name: 'MaterialTestViewer',
50   - props: { id: { type: [String, Number], default: '' } },
  65 + props: {
  66 + id: { type: [String, Number], default: '' },
  67 + // 当前审核节点编码(flow/audit 透传,flow/instance/getByBusinessId 返回)
  68 + nodeCode: { type: String, default: '' }
  69 + },
51 70 data() {
52 71 return {
53 72 form: {},
54 73 lines: [],
55 74 componentLabels: COMPONENT_LABELS,
  75 + // 是否继续审批(assay_report_yfcckzg 节点必填)
  76 + continueApproval: undefined,
  77 + continueApprovalOptions: [
  78 + { value: true, text: '是' },
  79 + { value: false, text: '否' }
  80 + ],
56 81 dicOptions: {
57 82 AUDIT_STATUS: [],
58 83 FLOW_NODE: []
... ... @@ -60,6 +85,10 @@ export default {
60 85 }
61 86 },
62 87 computed: {
  88 + // assay_report_yfcckzg 节点需填写 是否继续审批
  89 + showContinueApproval() {
  90 + return this.nodeCode === 'assay_report_gyglkzg2'
  91 + },
63 92 componentKeys() {
64 93 return getComponentKeys(this.form.workshopName)
65 94 },
... ... @@ -117,10 +146,19 @@ export default {
117 146 },
118 147 // 供审批页通过时取业务表单数据(variables,对齐 PC 端 viewer.vue getFormData)
119 148 getFormValues() {
120   - return Object.assign({}, this.form)
  149 + const vals = Object.assign({}, this.form)
  150 + // assay_report_yfcckzg 节点:审批意见 是否继续审批 随 variables 提交
  151 + if (this.showContinueApproval) {
  152 + vals.continueApproval = this.continueApproval
  153 + }
  154 + return vals
121 155 },
122   - // 审批表单只读,无需校验
  156 + // 审批表单校验:assay_report_yfcckzg 节点 是否继续审批 必填
123 157 checkForm() {
  158 + if (this.showContinueApproval && this.continueApproval !== true && this.continueApproval !== false) {
  159 + uni.showToast({ title: '请选择是否继续审批', icon: 'none' })
  160 + return false
  161 + }
124 162 return true
125 163 },
126 164 safeText(v) {
... ... @@ -183,6 +221,28 @@ export default {
183 221 word-break: break-all;
184 222 }
185 223 }
  224 +
  225 +.field-row {
  226 + display: flex;
  227 + align-items: center;
  228 + justify-content: space-between;
  229 +
  230 + .field-label {
  231 + flex: none;
  232 + font-size: 32rpx;
  233 + color: rgba(0, 0, 0, 0.9);
  234 + position: relative;
  235 + padding-left: 16rpx;
  236 +
  237 + .required {
  238 + color: red;
  239 + position: absolute;
  240 + top: 50%;
  241 + transform: translateY(-50%);
  242 + left: 0;
  243 + }
  244 + }
  245 +}
186 246 .sub-table {
187 247 background: #fff;
188 248 margin-bottom: 20rpx;
... ...