Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
5126b7d32c
4 changed files with 188 additions and 104 deletions
  1. +23
    -0
      src/components/Template/BaseInfoFormPackage.vue
  2. +135
    -71
      src/components/Template/HandleFormItem.vue
  3. +20
    -1
      src/components/Template/mixins/formPackageMixins.js
  4. +10
    -32
      src/views/business/comps/template/comps/sp/SP003.vue

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

@ -102,6 +102,12 @@
@resetRecord="resetRecord(key)" @resetRecord="resetRecord(key)"
:item="sItem" :value="formFields[key]" /> :item="sItem" :value="formFields[key]" />
</div> </div>
<div v-else-if="isRegent(sItem)" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" :type="sItem.type"
:error="errors[key]" @update:error="errors[key] = false"
@onRegentSubmit="(data)=>onRegentSubmit(data,key,sItem)"
:item="sItem" :value="formFields[key]" />
</div>
</div> </div>
</div> </div>
@ -148,6 +154,11 @@
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" :error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" @resetRecord="resetRecord(sItem.subKey)"
:value="formFields[sItem.subKey]" /> :value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.subKey" class="ml-10" v-else-if="isRegent(sItem,'subType')" :type="sItem.subType"
:item="getRegentItem(sItem,'subType')"
@onRegentSubmit="(data)=>onRegentSubmit(data,sItem.subKey,sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:value="formFields[sItem.subKey]" />
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1"> <div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1">
<div class="other-title">{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}</div> <div class="other-title">{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}</div>
<div class="flex flex1"> <div class="flex flex1">
@ -178,6 +189,10 @@
@update:error="errors[sItem.subKey] = false" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" @resetRecord="resetRecord(sItem.subKey)"
:item="getClickableItem(sItem)" :value="formFields[sItem.subKey]" /> :item="getClickableItem(sItem)" :value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.subKey" class="ml-10" v-else-if="isRegent(sItem,'subType')"
:error="errors[sItem.subKey]" :type="sItem.subType"
@onRegentSubmit="(data)=>onRegentSubmit(data,sItem.subKey,sItem)"
:item="getRegentItem(sItem,'subType')" :value="formFields[sItem.subKey]" />
</div> </div>
<div v-else-if="sItem.type === 'clickable'" class="flex flex1"> <div v-else-if="sItem.type === 'clickable'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
@ -186,6 +201,14 @@
@resetRecord="resetRecord(key)" @resetRecord="resetRecord(key)"
:item="sItem" :value="formFields[key]" /> :item="sItem" :value="formFields[key]" />
</div> </div>
<div v-else-if="isRegent(sItem)"
class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel"
@onRegentSubmit="(data)=>onRegentSubmit(data,key,sItem)"
:field-key="prefixKey+'_'+key" :type="sItem.type"
:error="errors[key]" @update:error="errors[key] = false"
:item="getRegentItem(sItem)" :value="formFields[key]" />
</div>
</div> </div>
</div> </div>
</template> </template>

+ 135
- 71
src/components/Template/HandleFormItem.vue View File

