3 Commits

9 changed files with 145 additions and 66 deletions
Unified View
  1. +3
    -0
      src/components/Template/BaseInfoFormPackage.vue
  2. +71
    -56
      src/components/Template/CustomTable.vue
  3. +9
    -3
      src/components/Template/HandleFormItem.vue
  4. +1
    -1
      src/components/Template/StepComponents/ZLSubPackage.vue
  5. +39
    -4
      src/components/Template/StepComponents/ry/zlfz.vue
  6. +2
    -0
      src/components/Template/StepFormPackage.vue
  7. +16
    -2
      src/components/Template/mixins/formPackageMixins.js
  8. +1
    -0
      src/components/Template/mixins/stepMixins.js
  9. +3
    -0
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue

+ 3
- 0
src/components/Template/BaseInfoFormPackage.vue View File

@ -127,6 +127,7 @@
:field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" sourceFrom="baseInfoFormPackage" :error="errors[key]" :type="sItem.type" sourceFrom="baseInfoFormPackage" :error="errors[key]"
@update:error="errors[key] = false" @update:error="errors[key] = false"
:orange-bg="regentIsExpired(key)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, key, sItem)" @onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, key, sItem)"
:item="sItem" :value="formFields[key]" /> :item="sItem" :value="formFields[key]" />
</div> </div>
@ -274,6 +275,7 @@
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)" @beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)" @onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" :error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:orange-bg="regentIsExpired(sItem.subKey)"
:value="formFields[sItem.subKey]" /> :value="formFields[sItem.subKey]" />
</template> </template>
<div v-if="isShowSub(sItem,'thirdType')"> <div v-if="isShowSub(sItem,'thirdType')">
@ -309,6 +311,7 @@
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, key)" @beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, key)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, key, sItem)" @onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, key, sItem)"
:field-key="prefixKey + '_' + key" :type="sItem.type" :error="errors[key]" :field-key="prefixKey + '_' + key" :type="sItem.type" :error="errors[key]"
:orange-bg="regentIsExpired(key)"
@update:error="errors[key] = false" :item="getRegentItem(sItem)" @update:error="errors[key] = false" :item="getRegentItem(sItem)"
:value="formFields[key]" /> :value="formFields[key]" />
<span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span> <span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span>

+ 71
- 56
src/components/Template/CustomTable.vue View File

