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>
</span>
</el-dialog>
<EditSign @cancel="resetRecord" ref="editSignRef" @callback="onEditSignSave" />
</div>
</template>
@ -100,11 +101,13 @@ import DecimalInput from "./DecimalInput.vue";
import { EventBus } from "@/utils/eventBus";
import moment from "moment";
import { deepClone } from "@/utils/index";
import EditSign from "@/views/business/comps/template/dialog/EditSign.vue"
export default {
inject: ['templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"],
components: {
Question,
DecimalInput
DecimalInput,
EditSign,
},
props: {
type: {//form input/select
@ -174,7 +177,9 @@ export default {
console.log(this.$i18n.locale, "locale")
},
methods: {
onEditSignSave(data){
this.handleUpdateRecord(data)
},
getChecked() {
return !!this.getFieldCheckObj()[this.fieldKey]?.checked;
},
@ -235,9 +240,10 @@ export default {
}
const params = {
type: "reply",
//reply:content:
type: this.templateFillType == 'actFill' ? "reply" : "content",
newRecord: record,
resourceList: deepClone(this.getFhyjjl()),
resourceList: this.getFhyjjl(),
}
//
EventBus.$emit('onModifyRecord', params);
@ -305,7 +311,7 @@ export default {
},
// question
onClickQuestion() {
const {templateFillType} = this;
const {templateFillType} = this;
if (templateFillType == 'actFill' || templateFillType == 'qc') {
if (templateFillType == 'qc') {
const field = this.getFieldCheckObj()[this.fieldKey];
@ -342,50 +348,15 @@ export default {
//
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 {
// blurchange
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){
if (oldValue === null || nowValue === null) {

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

@ -71,14 +71,16 @@ export default {
immediate: true,
deep: true,
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 {
//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 || [
{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 || {
versionNum:{checked:true},
act:{checked:true},
}
versionNum: { checked: true },
act: { checked: true },
}
),
//
updateZdxgjl:(data)=>{
updateZdxgjl: (data) => {
this.zdxgjl.unshift(data);
},
//
updateFhyjjl:(data)=>{
updateFhyjjl: (data) => {
this.fhyjjl.unshift(data);
},
//
replaceFhyjjl:(data)=>{
replaceFhyjjl: (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>
<!-- <button @click = "onSave">保存</button> -->
</div>
</template>

Loading…
Cancel
Save