Browse Source

feat:[模板管理][优化]

lkf
luojie 3 months ago
parent
commit
36b543f724
7 changed files with 33 additions and 17 deletions
  1. +1
    -1
      src/components/Template/BaseInfoFormPcakge.vue
  2. +1
    -1
      src/components/Template/CustomTable.vue
  3. +18
    -12
      src/components/Template/HandleFormItem.vue
  4. +10
    -0
      src/views/business/comps/template/TemplateTable.vue
  5. +1
    -1
      src/views/business/study/comp/jhbd/Fh.vue
  6. +1
    -1
      src/views/business/study/comp/sqbd/Fh.vue
  7. +1
    -1
      src/views/business/study/comp/tbbd/Fh.vue

+ 1
- 1
src/components/Template/BaseInfoFormPcakge.vue View File

@ -130,7 +130,7 @@
:value="formFields[sItem.subKey]" />
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1">
<div class="other-title">其他</div>
<div class="flex">
<div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)"
v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)"
:error="errors[sItem.otherCode]" @update:error="errors[sItem.otherCode] = false"

+ 1
- 1
src/components/Template/CustomTable.vue View File

@ -9,7 +9,7 @@
<div>{{ $t(col.label) }}</div>
<template
v-if="col.headerSelectKey && col.headerOptions && (showHeaderSelect || templateFillType === 'preFill')">
<HandleFormItem :fieldKey="prefixKey+'_'+col.headerSelectKey+'_'+rowIndex" :fieldItemLabel="fieldItemLabel" type="select" class="header-select" :item="getHeaderItem(col)"
<HandleFormItem :fieldKey="prefixKey+'_'+col.headerSelectKey" :fieldItemLabel="fieldItemLabel" type="select" class="header-select" :item="getHeaderItem(col)"
v-model="headerSelectFields[col.headerSelectKey]" @change="onHeaderSelectChange(col, $event)"
:error="hasError(-1, index, col.headerSelectKey)"
@update:error="onErrorUpdate(-1, index, col.headerSelectKey, $event)" />

+ 18
- 12
src/components/Template/HandleFormItem.vue View File

@ -57,7 +57,7 @@
<div class="record-row" v-if="currentRecordType === 'fieldChanged'">
<div>
<span>{{ index + 1 }}.</span>
<span> {{ record.userName }} </span>
<span> {{ getUserName(record) }} </span>
<span>{{ record.time }} </span>
<span>{{ modificationRecords.length-1==index?"填写":"修改记录" }}</span>
</div>
@ -69,12 +69,12 @@
<!-- 回复记录 -->
<div class="record-row" v-if="currentRecordType === 'replyRecord'">
<div>
<span> {{ record.userName }} </span>
<span> {{ getUserName(record) }} </span>
<span>{{ record.time }} </span>
</div>
<div>
<div v-if="record.content">复核意见{{ record.content }}</div>
<div v-if="record.replay">回复意见{{ record.replay }}</div>
<div v-if="record.reply">回复意见{{ record.reply }}</div>
</div>
</div>
<hr v-if="index < modificationRecords.length - 1">
@ -82,7 +82,7 @@
</div>
</div>
</div>
<el-dialog append-to-body :title="templateFillType == 'actFill' ? '回复意见' : '复核意见'" :visible.sync="visible"
<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="输入内容"
maxlength="500" />
@ -176,6 +176,13 @@ export default {
mounted() {
},
methods: {
getUserName(record){
const locale = this.$i18n.locale;
if(locale === 'zh_CN'){
return record.userNameCn;
}
return record.userNameEn;
},
onEditSignSave(data) {
this.handleUpdateRecord(data)
},
@ -211,11 +218,11 @@ export default {
time: moment().format("YYYY-MM-DD HH:mm:ss"),
}
if (this.templateFillType == 'actFill') {
record.replay = this.replyContent;
record.reply = this.replyContent;
const deepList = deepClone(this.getFhyjjl());//
const item = deepList.find(o => o.key == record.key);
if (item) {
item.replay = this.replyContent;
item.reply = this.replyContent;
}
this.replaceFhyjjl(deepList);//
} else {
@ -257,9 +264,9 @@ export default {
const records = this.getReplyRecords();
if (records.length > 0) {
const o = records[0];
if (o.replay && o.content) {//
if (o.reply && o.content) {//
return "green"
} else if (o.content && !o.replay) {//
} else if (o.content && !o.reply) {//
return "orange"
} else {
return "gray"
@ -329,7 +336,7 @@ export default {
if (!o.reply && templateFillType == 'qc') {//qc
content = o.content;
} else if (!o.content && templateFillType == 'actFill') {//qc
content = o.replay;
content = o.reply;
}
}
this.replyContent = content;
@ -384,14 +391,13 @@ export default {
if (data) {
record.reason = data.remark
}
this.updateZdxgjl(record);
const params = {
type: "fieldChanged",
newRecord: record,
resourceList: deepClone(this.getZdxgjl()),
resourceList: this.getZdxgjl(),
}
console.log(params,"params")
EventBus.$emit('onModifyRecord', params,)
this.updateZdxgjl(record);
//
this.oldValue = this.inputValue; //
this.$emit("blur", this.inputValue);

+ 10
- 0
src/views/business/comps/template/TemplateTable.vue View File

@ -130,6 +130,15 @@ export default {
},
methods: {
async getFormData() {
if(this.fillType === "actFill"){
//
const flag = this.fhyjjl.every((item)=>!!item.content && !!item.reply)
console.log(this.fhyjjl,flag,"flag")
if(!flag){
this.$message.error("疑问项还未回复,请回复后再提交");
return;
}
}
return await this.$refs.templateComponent.getFormData();
},
getResource() {
@ -148,5 +157,6 @@ export default {
.template-table {
background: #fff;
padding: 10px 10px;
width: 100%;
}
</style>

+ 1
- 1
src/views/business/study/comp/jhbd/Fh.vue View File

@ -189,7 +189,7 @@ export default {
studyFormPlan_updateFhyjjl(
{
id: this.form.id,
replay: JSON.stringify(data.newRecord),
reply: JSON.stringify(data.newRecord),
fhyjjl: JSON.stringify(data.resourceList)
}
).then(response => {

+ 1
- 1
src/views/business/study/comp/sqbd/Fh.vue View File

@ -189,7 +189,7 @@ export default {
studyFormApply_updateFhyjjl(
{
id: this.form.id,
replay: JSON.stringify(data.newRecord),
reply: JSON.stringify(data.newRecord),
fhyjjl: JSON.stringify(data.resourceList)
}
).then(response => {

+ 1
- 1
src/views/business/study/comp/tbbd/Fh.vue View File

@ -191,7 +191,7 @@ export default {
studyFormFill_updateFhyjjl(
{
id: this.form.id,
replay: JSON.stringify(data.newRecord),
reply: JSON.stringify(data.newRecord),
fhyjjl: JSON.stringify(data.resourceList)
}
).then(response => {

Loading…
Cancel
Save