Browse Source

feat:[模板管理][复核调试]

lkf
luojie 3 months ago
parent
commit
ba345e07ba
3 changed files with 83 additions and 73 deletions
  1. +55
    -48
      src/components/Template/HandleFormItem.vue
  2. +27
    -25
      src/views/business/comps/template/TemplateTable.vue
  3. +1
    -0
      src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue

+ 55
- 48
src/components/Template/HandleFormItem.vue View File

@ -91,6 +91,7 @@
<el-button type="primary" @click="onReplyConfirm"> </el-button> <el-button type="primary" @click="onReplyConfirm"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<EditSign @cancel="resetRecord" ref="editSignRef" @callback="onEditSignSave" />
</div> </div>
</template> </template>
@ -100,11 +101,13 @@ import DecimalInput from "./DecimalInput.vue";
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import moment from "moment"; import moment from "moment";
import { deepClone } from "@/utils/index"; import { deepClone } from "@/utils/index";
import EditSign from "@/views/business/comps/template/dialog/EditSign.vue"
export default { export default {
inject: ['templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], inject: ['templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"],
components: { components: {
Question, Question,
DecimalInput
DecimalInput,
EditSign,
}, },
props: { props: {
type: {//form input/select type: {//form input/select
@ -174,7 +177,9 @@ export default {
console.log(this.$i18n.locale, "locale") console.log(this.$i18n.locale, "locale")
}, },
methods: { methods: {
onEditSignSave(data){
this.handleUpdateRecord(data)
},
getChecked() { getChecked() {
return !!this.getFieldCheckObj()[this.fieldKey]?.checked; return !!this.getFieldCheckObj()[this.fieldKey]?.checked;
}, },
@ -235,9 +240,10 @@ export default {
} }
const params = { const params = {
type: "reply",
//reply:content:
type: this.templateFillType == 'actFill' ? "reply" : "content",
newRecord: record, newRecord: record,
resourceList: deepClone(this.getFhyjjl()),
resourceList: this.getFhyjjl(),
} }
// //
EventBus.$emit('onModifyRecord', params); EventBus.$emit('onModifyRecord', params);
@ -305,7 +311,7 @@ export default {
}, },
// question // question
onClickQuestion() { onClickQuestion() {
const {templateFillType} = this;
const {templateFillType} = this;
if (templateFillType == 'actFill' || templateFillType == 'qc') { if (templateFillType == 'actFill' || templateFillType == 'qc') {
if (templateFillType == 'qc') { if (templateFillType == 'qc') {
const field = this.getFieldCheckObj()[this.fieldKey]; const field = this.getFieldCheckObj()[this.fieldKey];
@ -342,50 +348,15 @@ export default {
// //
if (this.templateFillType === "actFill") { if (this.templateFillType === "actFill") {
// //
try {
const isSame = this.isEqual(this.oldValue, this.inputValue);
if (this.oldValue && !isSame) {
const passwordResult = await this.$prompt('请输入密码以确认修改', '密码验证', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'password',
inputPattern: /.+/,
inputErrorMessage: '请输入密码',
zIndex: 10000,
});
}
const baseInfo = this.getCommonRecordInfo();
const record = {
...baseInfo,
oldValue: this.oldValue,
value: this.inputValue,
title: this.oldValue ? "修改记录" : "填写",
time: moment().format("YYYY-MM-DD HH:mm:ss"),
}
const params = {
type: "fieldChanged",
newRecord: record,
resourceList: deepClone(this.getZdxgjl()),
}
EventBus.$emit('onModifyRecord', params,)
this.updateZdxgjl(record);
//
this.oldValue = this.inputValue; //
this.$emit("blur", val);
this.$emit('input', this.inputValue);
this.$emit("change", val);
//
// await this.saveModificationRecord();
} catch {
//
this.inputValue = this.oldValue;
this.$emit('input', this.inputValue); // v-model
this.$emit("blur", this.oldValue);
this.$emit("change", this.oldValue);
const isSame = this.isEqual(this.oldValue, this.inputValue);
if (this.oldValue && !isSame) {
this.$refs.editSignRef.show()
}
if(!this.oldValue){//
this.handleUpdateRecord()
} }
} else { } else {
// blurchange // blurchange
this.$emit("blur", val) this.$emit("blur", val)
@ -394,6 +365,42 @@ export default {
} }
}, },
//退
resetRecord(){
//
this.inputValue = this.oldValue;
this.$emit('input', this.inputValue); // v-model
this.$emit("blur", this.oldValue);
this.$emit("change", this.oldValue);
},
//
handleUpdateRecord(data){
const baseInfo = this.getCommonRecordInfo();
const record = {
...baseInfo,
oldValue: this.oldValue,
value: this.inputValue,
title: this.oldValue ? "修改记录" : "填写",
time: moment().format("YYYY-MM-DD HH:mm:ss"),
}
if(data){
record.reason = data.remark
}
const params = {
type: "fieldChanged",
newRecord: record,
resourceList: deepClone(this.getZdxgjl()),
}
EventBus.$emit('onModifyRecord', params,)
this.updateZdxgjl(record);
//
this.oldValue = this.inputValue; //
this.$emit("blur", this.inputValue);
this.$emit('input', this.inputValue);
this.$emit("change", this.inputValue);
},
// //
isEqual(oldValue, nowValue){ isEqual(oldValue, nowValue){
if (oldValue === null || nowValue === null) { if (oldValue === null || nowValue === null) {

+ 27
- 25
src/views/business/comps/template/TemplateTable.vue View File

@ -71,14 +71,16 @@ export default {
immediate: true, immediate: true,
deep: true, deep: true,
handler(v) { handler(v) {
if(v.zdxgjl){
this.zdxgjl = v.zdxgjl || [];
}
if(v.fhyjjl){
this.fhyjjl = v.fhyjjl || [];
}
if(v.fieldCheckObj){
this.fieldCheckObj = v.fieldCheckObj || {};
if (v) {
if (v.zdxgjl) {
this.zdxgjl = v.zdxgjl || [];
}
if (v.fhyjjl) {
this.fhyjjl = v.fhyjjl || [];
}
if (v.fieldCheckObj) {
this.fieldCheckObj = v.fieldCheckObj || {};
}
} }
} }
} }
@ -87,38 +89,38 @@ export default {
return { return {
//fillType //fillType
templateFillType: this.fillType, templateFillType: this.fillType,
getZdxgjl: ()=>(this.zdxgjl || [
{key:"versionNum",title:'提交',filed:'试验基本信息-其他信息',value:'新值',oldValue:'',reason:'修改原因',userName:'签名人',time:'2026-01-01 14:22:22'},
{key:"versionNum",title:'修改记录',filed:'试验基本信息-其他信息',value:'新值',oldValue:'原值3',reason:'修改原因',userName:'签名人',time:'2026-01-01 14:22:22'},
{key:"act",title:'修改记录',filed:'试验基本信息-其他信息',value:'ss',oldValue:'old1',reason:'修改原因1',userName:'签名人',time:'2026-01-01 14:22:22'},
{key:"startSolutionCode_0",title:'修改记录',filed:'试验基本信息-其他信息',value:'ss',oldValue:'old1',reason:'修改原因1',userName:'签名人',time:'2026-01-01 14:22:22'},
getZdxgjl: () => (this.zdxgjl || [
{ key: "versionNum", title: '提交', filed: '试验基本信息-其他信息', value: '新值', oldValue: '', reason: '修改原因', userName: '签名人', time: '2026-01-01 14:22:22' },
{ key: "versionNum", title: '修改记录', filed: '试验基本信息-其他信息', value: '新值', oldValue: '原值3', reason: '修改原因', userName: '签名人', time: '2026-01-01 14:22:22' },
{ key: "act", title: '修改记录', filed: '试验基本信息-其他信息', value: 'ss', oldValue: 'old1', reason: '修改原因1', userName: '签名人', time: '2026-01-01 14:22:22' },
{ key: "startSolutionCode_0", title: '修改记录', filed: '试验基本信息-其他信息', value: 'ss', oldValue: 'old1', reason: '修改原因1', userName: '签名人', time: '2026-01-01 14:22:22' },
]), ]),
getFhyjjl: ()=>(
getFhyjjl: () => (
this.fhyjjl || [ this.fhyjjl || [
{key:"versionNum",title:'复核意见',field:'试验基本信息-其他信息',content:'复核意见内容',replay:'',userName:'签名人',time:'2026-01-01 14:22:22',sfhf:'1'}
]
{ key: "versionNum", title: '复核意见', field: '试验基本信息-其他信息', content: '复核意见内容', replay: '', userName: '签名人', time: '2026-01-01 14:22:22', sfhf: '1' }
]
), ),
getFieldCheckObj: ()=>(
getFieldCheckObj: () => (
this.fieldCheckObj || { this.fieldCheckObj || {
versionNum:{checked:true},
act:{checked:true},
}
versionNum: { checked: true },
act: { checked: true },
}
), ),
// //
updateZdxgjl:(data)=>{
updateZdxgjl: (data) => {
this.zdxgjl.unshift(data); this.zdxgjl.unshift(data);
}, },
// //
updateFhyjjl:(data)=>{
updateFhyjjl: (data) => {
this.fhyjjl.unshift(data); this.fhyjjl.unshift(data);
}, },
// //
replaceFhyjjl:(data)=>{
replaceFhyjjl: (data) => {
this.fhyjjl = data; this.fhyjjl = data;
}, },
// //
updateFieldCheckObj:(data)=>{
this.fieldCheckObj = {...this.fieldCheckObj, ...data};
updateFieldCheckObj: (data) => {
this.fieldCheckObj = { ...this.fieldCheckObj, ...data };
}, },
} }

+ 1
- 0
src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue View File

@ -26,6 +26,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <button @click = "onSave">保存</button> -->
</div> </div>
</template> </template>

Loading…
Cancel
Save