@ -12,13 +12,13 @@
@change="handleCheckAllChange"></el-checkbox> @change="handleCheckAllChange"></el-checkbox>
</div> </div>
</div> </div>
<div v-for="(col, colIndex) in columns" :key="colIndex" class="custom-table-cell header-cell no-break"
:style="getCellWidth(col)">
<div v-for="(col, colIndex) in columns" :key="colIndex"
class="custom-table-cell header-cell no-break" :style="getCellWidth(col)">
<div class="header-cell-content" v-if="col.headerColumns && col.headerColumns.length > 0"> <div class="header-cell-content" v-if="col.headerColumns && col.headerColumns.length > 0">
<div class="header-columns-grid" <div class="header-columns-grid"
:style="{ 'grid-template-columns': `repeat(${col.span || 2}, 1fr)` }"> :style="{ 'grid-template-columns': `repeat(${col.span || 2}, 1fr)` }">
<div v-for="(headerCol, headerIndex) in col.headerColumns" :key="headerIndex" <div v-for="(headerCol, headerIndex) in col.headerColumns" :key="headerIndex"
class="header-column-item" >
class="header-column-item">
<template v-if="headerCol.type === 'span'"> <template v-if="headerCol.type === 'span'">
<div class="span-content">{{ $t(headerCol.label) }}</div> <div class="span-content">{{ $t(headerCol.label) }}</div>
</template> </template>
@ -31,6 +31,7 @@
:value="headerFields[`${colIndex}_${headerIndex}`]" :value="headerFields[`${colIndex}_${headerIndex}`]"
:error="hasHeaderError(colIndex, headerIndex, headerCol.key)" :error="hasHeaderError(colIndex, headerIndex, headerCol.key)"
@update:error="onHeaderColumnErrorUpdate(colIndex, headerIndex, headerCol.key, $event)" @update:error="onHeaderColumnErrorUpdate(colIndex, headerIndex, headerCol.key, $event)"
:orange-bg="regentIsExpired(headerCol.key,rowIndex)"
@onRegentSubmit="(data, inputValue) => onHeaderRegentSubmit(data, inputValue, colIndex, headerIndex)" /> @onRegentSubmit="(data, inputValue) => onHeaderRegentSubmit(data, inputValue, colIndex, headerIndex)" />
</template> </template>
<template <template
@ -83,8 +84,8 @@
<el-checkbox v-model="row._checked" @change="handleCheckChange(row, $event)"></el-checkbox> <el-checkbox v-model="row._checked" @change="handleCheckChange(row, $event)"></el-checkbox>
</div> </div>
</div> </div>
<div v-for="(col, colIndex) in columns" :key="colIndex" class="custom-table-cell body-cell no-break"
:style="getCellWidth(col)">
<div v-for="(col, colIndex) in columns" :key="colIndex"
class="custom-table-cell body-cell no-break" :style="getCellWidth(col)">
<div class="inner-table-cell"> <div class="inner-table-cell">
<div class="flex1" :class="{ 'item-center': !isBorder && col.label }"> <div class="flex1" :class="{ 'item-center': !isBorder && col.label }">
<div v-if="!isBorder && col.label" class="mr-5"> <div v-if="!isBorder && col.label" class="mr-5">
@ -97,8 +98,7 @@
:fieldItemLabel="fieldItemLabel" :type="col.bodyType" :fieldItemLabel="fieldItemLabel" :type="col.bodyType"
@blur="onBlur(rowIndex, col.prop, $event)" @copy="onCopy(rowIndex, col)" @blur="onBlur(rowIndex, col.prop, $event)" @copy="onCopy(rowIndex, col)"
class="body-input" :item="getBodyItem(col, rowIndex)" class="body-input" :item="getBodyItem(col, rowIndex)"
v-model="row[col.prop]"
:ref = "col.prop+rowIndex"
v-model="row[col.prop]" :ref="col.prop + rowIndex"
@change="onBodyValueChange(rowIndex, colIndex, $event, row, col.bodyType)" @change="onBodyValueChange(rowIndex, colIndex, $event, row, col.bodyType)"
:error="hasError(rowIndex, colIndex, col.prop)" :error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
@ -107,13 +107,14 @@
</div> </div>
</template> </template>
<div v-else-if = "col.bodyType === 'checkboxTree'">
<HandleFormItem
:field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + col.prop+ rowIndex"
type="checkboxTree" :item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
@change="(e) => onBodyValueChange(rowIndex, colIndex, e, row, col.bodyType)"
:error="hasError(rowIndex, colIndex, col.prop)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
<div v-else-if="col.bodyType === 'checkboxTree'">
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + col.prop + rowIndex" type="checkboxTree"
:item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
@change="(e) => onBodyValueChange(rowIndex, colIndex, e, row, col.bodyType)"
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div> </div>
<div v-else-if="col.bodyType === 'operableInput'" class="flex flex1"> <div v-else-if="col.bodyType === 'operableInput'" class="flex flex1">
<div class="flex1 grid-container"> <div class="flex1 grid-container">
@ -125,9 +126,9 @@
:fieldItemLabel="fieldItemLabel" type="input" :fieldItemLabel="fieldItemLabel" type="input"
@blur="onOperableInputBlur(opItem, $event)" class="body-input" @blur="onOperableInputBlur(opItem, $event)" class="body-input"
:item="getBodyItem(col, rowIndex)" :value="opItem.value" :item="getBodyItem(col, rowIndex)" :value="opItem.value"
:error="hasError(rowIndex, colIndex, rowIndex+col.prop+itemIndex)"
@update:error="onErrorUpdate(rowIndex, colIndex, rowIndex+col.prop+itemIndex, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, rowIndex+col.prop+itemIndex)" />
:error="hasError(rowIndex, colIndex, rowIndex + col.prop + itemIndex)"
@update:error="onErrorUpdate(rowIndex, colIndex, rowIndex + col.prop + itemIndex, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, rowIndex + col.prop + itemIndex)" />
<el-popconfirm confirm-button-text='确认' cancel-button-text='取消' <el-popconfirm confirm-button-text='确认' cancel-button-text='取消'
icon="el-icon-info" icon-color="red" title="确认删除当前输入框?" icon="el-icon-info" icon-color="red" title="确认删除当前输入框?"
@confirm="removeOperableInput(rowIndex, colIndex, col.prop, itemIndex)"> @confirm="removeOperableInput(rowIndex, colIndex, col.prop, itemIndex)">
@ -136,7 +137,8 @@
</el-popconfirm> </el-popconfirm>
</div> </div>
</div> </div>
<i class="el-icon-circle-plus add-icon" v-if="templateFillType === 'actFill' && !row.isComplete"
<i class="el-icon-circle-plus add-icon"
v-if="templateFillType === 'actFill' && !row.isComplete"
@click="addOperableInput(rowIndex, colIndex, col.prop)"></i> @click="addOperableInput(rowIndex, colIndex, col.prop)"></i>
</div> </div>
@ -158,7 +160,7 @@
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row, col.prop)" @onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row, col.prop)"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, col, row)" @beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, col, row)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
:orange-bg="regentIsExpired(col.prop,rowIndex)" />
</div> </div>
<template v-else-if="col.bodyType === 'span'"> <template v-else-if="col.bodyType === 'span'">
<div class="body-span"> <div class="body-span">
@ -201,7 +203,8 @@
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" />
</div> </div>
</div> </div>
<div class="m-l-5 flex" :class="{ 'flex1': (col.bodySubType !== 'button' && col.bodySubType !== 'span') }"
<div class="m-l-5 flex"
:class="{ 'flex1': (col.bodySubType !== 'button' && col.bodySubType !== 'span') }"
v-if="isShowBodySub(col, row)"> v-if="isShowBodySub(col, row)">
<template <template
v-if="col.bodySubType === 'inputNumber' || col.bodySubType === 'input' || col.bodySubType === 'select'"> v-if="col.bodySubType === 'inputNumber' || col.bodySubType === 'input' || col.bodySubType === 'select'">
@ -209,7 +212,6 @@
:fieldItemLabel="fieldItemLabel" :type="col.bodySubType" :fieldItemLabel="fieldItemLabel" :type="col.bodySubType"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)" @copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)"
v-model="row[col.bodySubKey]" v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex, $event, row, col.bodySubType)" @change="onBodySubValueChange(rowIndex, colIndex, $event, row, col.bodySubType)"
:error="hasError(rowIndex, colIndex, col.bodySubKey)" :error="hasError(rowIndex, colIndex, col.bodySubKey)"
@ -224,8 +226,8 @@
<template v-else-if="col.bodySubType === 'button'"> <template v-else-if="col.bodySubType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getBodyButtonItem(col, rowIndex)" <HandleFormItem class="ml-10" type="button" :item="getBodyButtonItem(col, rowIndex)"
:value="row[col.bodySubKey]" :value="row[col.bodySubKey]"
:fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
@clickButton="(e,val, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" />
:fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
@clickButton="(e, val, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" />
</template> </template>
<div class="flex flex1" v-else-if="isRegent(col, 'bodySubType')"> <div class="flex flex1" v-else-if="isRegent(col, 'bodySubType')">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id" <HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + row.id"
@ -236,13 +238,13 @@
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row, col.bodySubKey)" @onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row, col.bodySubKey)"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, col, row)" @beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, col, row)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
:orange-bg="regentIsExpired(col.bodySubKey,rowIndex)" />
</div> </div>
<template v-if="col.bodyThirdType === 'button'"> <template v-if="col.bodyThirdType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getBodyThirdButtonItem(col, rowIndex)"
:value="row[col.bodyThirdKey]"
:fieldKey="prefixKey + '_' + col.bodyThirdKey + '_' + row.id"
@clickButton="(e,val, data) => handleClickButton(e, data, col.bodyThirdKey, rowIndex, colIndex)" />
<HandleFormItem class="ml-10" type="button"
:item="getBodyThirdButtonItem(col, rowIndex)" :value="row[col.bodyThirdKey]"
:fieldKey="prefixKey + '_' + col.bodyThirdKey + '_' + row.id"
@clickButton="(e, val, data) => handleClickButton(e, data, col.bodyThirdKey, rowIndex, colIndex)" />
</template> </template>
</div> </div>
</div> </div>
@ -278,6 +280,7 @@ import { EventBus } from "@/utils/eventBus";
import { getuuid, justUpdateFilledFormData } from "@/utils/index.js"; import { getuuid, justUpdateFilledFormData } from "@/utils/index.js";
import { isRegent } from "@/utils/index.js"; import { isRegent } from "@/utils/index.js";
import { isValueEmpty } from '@/utils/index.js'; import { isValueEmpty } from '@/utils/index.js';
import moment from 'moment';
import _ from "lodash"; import _ from "lodash";
export default { export default {
@ -465,7 +468,7 @@ export default {
isValid = value && value.some(tag => tag.checked === true); isValid = value && value.some(tag => tag.checked === true);
} else if (this.templateFillType === "preFill") { } else if (this.templateFillType === "preFill") {
// preFilltagValue // preFilltagValue
isValid = value && value.every(tag => tag.tagValue && (tag.tagValue+'').trim() !== '');
isValid = value && value.every(tag => tag.tagValue && (tag.tagValue + '').trim() !== '');
} }
this.onErrorUpdate(rowIndex, colIndex, col.prop, !isValid); this.onErrorUpdate(rowIndex, colIndex, col.prop, !isValid);
this.$emit("onCheckboxTagChange", rowIndex, col, value) this.$emit("onCheckboxTagChange", rowIndex, col, value)
@ -505,7 +508,7 @@ export default {
}, },
// //
getOperationColumns() { getOperationColumns() {
return { columnsData: this.columns, headerSelectFields: this.headerSelectFields,fieldItemLabel: this.fieldItemLabel }
return { columnsData: this.columns, headerSelectFields: this.headerSelectFields, fieldItemLabel: this.fieldItemLabel }
}, },
// //
getOtherItem(sItem) { getOtherItem(sItem) {
@ -543,11 +546,23 @@ export default {
this.$emit("onHeaderRegentSubmit", { selectInfo: data, headerIndex, colIndex, headerFields: this.headerFields }) this.$emit("onHeaderRegentSubmit", { selectInfo: data, headerIndex, colIndex, headerFields: this.headerFields })
}, },
//
regentIsExpired(key,rowIndex) {
const item = this.localDataSource[rowIndex];
const { yxq, sxrq } = item[`selectInfo_${key}`] || {};
const rq = sxrq || yxq;
if (rq) {
const time = moment(yxq);
return time.isBefore(moment());
} else {
return false;
}
},
onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row, key) { onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row, key) {
// if (this.templateFillType !== 'actFill') { // if (this.templateFillType !== 'actFill') {
// return // return
// } // }
this.updateDataSourceByRowIndex(rowIndex, { [key]: inputValue })
this.updateDataSourceByRowIndex(rowIndex, { [key]: inputValue, [`selectInfo_${key}`]: data.selectInfo })
this.$emit("onRegentSubmit", { selectInfo: data, key, col, rowIndex, colIndex, rowData: row }) this.$emit("onRegentSubmit", { selectInfo: data, key, col, rowIndex, colIndex, rowData: row })
}, },
isShowAddRos() { isShowAddRos() {
@ -664,7 +679,7 @@ export default {
if (this.templateFillType === "actFill") { if (this.templateFillType === "actFill") {
// actFillcheckedtrue // actFillcheckedtrue
const hasChecked = mainValue && mainValue.some(tag => tag.checked === true); const hasChecked = mainValue && mainValue.some(tag => tag.checked === true);
if (!hasChecked && !col.bodyDisabled) {
if (!hasChecked) {
const errorItem = { const errorItem = {
rowIndex, rowIndex,
colIndex, colIndex,
@ -677,8 +692,8 @@ export default {
} }
} else if (this.templateFillType === "preFill") { } else if (this.templateFillType === "preFill") {
// preFilltagValue // preFilltagValue
const allTagValuesFilled = mainValue && mainValue.every(tag => tag.tagValue && (tag.tagValue+'').trim() !== '');
if (!allTagValuesFilled && !col.bodyDisabled) {
const allTagValuesFilled = mainValue && mainValue.every(tag => tag.tagValue && (tag.tagValue + '').trim() !== '');
if (!allTagValuesFilled) {
const errorItem = { const errorItem = {
rowIndex, rowIndex,
colIndex, colIndex,
@ -693,7 +708,7 @@ export default {
} else if (col.bodyType === "checkbox") { } else if (col.bodyType === "checkbox") {
// checkbox // checkbox
// checkboxactFill // checkboxactFill
if (!col.bodyDisabled && this.templateFillType === 'actFill' && !col.isNeedCheck) {
if (this.templateFillType === 'actFill' && !col.isNeedCheck) {
// checkboxtrue // checkboxtrue
// checkbox // checkbox
const hasChecked = Array.isArray(mainValue) ? mainValue.length > 0 : mainValue === true; const hasChecked = Array.isArray(mainValue) ? mainValue.length > 0 : mainValue === true;
@ -709,13 +724,13 @@ export default {
this.formErrors.push(errorItem); this.formErrors.push(errorItem);
} }
} }
} else if(col.bodyType === "operableInput"){
} else if (col.bodyType === "operableInput") {
mainValue.forEach((itemItem, itemIndex) => { mainValue.forEach((itemItem, itemIndex) => {
if (isValueEmpty(itemItem.value)) { if (isValueEmpty(itemItem.value)) {
const errorItem = { const errorItem = {
rowIndex, rowIndex,
colIndex, colIndex,
field: rowIndex+col.prop+itemIndex,
field: rowIndex + col.prop + itemIndex,
label: this.$t(col.label), label: this.$t(col.label),
error: `请填写${this.$t(col.label)}` error: `请填写${this.$t(col.label)}`
}; };
@ -724,8 +739,8 @@ export default {
} }
}) })
}else {
if (isValueEmpty(mainValue) && !col.bodyDisabled && col.bodyType !== 'span' && col.bodyType !== 'button') {
} else {
if (isValueEmpty(mainValue) && col.bodyType !== 'span' && col.bodyType !== 'button') {
const errorItem = { const errorItem = {
rowIndex, rowIndex,
colIndex, colIndex,
@ -737,7 +752,7 @@ export default {
this.formErrors.push(errorItem); this.formErrors.push(errorItem);
} }
// //
if (col.bodySubKey && !col.bodySubDisabled && col.bodySubFillType === this.templateFillType && col.bodySubType !== 'span' && col.bodySubType !== "button") {
if (col.bodySubKey && col.bodySubFillType === this.templateFillType && col.bodySubType !== 'span' && col.bodySubType !== "button") {
const subValue = row[col.bodySubKey]; const subValue = row[col.bodySubKey];
if (isValueEmpty(subValue)) { if (isValueEmpty(subValue)) {
const errorItem = { const errorItem = {
@ -939,20 +954,20 @@ export default {
// 使checkboxLabel // 使checkboxLabel
item.checkboxLabel = this.$t(col.checkboxLabel); item.checkboxLabel = this.$t(col.checkboxLabel);
} }
if (col.bodyType === "operableInput" ) {
if(currentItem.isComplete || this.templateFillType !== 'actFill'){
if (col.bodyType === "operableInput") {
if (currentItem.isComplete || this.templateFillType !== 'actFill') {
item.disabled = true; item.disabled = true;
}else{
} else {
item.disabled = false; item.disabled = false;
} }
} }
if(col.noBorder){
if (col.noBorder) {
item.noBorder = true; item.noBorder = true;
} }
if(col.bodyLayout){
if (col.bodyLayout) {
item.layout = col.bodyLayout; item.layout = col.bodyLayout;
} }
return item return item
}, },
getBodyButtonItem(col,) { getBodyButtonItem(col,) {
@ -1019,15 +1034,15 @@ export default {
this.checkCompareToOnDataLoad(); this.checkCompareToOnDataLoad();
}, },
// autoUpdateRecord // autoUpdateRecord
updateDataSourceByRowIndex(rowIndex, data,updateFieldsInfo={}) {
const {signData,updateFields = []} = updateFieldsInfo;
updateDataSourceByRowIndex(rowIndex, data, updateFieldsInfo = {}) {
const { signData, updateFields = [] } = updateFieldsInfo;
this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource)); this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource));
this.localDataSource[rowIndex] = { ...this.localDataSource[rowIndex], ...data }; this.localDataSource[rowIndex] = { ...this.localDataSource[rowIndex], ...data };
this.localDataSource = [...this.localDataSource]; this.localDataSource = [...this.localDataSource];
if(updateFields.length > 0){
updateFields.map((key)=>{
const ref = this.$refs[key+rowIndex];
if(ref){
if (updateFields.length > 0) {
updateFields.map((key) => {
const ref = this.$refs[key + rowIndex];
if (ref) {
ref[0].handleUpdateRecord(signData, { oldValue: this.oldLocalDataSource[rowIndex][key], inputValue: data[key] }); ref[0].handleUpdateRecord(signData, { oldValue: this.oldLocalDataSource[rowIndex][key], inputValue: data[key] });
} }
}) })
@ -1036,7 +1051,7 @@ export default {
this.checkCompareToOnDataLoad(); this.checkCompareToOnDataLoad();
// justUpdateFilledFormData(); // justUpdateFilledFormData();
}, },
pushDataSource(data=[]) {
pushDataSource(data = []) {
this.localDataSource.push(...data); this.localDataSource.push(...data);
this.localDataSource = [...this.localDataSource]; this.localDataSource = [...this.localDataSource];
this.checkCompareToOnDataLoad(); this.checkCompareToOnDataLoad();
@ -1084,7 +1099,7 @@ export default {
}, },
onAddRow() { onAddRow() {
if (this.$listeners && this.$listeners['onAddRow']) { if (this.$listeners && this.$listeners['onAddRow']) {
this.$emit('onAddRow',{dataSource:this.localDataSource});
this.$emit('onAddRow', { dataSource: this.localDataSource });
return; return;
} }
this.addRow({ this.addRow({
@ -1092,8 +1107,8 @@ export default {
actSolutionConcentrationPrecision: 3,//3 actSolutionConcentrationPrecision: 3,//3
targetDiluentVolumePrecision: 3,//3 targetDiluentVolumePrecision: 3,//3
targetStartSolutionVolumePrecision: 3,//3 targetStartSolutionVolumePrecision: 3,//3
id:getuuid(),
rowIndex:this.localDataSource.length,
id: getuuid(),
rowIndex: this.localDataSource.length,
}); });
justUpdateFilledFormData() justUpdateFilledFormData()
}, },

+ 9
- 3
src/components/Template/HandleFormItem.vue View File

@ -1249,7 +1249,7 @@ export default {
this.oldValue = recordData.oldValue; this.oldValue = recordData.oldValue;
this.inputValue = recordData.inputValue; this.inputValue = recordData.inputValue;
} }
let recordOldVlaue = this.oldValue, recordValue = this.inputValue, isModify = !!this.oldValue;
let recordOldVlaue = this.oldValue, recordValue = this.inputValue, isModify = !!this.oldValue,oldUrl = "",url="";
if (this.type === "checkboxTag") { if (this.type === "checkboxTag") {
// checkboxTagtagIndex // checkboxTagtagIndex
const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {}; const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {};
@ -1288,6 +1288,8 @@ export default {
const oldAttList = JSON.parse(recordOldVlaue || "[]"); const oldAttList = JSON.parse(recordOldVlaue || "[]");
recordValue = attList.map(item => item.name).join(";"); recordValue = attList.map(item => item.name).join(";");
recordOldVlaue = oldAttList.map(item => item.name).join(";"); recordOldVlaue = oldAttList.map(item => item.name).join(";");
oldUrl = oldAttList.map(item => item.url).join(";");
url = attList.map(item => item.url).join(";");
} }
const record = { const record = {
@ -1297,6 +1299,10 @@ export default {
title: !this.isUnSubmitted(finallyKey) ? "修改" : "提交", title: !this.isUnSubmitted(finallyKey) ? "修改" : "提交",
time: moment().format("YYYY-MM-DD HH:mm:ss"), time: moment().format("YYYY-MM-DD HH:mm:ss"),
} }
if(url){
record.url = url;
record.oldUrl = oldUrl;
}
if (data) { if (data) {
record.reason = data.remark record.reason = data.remark
} }
@ -1738,11 +1744,11 @@ export default {
.clickable, .clickable,
.el-date-editor, .el-date-editor,
.el-checkbox__inner { .el-checkbox__inner {
border-color: #ff5d5d;
border-color: #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important; box-shadow: 0 0 6px #ffc3c3 !important;
&:focus { &:focus {
border-color: #ff5d5d;
border-color: #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important; box-shadow: 0 0 6px #ffc3c3 !important;
} }

+ 1
- 1
src/components/Template/StepComponents/ZLSubPackage.vue View File

@ -260,7 +260,7 @@ export default {
}, },
onReset() { onReset() {
this.fzList.forEach((item, index) => { this.fzList.forEach((item, index) => {
item.num = "";
item.actnum = "";
// //
if (this.fzListErrors[index] !== undefined) { if (this.fzListErrors[index] !== undefined) {
this.$set(this.fzListErrors, index, false); this.$set(this.fzListErrors, index, false);

+ 39
- 4
src/components/Template/StepComponents/ry/zlfz.vue View File

@ -9,6 +9,9 @@
import StepFormPackage from '@/components/Template/StepFormPackage.vue'; import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js'; import stepMixins from '@/components/Template/mixins/stepMixins.js';
import { compareVolume } from '@/utils/volumeTools.js'; import { compareVolume } from '@/utils/volumeTools.js';
import {
sj_subpackage,
} from '@/api/business/sj/sj'
export default { export default {
mixins: [stepMixins], mixins: [stepMixins],
components: { components: {
@ -64,13 +67,16 @@ export default {
if (res) { if (res) {
const { zlfz } = res; const { zlfz } = res;
const gspInfo = res.selectInfo_gsp || {}; const gspInfo = res.selectInfo_gsp || {};
const { kc, kcdw } = gspInfo;
const { kc, kcdw, gg, ggdw, bh } = gspInfo;
const dw = zlfz.formData.dw; const dw = zlfz.formData.dw;
const errMsg = "分装后小份容量之和大于母液容量,是否确认分装?" const errMsg = "分装后小份容量之和大于母液容量,是否确认分装?"
const totalVolume = zlfz.fzList.reduce((acc, cur) => acc + Number(cur.actnum), 0); const totalVolume = zlfz.fzList.reduce((acc, cur) => acc + Number(cur.actnum), 0);
const compareResult = compareVolume(totalVolume, dw, kc, kcdw); const compareResult = compareVolume(totalVolume, dw, kc, kcdw);
const fzInfo = { const fzInfo = {
...zlfz.formData, ...zlfz.formData,
gg,
ggdw,
bh,
fzList: zlfz.fzList, fzList: zlfz.fzList,
}; };
if (compareResult > 0 || !kc) {// if (compareResult > 0 || !kc) {//
@ -96,10 +102,39 @@ export default {
} }
}, },
submitEmit(fzInfo) {
async submitEmit(fzInfo) {
this.$refs.stepFormPackageRef.updateFormData("fzInfo", fzInfo); this.$refs.stepFormPackageRef.updateFormData("fzInfo", fzInfo);
this.$message.success("质量分装成功");
this.justUpdateFilledFormData();
const { dw,bh, gg, ggdw, fzList = [] } = fzInfo;
if(!fzList.length){
this.$message.error("请填写分装信息");
return;
}
const list = fzList.map((item) => {
return {
bh: item.preCode,
kc: item.actnum,
kcdw: dw,
}
})
let postData = {
studyId: this.templateData.studyId,
studyFormId: this.templateData.id,
bh,
gg,
ggdw,
studySubjectId: this.templateData.studySubjectId,
studyId: this.templateData.studyId,
studyFormId: this.templateData.id,
list: list
}
const res = await sj_subpackage(postData)
if (res.code === 200) {
this.$message.success('分装成功')
this.justUpdateFilledFormData();
} else {
this.$message.error('分装失败')
}
} }
} }
} }

+ 2
- 0
src/components/Template/StepFormPackage.vue View File

@ -40,6 +40,7 @@
:type="sItem.type" :error="errors[key]" :type="sItem.type" :error="errors[key]"
@onRegentSubmit="(data)=>onRegentSubmit(data,key,sItem)" @onRegentSubmit="(data)=>onRegentSubmit(data,key,sItem)"
@update:error="errors[key] = false" :item="getRegentItem(sItem)" @update:error="errors[key] = false" :item="getRegentItem(sItem)"
:orange-bg="regentIsExpired(key)"
:value="formFields[key]" /> :value="formFields[key]" />
</template> </template>
<template v-else-if="sItem.type === 'text'"> <template v-else-if="sItem.type === 'text'">
@ -131,6 +132,7 @@ export default {
} }
}, },
methods: { methods: {
isShowJcb(item,key){ isShowJcb(item,key){
const {stepTableFormData = []} = this.formData[key] || {}; const {stepTableFormData = []} = this.formData[key] || {};
return item.type === 'qb' || (item.type === 'dcjcb' && stepTableFormData.length > 0); return item.type === 'qb' || (item.type === 'dcjcb' && stepTableFormData.length > 0);

+ 16
- 2
src/components/Template/mixins/formPackageMixins.js View File

@ -1,6 +1,8 @@
import _ from 'lodash' import _ from 'lodash'
import { getuuid, isEqual, isValueEmpty } from '@/utils/index.js' import { getuuid, isEqual, isValueEmpty } from '@/utils/index.js'
import { isShowOtherByCheckboxTree } from '@/utils/formPackageCommon.js' import { isShowOtherByCheckboxTree } from '@/utils/formPackageCommon.js'
import moment from 'moment'
export default { export default {
inject: ['getZdxgjl', 'updateZdxgjl'], inject: ['getZdxgjl', 'updateZdxgjl'],
watch: { watch: {
@ -59,10 +61,22 @@ export default {
this.$set(this.errors, key, false) this.$set(this.errors, key, false)
} }
}, },
//是否过期
regentIsExpired(key) {
const { yxq, sxrq } = this.formFields[`selectInfo_${key}`] || {};
const rq = sxrq || yxq;
if (rq) {
const time = moment(rq);
return time.isBefore(moment());
} else {
return false;
}
},
//试剂/仪器等弹窗提交 //试剂/仪器等弹窗提交
onRegentSubmit(data, inputValue, key, item) { onRegentSubmit(data, inputValue, key, item) {
this.updateFormData(key, inputValue) this.updateFormData(key, inputValue)
this.formFields[`selectInfo_${key}`] = data.selectInfo;
console.log(this.formFields,"fff")
this.$emit('onRegentSubmit', { this.$emit('onRegentSubmit', {
selectInfo: data, selectInfo: data,
inputValue, inputValue,
@ -557,7 +571,7 @@ export default {
if (o.type === 'span' || o.type === 'text' || o.type === 'button') { if (o.type === 'span' || o.type === 'text' || o.type === 'button') {
continue continue
} }
if (o.fillType === this.templateFillType && !o.disabled) {
if (o.fillType === this.templateFillType) {
let prefix = '' let prefix = ''
if ( if (
o.type === 'input' || o.type === 'input' ||

+ 1
- 0
src/components/Template/mixins/stepMixins.js View File

@ -4,6 +4,7 @@ import { getLatestSn, getLatestSnArr } from '@/api/template'
export default { export default {
inject: { inject: {
templateFillType: { default: 'preFill' }, templateFillType: { default: 'preFill' },
templateData: { default: {} },
templateSn: { default: '' }, templateSn: { default: '' },
getStepData: { default: () => null }, getStepData: { default: () => null },
getJcbData: { default: () => null }, getJcbData: { default: () => null },

+ 3
- 0
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -185,10 +185,13 @@ export default {
ly: row.ly, ly: row.ly,
nddw: row.nddw, nddw: row.nddw,
sxrq: row.sxr, sxrq: row.sxr,
yxq: row.yxq,
ndz: (row.nd||"")+(row.nddw||""), ndz: (row.nd||"")+(row.nddw||""),
type: Number(this.selectType), type: Number(this.selectType),
kc: row.kc, kc: row.kc,
kcdw: row.kcdw, kcdw: row.kcdw,
gg: row.gg,
ggdw: row.ggdw,
} }
const {qxbdType,checkType} = this; const {qxbdType,checkType} = this;
if(qxbdType){ if(qxbdType){

Loading…
Cancel
Save