feat: 新增需求
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<view class="dynamicModel-form-v jnpf-wrap jnpf-wrap-form" v-if="showPage">
|
||||
<JnpfParser :formConf="formConf" ref="dynamicForm" @submit="sumbitForm" :key="key" v-if="!loading" />
|
||||
<!-- 审批记录区域 -->
|
||||
<view v-if="approvalData.length">
|
||||
<view v-if="approvalData.length && isApproval">
|
||||
<view class="approval-title">审批记录</view>
|
||||
<view class="approval-list">
|
||||
<view
|
||||
@@ -98,12 +98,12 @@
|
||||
</view>
|
||||
|
||||
<view class="process-list" v-if="!loadingProcess">
|
||||
<u-radio-group @change="selectProcess">
|
||||
<u-radio-group v-model="selectedProcess" @change="selectProcess">
|
||||
<view
|
||||
class="process-item"
|
||||
v-for="(item, index) in processList"
|
||||
:key="item.id"
|
||||
:class="{'selected-item': selectedProcess && selectedProcess.id === item.id}"
|
||||
:class="{'selected-item': selectedProcess && selectedProcess === item.id}"
|
||||
>
|
||||
<view class="process-item-left">
|
||||
<u-radio :name="item.id">{{ item.name }}</u-radio>
|
||||
@@ -364,8 +364,6 @@
|
||||
},
|
||||
computed: {
|
||||
getOkText() {
|
||||
// btnType
|
||||
console.log(this.btnType,'btnType--')
|
||||
return this.$t('common.saveText');
|
||||
},
|
||||
getProcessText() {
|
||||
@@ -381,6 +379,10 @@
|
||||
idDsabled() {
|
||||
const {approveStatus} = this.dataForm
|
||||
return approveStatus == 2 || approveStatus == 4
|
||||
},
|
||||
isApproval(){
|
||||
const {current} = this.config
|
||||
return !!current
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
@@ -423,9 +425,18 @@
|
||||
this.initMoreMenuList()
|
||||
}
|
||||
|
||||
const getNavigationTitle = () => this.dataForm.id ? this.$t('common.editText') : this.$t('common.addText')
|
||||
const getNavigationTitle = () =>{
|
||||
let titleName = ''
|
||||
if(this.config.current){
|
||||
titleName = this.config.name + '详情'
|
||||
}else {
|
||||
const name = this.dataForm.id ? this.$t('common.editText') : this.$t('common.addText')
|
||||
titleName = name + this.config.name
|
||||
}
|
||||
return titleName
|
||||
}
|
||||
uni.setNavigationBarTitle({
|
||||
title: getNavigationTitle() + this.config.name
|
||||
title: getNavigationTitle()
|
||||
})
|
||||
this.getDesForm()
|
||||
},
|
||||
@@ -563,6 +574,9 @@
|
||||
const res = await getdbformlist(this.modelId)
|
||||
if (res.code === 0 || res.code === 200) {
|
||||
this.processList = res.data || []
|
||||
if(this.processList.length === 1){
|
||||
this.selectProcess(res.data[0])
|
||||
}
|
||||
if (this.processList.length === 0) {
|
||||
uni.showToast({
|
||||
title: '暂无可用流程',
|
||||
@@ -625,6 +639,7 @@
|
||||
this.getListCreateData(params)
|
||||
},
|
||||
selectProcess(item) {
|
||||
console.log(item,'item----')
|
||||
this.selectedProcess = item
|
||||
},
|
||||
async launchSelectedProcess() {
|
||||
@@ -843,23 +858,31 @@
|
||||
};
|
||||
uni.setStorageSync('dynamicModelExtra', extra);
|
||||
const res = await getModelInfo(this.modelId, this.dataForm.id);
|
||||
console.log(res.data,'res.data111')
|
||||
console.log(res.data.jeelowcode_subtable_data,'res.data222')
|
||||
if(!!res.data.approveStatus&&(res.data.approveStatus !== 0 || res.data.approveStatus == 3)){
|
||||
// 不是未发起和驳回的都不可编辑
|
||||
this.disableAllFormFields();
|
||||
}
|
||||
this.dataForm = res.data;
|
||||
if (!res.data) return;
|
||||
const {fields = []} = this.formConf
|
||||
const result = fields.reduce((acc,current)=>{
|
||||
const key = current.__vModel__;
|
||||
if(res.data.hasOwnProperty(key)){
|
||||
acc[key] = res.data[key];
|
||||
}else if(res.data.jeelowcode_subtable_data && res.data.jeelowcode_subtable_data.hasOwnProperty(key)){
|
||||
acc[key] = res.data.jeelowcode_subtable_data[key];
|
||||
}
|
||||
return acc;
|
||||
},{})
|
||||
this.formData = {
|
||||
...res.data,
|
||||
id: this.dataForm.id,
|
||||
lc_fire_operation_detail: res.data.jeelowcode_subtable_data?.lc_fire_operation_detail || res.data?.lc_fire_operation_detail || [],
|
||||
sDate: res.data.sDate,
|
||||
eDate: res.data.eDate ? new Date(res.data.eDate).getTime() : null,
|
||||
applyDepId: res.data.applyDepId ? String(res.data.applyDepId) : '',
|
||||
applyDepName: res.data.applyDepName || '',
|
||||
applyDepData: res.data.applyDepData || null,
|
||||
...result
|
||||
};
|
||||
console.log(this.formData,'formData123')
|
||||
this.$nextTick(()=>{
|
||||
|
||||
Reference in New Issue
Block a user