@ -22,24 +22,20 @@
</el-select> </el-select>
<el-checkbox v-else-if="type === 'checkbox'" class="flex1" :multiple="item.multiple" <el-checkbox v-else-if="type === 'checkbox'" class="flex1" :multiple="item.multiple"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue"
:disabled="getDisabled()" :placeholder="getPlaceholder()"
@change="onItemCheckboxChange">
:disabled="getDisabled()" :placeholder="getPlaceholder()" @change="onItemCheckboxChange">
</el-checkbox> </el-checkbox>
<el-date-picker v-else-if="type === 'dateTime'" type="datetime" class="flex1" <el-date-picker v-else-if="type === 'dateTime'" type="datetime" class="flex1"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue"
:disabled="getDisabled()" format="yyyy/MM/dd HH:mm:ss"
:placeholder="getPlaceholder()" @change="(val)=>onDateChange(val,'yyyy/MM/DD HH:mm:ss')">
:disabled="getDisabled()" format="yyyy/MM/dd HH:mm:ss" :placeholder="getPlaceholder()"
@change="(val) => onDateChange(val, 'yyyy/MM/DD HH:mm:ss')">
</el-date-picker> </el-date-picker>
<el-date-picker v-else-if="type === 'datePicker'" class="flex1"
<el-date-picker v-else-if="type === 'datePicker'" class="flex1"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue"
:disabled="getDisabled()" format="yyyy/MM/dd"
:placeholder="getPlaceholder()" @change="(val)=>onDateChange(val,'yyyy/MM/DD')">
:disabled="getDisabled()" format="yyyy/MM/dd" :placeholder="getPlaceholder()"
@change="(val) => onDateChange(val, 'yyyy/MM/DD')">
</el-date-picker> </el-date-picker>
<el-button v-else-if="type === 'button'"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"
:disabled="getDisabled()"
type="primary"
@click="handleClickButton(item)">
<el-button v-else-if="type === 'button'" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"
:disabled="getDisabled()" type="primary" @click="handleClickButton(item)">
{{ item.buttonName }} {{ item.buttonName }}
</el-button> </el-button>
@ -49,10 +45,17 @@
<span v-if="inputValue">{{ inputValue }}</span> <span v-if="inputValue">{{ inputValue }}</span>
<span v-else class="default-placeholder-text">{{ getPlaceholder() }}</span> <span v-else class="default-placeholder-text">{{ getPlaceholder() }}</span>
</div> </div>
<div class="clickable"
:class="getFillTypeStyle() + (getDisabled() ? ' disabled' : '') + (orangeBg ? ' orange-bg' : '')"
v-else-if="regentType.includes(item.type)"
@click="onCommonHandleRegent(item, item.type)">
<span v-if="inputValue">{{ inputValue }}</span>
<span v-else class="default-placeholder-text">{{ getPlaceholder() }}</span>
</div>
</div> </div>
<div class="handle-row" v-if="isShowHandle()"> <div class="handle-row" v-if="isShowHandle()">
<el-checkbox v-model="checkboxValue" v-if="getIsShowCheckboxIcon()" :disabled="getCheckboxDisabled()" class="mr-5"
@change="onCheckboxChange"></el-checkbox>
<el-checkbox v-model="checkboxValue" v-if="getIsShowCheckboxIcon()" :disabled="getCheckboxDisabled()"
class="mr-5" @change="onCheckboxChange"></el-checkbox>
<div class="handle-icon" v-if="getIsShowQuestionIcon()" @click="onClickQuestion" <div class="handle-icon" v-if="getIsShowQuestionIcon()" @click="onClickQuestion"
@mouseenter="(e) => onMouseEnter('replyRecord', e)" @mouseleave="onMouseLeave"> @mouseenter="(e) => onMouseEnter('replyRecord', e)" @mouseleave="onMouseLeave">
<Question :class="getQuestionColor()" /> <Question :class="getQuestionColor()" />
@ -76,9 +79,9 @@
<span>{{ index + 1 }}.</span> <span>{{ index + 1 }}.</span>
<span> {{ getUserName(record) }} </span> <span> {{ getUserName(record) }} </span>
<span>{{ record.time }} </span> <span>{{ record.time }} </span>
<span>{{ modificationRecords.length-1==index?"提交":"修改" }}</span>
<span>{{ modificationRecords.length - 1 == index ? "提交" : "修改" }}</span>
</div> </div>
<div v-if = "modificationRecords.length-1!==index">
<div v-if="modificationRecords.length - 1 !== index">
<div>原值{{ record.oldValue }}</div> <div>原值{{ record.oldValue }}</div>
<div>修改值{{ record.value }}</div> <div>修改值{{ record.value }}</div>
<div v-if="record.reason">备注{{ record.reason }}</div> <div v-if="record.reason">备注{{ record.reason }}</div>
@ -100,8 +103,8 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog :close-on-click-modal = "false" append-to-body :title="templateFillType == 'actFill' ? '回复意见' : '复核意见'" :visible.sync="visible"
width="30%">
<el-dialog :close-on-click-modal="false" append-to-body :title="templateFillType == 'actFill' ? '回复意见' : '复核意见'"
:visible.sync="visible" width="30%">
<el-input v-model="replyContent" type="textarea" show-word-limit resize="none" rows="8" placeholder="输入内容" <el-input v-model="replyContent" type="textarea" show-word-limit resize="none" rows="8" placeholder="输入内容"
maxlength="500" /> maxlength="500" />
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -120,7 +123,7 @@ import moment from "moment";
import { deepClone } from "@/utils/index"; import { deepClone } from "@/utils/index";
import { getuuid } from "@/utils/index.js"; import { getuuid } from "@/utils/index.js";
export default { export default {
inject: ['templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"],
inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"],
components: { components: {
Question, Question,
DecimalInput, DecimalInput,
@ -143,7 +146,7 @@ export default {
}, },
// v-model // v-model
value: { value: {
type: [String, Number, Array,Boolean],
type: [String, Number, Array, Boolean],
default: '' default: ''
}, },
// //
@ -168,7 +171,11 @@ export default {
isFieldsRecord: { isFieldsRecord: {
type: Boolean, type: Boolean,
default: true, default: true,
}
},
sourceFrom: {
type: String,
default: ""
},
}, },
data() { data() {
return { return {
@ -184,6 +191,8 @@ export default {
visible: false,// visible: false,//
checkboxValue: this.getChecked(),// checkboxValue: this.getChecked(),//
uuid: getuuid(), // EventBus uuid: getuuid(), // EventBus
regentType:['sj','gsp','mix','xj','xb','gyzj','mjy','yq'], ////
selectRegentInfo:{},////
} }
}, },
watch: { watch: {
@ -205,25 +214,67 @@ export default {
EventBus.$on('onExternalFieldUpdate', this.handleExternalFieldUpdate); EventBus.$on('onExternalFieldUpdate', this.handleExternalFieldUpdate);
EventBus.$on('onEditSignCancel', this.handleEditSignCancel); EventBus.$on('onEditSignCancel', this.handleEditSignCancel);
EventBus.$on('onEditSignCallback', this.handleEditSignCallback); EventBus.$on('onEditSignCallback', this.handleEditSignCallback);
//
EventBus.$on("onReagentSubmit", this.onReagentSubmit)
//
EventBus.$on("onInstrumentSubmit", this.onInstrumentSubmit)
////
EventBus.$on("onMixReagentSubmit", this.onMixReagentSubmit)
}, },
unmounted() { unmounted() {
EventBus.$off('onExternalFieldUpdate', this.handleExternalFieldUpdate); EventBus.$off('onExternalFieldUpdate', this.handleExternalFieldUpdate);
EventBus.$off('onEditSignCancel', this.handleEditSignCancel); EventBus.$off('onEditSignCancel', this.handleEditSignCancel);
EventBus.$off('onEditSignCallback', this.handleEditSignCallback); EventBus.$off('onEditSignCallback', this.handleEditSignCallback);
EventBus.$off("onReagentSubmit", this.onReagentSubmit)
EventBus.$off("onInstrumentSubmit", this.onInstrumentSubmit)
EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit)
}, },
methods: { methods: {
//
onMixReagentSubmit(data){
if(data.uuid !== this.uuid) return;
this.inputValue = data.selectedId;
this.selectRegentInfo = data;
this.onCommonHandleSaveRecord();
// this.inputValue = this.item.label;
},
///
onCommonHandleRegent(item, type) {
let params = {
studyFormId:this.templateData.id,
uuid:this.uuid,
sourceFrom:this.sourceFrom,
}
if (type !== "yq") {
const sjType = {
sj: "1",//
gsp: "7",//
mix: "1",////
gyzj: "3",//
mjy: "5",//
xj: "9",//
xb: "11",//
}
params = {
...params,
type: sjType[type]
}
}
EventBus.$emit("showSelectMixReagentDialog", params)
// this.$emit('regent', item,type);
},
// //
handleClickButton(item){
handleClickButton(item) {
this.$emit('clickButton', item); this.$emit('clickButton', item);
}, },
onDateChange(val,format){
onDateChange(val, format) {
this.inputValue = moment(val).format(format); this.inputValue = moment(val).format(format);
console.log(this.inputValue,"inputValue")
console.log(this.inputValue, "inputValue")
this.onCommonHandleSaveRecord(this.inputValue); this.onCommonHandleSaveRecord(this.inputValue);
}, },
getUserName(record){
getUserName(record) {
const locale = this.$i18n.locale; const locale = this.$i18n.locale;
if(locale === 'zh_CN'){
if (locale === 'zh_CN') {
return record.userNameCn; return record.userNameCn;
} }
return record.userNameEn; return record.userNameEn;
@ -336,13 +387,13 @@ export default {
// //
onCheckboxChange(val) { onCheckboxChange(val) {
// //
if (this.templateFillType == 'qc' && this.getQuestionColor()=== "orange") {
if (this.templateFillType == 'qc' && this.getQuestionColor() === "orange") {
this.checkboxValue = false; this.checkboxValue = false;
this.$message({ this.$message({
message: '该表单还有质疑项未处理,无法勾选', message: '该表单还有质疑项未处理,无法勾选',
type: 'error' type: 'error'
}); });
return ;
return;
} }
this.checkboxValue = val; this.checkboxValue = val;
// //
@ -357,8 +408,8 @@ export default {
onRemoveTag(e) { onRemoveTag(e) {
this.onCommonHandleSaveRecord(this.inputValue); this.onCommonHandleSaveRecord(this.inputValue);
}, },
onItemCheckboxChange(){
this.onCommonHandleSaveRecord(this.inputValue);
onItemCheckboxChange() {
this.onCommonHandleSaveRecord(this.inputValue);
}, },
// //
onSelectBlur(visible) { onSelectBlur(visible) {
@ -419,7 +470,7 @@ export default {
} else if (!this.error && isEmpty) { } else if (!this.error && isEmpty) {
this.$emit('update:error', true); this.$emit('update:error', true);
} }
if(!this.isFieldsRecord){//
if (!this.isFieldsRecord) {//
this.$emit("blur", this.inputValue); this.$emit("blur", this.inputValue);
this.$emit('input', this.inputValue); this.$emit('input', this.inputValue);
this.$emit("change", this.inputValue); this.$emit("change", this.inputValue);
@ -427,13 +478,13 @@ export default {
} }
// //
const isSame = this.isEqual(this.oldValue, this.inputValue); const isSame = this.isEqual(this.oldValue, this.inputValue);
if(isSame){
if (isSame) {
return; return;
} }
if (!this.isValueEmpty(this.oldValue) && !isSame && this.templateFillType === "actFill") { if (!this.isValueEmpty(this.oldValue) && !isSame && this.templateFillType === "actFill") {
// EventBus // EventBus
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
}else{//
} else {//
this.handleUpdateRecord() this.handleUpdateRecord()
} }
}, },
@ -444,8 +495,8 @@ export default {
this.inputValue = this.oldValue; this.inputValue = this.oldValue;
this.$emit('input', this.inputValue); // v-model this.$emit('input', this.inputValue); // v-model
// this.$emit("blur", this.oldValue); // this.$emit("blur", this.oldValue);
this.$emit("change", this.oldValue,"cancel");
if(this.item.type === "clickable"){
this.$emit("change", this.oldValue, "cancel");
if (this.item.type === "clickable") {
this.$emit("resetRecord"); this.$emit("resetRecord");
} }
}, },
@ -453,7 +504,7 @@ export default {
// //
handleUpdateRecord(data) { handleUpdateRecord(data) {
const baseInfo = this.getCommonRecordInfo(); const baseInfo = this.getCommonRecordInfo();
if(!this.oldValue && !this.inputValue) return;
if (!this.oldValue && !this.inputValue) return;
const record = { const record = {
...baseInfo, ...baseInfo,
oldValue: this.oldValue, oldValue: this.oldValue,
@ -464,7 +515,7 @@ export default {
if (data) { if (data) {
record.reason = data.remark record.reason = data.remark
} }
const params = { const params = {
type: "fieldChanged", type: "fieldChanged",
newRecord: [record], newRecord: [record],
@ -474,15 +525,19 @@ export default {
this.oldValue = this.inputValue; // this.oldValue = this.inputValue; //
this.$emit("blur", this.inputValue); this.$emit("blur", this.inputValue);
this.$emit('input', this.inputValue); this.$emit('input', this.inputValue);
this.$emit("change", this.inputValue,data?"save":"");
if(this.item.type === "clickable"){//clickable
this.$emit("change", this.inputValue, data ? "save" : "");
if (this.item.type === "clickable") {//clickable
return; return;
} }
if(this.templateFillType === "actFill"){//
if (this.templateFillType === "actFill") {//
this.updateZdxgjl(record); this.updateZdxgjl(record);
} }
setTimeout(() => { setTimeout(() => {
EventBus.$emit('onModifyRecord', params,) EventBus.$emit('onModifyRecord', params,)
if(this.regentType.includes(this.item.type)){
this.$emit("onRegentSubmit", this.selectRegentInfo);
}
}, 10); }, 10);
}, },
@ -502,20 +557,20 @@ export default {
const { nickName, name } = this.$store.getters; const { nickName, name } = this.$store.getters;
//locale:zh-CN en-US //locale:zh-CN en-US
const { label, parentLabel } = this.item; const { label, parentLabel } = this.item;
let fieldLabelCn = this.$i18n.t(label,"zh_CN"),fieldLabelEn = this.$i18n.t(label,"en_US");
let fieldLabelCn = this.$i18n.t(label, "zh_CN"), fieldLabelEn = this.$i18n.t(label, "en_US");
if (label === "template.common.other") { if (label === "template.common.other") {
fieldLabelCn = this.$i18n.t(parentLabel,"zh_CN")+this.$i18n.t("template.common.otherInfo","zh_CN");
fieldLabelEn = this.$i18n.t(parentLabel,"en_US")+this.$i18n.t("template.common.otherInfo","en_US");
fieldLabelCn = this.$i18n.t(parentLabel, "zh_CN") + this.$i18n.t("template.common.otherInfo", "zh_CN");
fieldLabelEn = this.$i18n.t(parentLabel, "en_US") + this.$i18n.t("template.common.otherInfo", "en_US");
} else if (!label && parentLabel == "template.common.remark") { } else if (!label && parentLabel == "template.common.remark") {
fieldLabelCn = this.$i18n.t(parentLabel,"zh_CN")+this.$i18n.t("template.common.unit","zh_CN");
fieldLabelEn = this.$i18n.t(parentLabel,"en_US")+this.$i18n.t("template.common.unit","en_US");
fieldLabelCn = this.$i18n.t(parentLabel, "zh_CN") + this.$i18n.t("template.common.unit", "zh_CN");
fieldLabelEn = this.$i18n.t(parentLabel, "en_US") + this.$i18n.t("template.common.unit", "en_US");
} }
const commonInfo = { const commonInfo = {
userNameCn: nickName, userNameCn: nickName,
userNameEn: name, userNameEn: name,
key: this.fieldKey, key: this.fieldKey,
fieldCn: `${this.$i18n.t(this.fieldItemLabel,"zh_CN")}`+(fieldLabelCn?("-"+fieldLabelCn):""),
fieldEn: `${this.$i18n.t(this.fieldItemLabel,"en_US")}`+(fieldLabelEn?("-"+fieldLabelEn):""),
fieldCn: `${this.$i18n.t(this.fieldItemLabel, "zh_CN")}` + (fieldLabelCn ? ("-" + fieldLabelCn) : ""),
fieldEn: `${this.$i18n.t(this.fieldItemLabel, "en_US")}` + (fieldLabelEn ? ("-" + fieldLabelEn) : ""),
} }
return commonInfo; return commonInfo;
}, },
@ -540,13 +595,13 @@ export default {
this.$emit("clickable", item) this.$emit("clickable", item)
}, },
// //
getCheckboxDisabled(){
getCheckboxDisabled() {
//qccheckbox //qccheckbox
return this.templateFillType !== 'qc' return this.templateFillType !== 'qc'
}, },
// //
getIsShowCheckboxIcon() { getIsShowCheckboxIcon() {
if(this.templateFillType === 'qc'){
if (this.templateFillType === 'qc') {
return true; return true;
} }
return this.getChecked(); return this.getChecked();
@ -584,7 +639,7 @@ export default {
if (this.getDisabled()) { if (this.getDisabled()) {
return "" return ""
} }
if (type === "clickable") {
if (this.regentType.includes(type) || type === "clickable") {
return this.$t("template.common.pleaseSelect") return this.$t("template.common.pleaseSelect")
} }
let prex = "template.common.pleaseFillIn" let prex = "template.common.pleaseFillIn"
@ -777,44 +832,53 @@ export default {
border-color: #f9c588 !important; border-color: #f9c588 !important;
} }
} }
.el-checkbox__inner{
.el-checkbox__inner {
border-color: #f9c588 !important; border-color: #f9c588 !important;
} }
} }
.el-button--primary{
&.orange-border{
.el-button--primary {
&.orange-border {
background-color: #f79b31 !important; background-color: #f79b31 !important;
border-color: #f79b31 !important; border-color: #f79b31 !important;
&:hover { &:hover {
background-color: #f79b31 !important; background-color: #f79b31 !important;
} }
&:disabled { &:disabled {
background-color: rgba(#f79b31,.8) !important;
border-color: rgba(#f79b31,.8) !important;
background-color: rgba(#f79b31, .8) !important;
border-color: rgba(#f79b31, .8) !important;
} }
&:active { &:active {
background-color: rgba(#f79b31,.8) !important;
border-color: rgba(#f79b31,.8) !important;
background-color: rgba(#f79b31, .8) !important;
border-color: rgba(#f79b31, .8) !important;
} }
} }
&.blue-border { &.blue-border {
background-color: #4ea2ff !important; background-color: #4ea2ff !important;
border-color: #4ea2ff !important; border-color: #4ea2ff !important;
&:hover { &:hover {
background-color: #4ea2ff !important; background-color: #4ea2ff !important;
} }
&:disabled { &:disabled {
background-color: rgba(#4ea2ff,.8) !important;
border-color: rgba(#4ea2ff,.8) !important;
background-color: rgba(#4ea2ff, .8) !important;
border-color: rgba(#4ea2ff, .8) !important;
} }
&:active { &:active {
background-color: rgba(#4ea2ff,.8) !important;
border-color: rgba(#4ea2ff,.8) !important;
background-color: rgba(#4ea2ff, .8) !important;
border-color: rgba(#4ea2ff, .8) !important;
} }
} }
} }
.green-border { .green-border {
@ -871,16 +935,16 @@ export default {
.clickable, .clickable,
.el-date-editor { .el-date-editor {
border-color: #ff5d5d; border-color: #ff5d5d;
box-shadow: 0 0 6px #ffc3c3!important;
box-shadow: 0 0 6px #ffc3c3 !important;
&:focus { &:focus {
border-color: #ff5d5d; border-color: #ff5d5d;
box-shadow: 0 0 6px #ffc3c3!important;
box-shadow: 0 0 6px #ffc3c3 !important;
} }
&:hover { &:hover {
border-color: #ff5d5d; border-color: #ff5d5d;
box-shadow: 0 0 6px #ffc3c3!important;
box-shadow: 0 0 6px #ffc3c3 !important;
} }
} }
@ -888,21 +952,21 @@ export default {
.el-select .el-input__inner, .el-select .el-input__inner,
.el-date-editor .el-input__inner .el-checkbox__inner { .el-date-editor .el-input__inner .el-checkbox__inner {
border-color: #ff5d5d; border-color: #ff5d5d;
box-shadow: 0 0 6px #ffc3c3!important;
box-shadow: 0 0 6px #ffc3c3 !important;
} }
// DecimalInput // DecimalInput
:deep(.el-input-number) { :deep(.el-input-number) {
.el-input__inner { .el-input__inner {
border-color: #ff5d5d; border-color: #ff5d5d;
box-shadow: 0 0 6px #ffc3c3!important;
box-shadow: 0 0 6px #ffc3c3 !important;
} }
} }
// //
.clickable { .clickable {
border-color: #ff5d5d; border-color: #ff5d5d;
box-shadow: 0 0 6px #ffc3c3!important;
box-shadow: 0 0 6px #ffc3c3 !important;
} }
} }
@ -976,7 +1040,7 @@ export default {
cursor: pointer; cursor: pointer;
width: auto; width: auto;
// margin-left: 10px; // margin-left: 10px;
min-height: 28px;
min-height: 28px;
line-height: 28px; line-height: 28px;
word-break: break-all; word-break: break-all;
border-radius: 4px; border-radius: 4px;
@ -997,7 +1061,7 @@ export default {
&.error-border { &.error-border {
border-color: #ff5d5d !important; border-color: #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3!important;
box-shadow: 0 0 6px #ffc3c3 !important;
} }
} }

+ 20
- 1
src/components/Template/mixins/formPackageMixins.js View File

@ -50,6 +50,25 @@ export default {
}, },
methods: { methods: {
//试剂/仪器等弹窗提交
onRegentSubmit(data,key,item){
this.$emit("onRegentSubmit", {selectInfo:data,key,config:item});
},
//是不是试剂/仪器等弹窗类型
isRegent(item,fieldCode="type"){
const type = item[fieldCode] ;
const typeList = ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq']
return typeList.includes(type);
},
getRegentItem(item,fieldCode="type"){
const type = item[fieldCode] ;
return {
label: "",
type,
fillType: item.subFillType || item.fillType,
parentLabel: item.label,
}
},
getRecords(data) { getRecords(data) {
const records = []; const records = [];
const { nickName, name } = this.$store.getters; const { nickName, name } = this.$store.getters;
@ -130,7 +149,7 @@ export default {
const cloneFormFields = JSON.parse(JSON.stringify(this.formFields)); const cloneFormFields = JSON.parse(JSON.stringify(this.formFields));
this.oldFormFields[key] = cloneFormFields[key]; this.oldFormFields[key] = cloneFormFields[key];
this.showEditSignDialog();
// this.showEditSignDialog();
this.formFields[key] = value; this.formFields[key] = value;
// 清除该表单项的错误状态 // 清除该表单项的错误状态
if (this.errors[key]) { if (this.errors[key]) {

+ 10
- 32
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -15,9 +15,9 @@
:formData="formData" /> --> :formData="formData" /> -->
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPackage @clickable="handleClickable" ref="stepFormPackageRef"
fieldItemLabel="template.common.operationSteps" @resetRecord="resetRecord"
@onSureModifyRecord="onSureModifyRecord" :formConfig="stepFormConfig" @blur="onHandleBlur"
<BaseInfoFormPackage ref="stepFormPackageRef"
fieldItemLabel="template.common.operationSteps"
@onRegentSubmit="onRegentSubmit" :formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" /> :formData="formData" />
<CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur" <CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
:showAddRow="fillType === 'preFill' ? true : false" :showOperation="fillType === 'actFill'" :showAddRow="fillType === 'preFill' ? true : false" :showOperation="fillType === 'actFill'"
@ -38,8 +38,6 @@
</div> </div>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
</div> </div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
</div> </div>
</template> </template>
@ -196,7 +194,7 @@ export default {
label: "template.sp.sp003.qsyry", label: "template.sp.sp003.qsyry",
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
subType: "clickable",
subType: "sj",
subKey: "subStartSolution", subKey: "subStartSolution",
subFillType: "actFill", subFillType: "actFill",
maxlength: 20, maxlength: 20,
@ -222,7 +220,7 @@ export default {
label: "template.sp.sp003.xsy", label: "template.sp.sp003.xsy",
type: "input", type: "input",
fillType: "preFill", fillType: "preFill",
subType: "clickable",
subType: "sj",
subKey: "subSolution", subKey: "subSolution",
subFillType: "actFill", subFillType: "actFill",
maxlength: 20, maxlength: 20,
@ -431,14 +429,13 @@ export default {
}, },
methods: { methods: {
// //
onSureModifyRecord(key) {
onRegentSubmit(data) {
const { selectInfo,key} = data;
const {row} = selectInfo;
if (key === "subStartSolution") {//table if (key === "subStartSolution") {//table
this.$refs.stepTableRef.updateRecords();
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd);
this.updateStepTableData(row);
} }
},
resetRecord() {
this.$refs.stepTableRef.resetRecord();
}, },
startConfig(val) { startConfig(val) {
const { rowData } = val; const { rowData } = val;
@ -525,25 +522,6 @@ export default {
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"]) return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"])
}, },
handleClickable(item) {
if (this.fillType === "preFill") {
return;
}
const { subKey = "" } = item;
if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.$refs.selectReagentDialogRef.show(this.formData.id)
this.currentSubKey = subKey;
}
},
//
onSelectReagentSubmit(code, row) {
if (this.currentSubKey === "subStartSolution") {//
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd);
this.updateStepTableData(row);
}
this.$refs.selectReagentDialogRef.onCancel()
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
},
//table //table
updateStepTableData(row) { updateStepTableData(row) {
const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData(); const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();

Loading…
Cancel
Save