feat: 新增需求
@@ -121,6 +121,7 @@
|
||||
watch: {
|
||||
option(v) {
|
||||
// #ifdef APP-PLUS
|
||||
console.log(v,'v--------')
|
||||
this.lsjFile && this.show();
|
||||
// #endif
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<view>
|
||||
<template v-if="config.formType == 1">
|
||||
<template >
|
||||
<dynamicForm ref="form" @eventReceiver="eventReceiver" @setBtnLoad="setBtnLoad" :config="config" />
|
||||
</template>
|
||||
<template v-if="config.formType == 2">
|
||||
<!-- <template v-if="config.formType == 2">
|
||||
<crmOrder ref="form" @eventReceiver="eventReceiver" v-if="config.formEnCode==='crmOrder'"
|
||||
:config="config" />
|
||||
<leaveApply ref="form" @eventReceiver="eventReceiver" v-if="config.formEnCode==='leaveApply'"
|
||||
@@ -12,7 +12,7 @@
|
||||
:config="config" />
|
||||
<revokeApply ref="form" @eventReceiver="eventReceiver" v-if="config.formEnCode==='revoke'"
|
||||
:config="config" />
|
||||
</template>
|
||||
</template> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -36,6 +36,15 @@
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
watch:{
|
||||
config:{
|
||||
handler(val){
|
||||
console.log(val,'val1233')
|
||||
},
|
||||
deep:true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
eventReceiver(formData, eventType) {
|
||||
this.$emit('eventReceiver', formData, eventType)
|
||||
|
||||
@@ -99,7 +99,9 @@
|
||||
import {
|
||||
createModel,
|
||||
updateModel,
|
||||
getOnlineLog
|
||||
getOnlineLog,
|
||||
getDesForm,
|
||||
getProcessBusinessInfo
|
||||
} from '@/api/apply/visualDev'
|
||||
import {
|
||||
createComment
|
||||
@@ -127,6 +129,8 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formConf: {},
|
||||
processBusinessInfo: {},
|
||||
dataLogList: [],
|
||||
dataLog: false,
|
||||
childFormKey: +new Date(),
|
||||
@@ -207,6 +211,7 @@
|
||||
onLoad(option) {
|
||||
if (!option.config) return this.jnpf.goBack()
|
||||
this.config = JSON.parse(this.jnpf.base64.decode(option.config))
|
||||
|
||||
uni.$on('operate', (data) => {
|
||||
this.btnLoading = true
|
||||
this[data.eventType + 'Handle'](data)
|
||||
@@ -450,7 +455,7 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
init() {
|
||||
async init() {
|
||||
this.processId = this.config.id
|
||||
if (this.config.id) {
|
||||
let extra = {
|
||||
@@ -464,6 +469,10 @@
|
||||
}
|
||||
uni.setStorageSync('dynamicModelExtra', extra)
|
||||
}
|
||||
// 先获取id
|
||||
const res = await getProcessBusinessInfo(this.config.processInstance.id)
|
||||
console.log(res,'res----------')
|
||||
this.processBusinessInfo = res.data || {}
|
||||
/**
|
||||
* opType
|
||||
* -1 - 我发起的新建/编辑
|
||||
@@ -484,100 +493,110 @@
|
||||
};
|
||||
if (config.isFlow) query.isFlow = config.isFlow
|
||||
if (config.opType != "-1" && config.opType != '0') query.operatorId = config.operatorId;
|
||||
FlowTask(config?.taskId || config?.id || 0, query).then((res) => {
|
||||
this.flowInfo = res.data.flowInfo || {};
|
||||
this.properties = res.data.nodeProperties || {};
|
||||
this.auxiliaryInfo = this.properties.auxiliaryInfo
|
||||
this.$nextTick(() => {
|
||||
this.initApprovalField()
|
||||
})
|
||||
this.formInfo = res.data.formInfo || {};
|
||||
this.taskInfo = res.data.taskInfo || {};
|
||||
this.btnInfo = res.data.btnInfo || [];
|
||||
this.progressList = res.data.progressList || [];
|
||||
config.formOperates = res.data.formOperates || [];
|
||||
config.formType = this.formInfo.type
|
||||
const fullName =
|
||||
config.opType == "-1" ?
|
||||
this.flowInfo.fullName :
|
||||
this.taskInfo.fullName;
|
||||
config.fullName = fullName;
|
||||
this.title = this.flowInfo.fullName;
|
||||
this.thisStep = this.taskInfo.thisStep || "";
|
||||
if (config.status !== 0 && config.status !== 3) {
|
||||
this.title = this.thisStep ?
|
||||
config.fullName + "/" + this.thisStep :
|
||||
config.fullName;
|
||||
getDesForm(this.processBusinessInfo.dbformId).then((res) => {
|
||||
// this.flowInfo = res.data.flowInfo || {};
|
||||
// this.properties = res.data.nodeProperties || {};
|
||||
// this.auxiliaryInfo = this.properties.auxiliaryInfo
|
||||
// this.$nextTick(() => {
|
||||
// this.initApprovalField()
|
||||
// })
|
||||
const data = res.data ? JSON.parse(res.data) : {};
|
||||
console.log(data,'data---11')
|
||||
// this.formConf = JSON.parse(data.formData)
|
||||
this.config = {
|
||||
...data,
|
||||
formConf: data.formData
|
||||
}
|
||||
config.type = this.flowInfo.type;
|
||||
config.draftData = res.data.draftData || null;
|
||||
config.formData = res.data.formData || {};
|
||||
let dataId = config.formData.id
|
||||
config.formEnCode = this.formInfo.enCode;
|
||||
this.nodeList = res.data.nodeList || [];
|
||||
this.recordList = (res.data.recordList || []).reverse();
|
||||
config.formConf = this.formInfo.formData;
|
||||
if (config.formConf) {
|
||||
this.dataLog = JSON.parse(config.formConf).dataLog
|
||||
if (this.dataLog) this.getOnlineLog(dataId)
|
||||
}
|
||||
this.hasComment = this.flowInfo.flowNodes.global.hasComment;
|
||||
console.log(this.config,'config--')
|
||||
// this.$refs.child.$refs.form.init(this.formConf)
|
||||
// console.log(JSON.parse(data.formData),'判断---')
|
||||
// this.formInfo = res.data.formInfo || {};
|
||||
// this.taskInfo = res.data.taskInfo || {};
|
||||
// this.btnInfo = res.data.btnInfo || [];
|
||||
// this.progressList = res.data.progressList || [];
|
||||
// config.formOperates = res.data.formOperates || [];
|
||||
// config.formType = this.formInfo.type
|
||||
// const fullName =
|
||||
// config.opType == "-1" ?
|
||||
// this.flowInfo.fullName :
|
||||
// this.taskInfo.fullName;
|
||||
// config.fullName = fullName;
|
||||
// // this.title = this.flowInfo.fullName;
|
||||
// this.thisStep = this.taskInfo.thisStep || "";
|
||||
// if (config.status !== 0 && config.status !== 3) {
|
||||
// this.title = this.thisStep ?
|
||||
// config.fullName + "/" + this.thisStep :
|
||||
// config.fullName;
|
||||
// }
|
||||
// config.type = this.flowInfo.type;
|
||||
// config.draftData = res.data.draftData || null;
|
||||
// config.formData = res.data.formData || {};
|
||||
// let dataId = config.formData.id
|
||||
// config.formEnCode = this.formInfo.enCode;
|
||||
// this.nodeList = res.data.nodeList || [];
|
||||
// this.recordList = (res.data.recordList || []).reverse();
|
||||
// config.formConf = this.formInfo.formData;
|
||||
// if (config.formConf) {
|
||||
// this.dataLog = JSON.parse(config.formConf).dataLog
|
||||
// if (this.dataLog) this.getOnlineLog(dataId)
|
||||
// }
|
||||
// this.hasComment = this.flowInfo.flowNodes.global.hasComment;
|
||||
this.loading = false;
|
||||
this.formLoding = true;
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.config.formEnCode === "revoke" ? `${this.flowInfo.fullName}撤销申请` : this
|
||||
.flowInfo.fullName,
|
||||
});
|
||||
if (config.formRecords && config.title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: config.title,
|
||||
});
|
||||
}
|
||||
this.flowUrgent = this.taskInfo.flowUrgent || 1;
|
||||
const getSelectInfo = () => {
|
||||
var obj = {
|
||||
value: this.flowUrgent,
|
||||
extra: "0",
|
||||
label: "普通",
|
||||
};
|
||||
this.flowUrgentList.forEach((e, i) => {
|
||||
if (e.value == this.flowUrgent) {
|
||||
obj.extra = i;
|
||||
obj.label = e.label;
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
this.selectflowUrgent = getSelectInfo();
|
||||
this.initRightBtnList();
|
||||
if (config.opType != "-1" && config.opType != "3") config.readonly =
|
||||
true;
|
||||
config.formOperates = [];
|
||||
if (config.opType == 0) {
|
||||
if (this.properties && this.properties && this.properties.formOperates) config
|
||||
.formOperates = this.properties.formOperates || [];
|
||||
} else {
|
||||
config.formOperates = res.data.formOperates || [];
|
||||
}
|
||||
this.getFlowStatus()
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
if (!this.$refs.child || !this.$refs.child.$refs.form) {
|
||||
uni.showToast({
|
||||
title: "暂无此流程表单",
|
||||
icon: "none",
|
||||
complete: () => {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$refs.child.$refs.form.init(config)
|
||||
});
|
||||
}, 100);
|
||||
this.config = config;
|
||||
// this.formLoding = true;
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: this.config.formEnCode === "revoke" ? `${this.flowInfo.fullName}撤销申请` : this
|
||||
// .flowInfo.fullName,
|
||||
// });
|
||||
// if (config.formRecords && config.title) {
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: config.title,
|
||||
// });
|
||||
// }
|
||||
// this.flowUrgent = this.taskInfo.flowUrgent || 1;
|
||||
// const getSelectInfo = () => {
|
||||
// var obj = {
|
||||
// value: this.flowUrgent,
|
||||
// extra: "0",
|
||||
// label: "普通",
|
||||
// };
|
||||
// this.flowUrgentList.forEach((e, i) => {
|
||||
// if (e.value == this.flowUrgent) {
|
||||
// obj.extra = i;
|
||||
// obj.label = e.label;
|
||||
// }
|
||||
// });
|
||||
// return obj;
|
||||
// };
|
||||
// this.selectflowUrgent = getSelectInfo();
|
||||
// this.initRightBtnList();
|
||||
// if (config.opType != "-1" && config.opType != "3") config.readonly =
|
||||
// true;
|
||||
// config.formOperates = [];
|
||||
// if (config.opType == 0) {
|
||||
// if (this.properties && this.properties && this.properties.formOperates) config
|
||||
// .formOperates = this.properties.formOperates || [];
|
||||
// } else {
|
||||
// config.formOperates = res.data.formOperates || [];
|
||||
// }
|
||||
// this.getFlowStatus()
|
||||
// setTimeout(() => {
|
||||
// this.$nextTick(() => {
|
||||
// if (!this.$refs.child || !this.$refs.child.$refs.form) {
|
||||
// uni.showToast({
|
||||
// title: "暂无此流程表单",
|
||||
// icon: "none",
|
||||
// complete: () => {
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack();
|
||||
// }, 1500);
|
||||
// },
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// this.$refs.child.$refs.form.init(config)
|
||||
// });
|
||||
// }, 100);
|
||||
// this.config = config;
|
||||
});
|
||||
},
|
||||
//获取修改记录
|
||||
|
||||
@@ -103,30 +103,35 @@ const statusMap = {
|
||||
|
||||
import {
|
||||
getOperatorList,
|
||||
getFlowLaunchList
|
||||
getFlowLaunchList,
|
||||
getMyPage,
|
||||
getTodoPage,
|
||||
getDonePage,
|
||||
getCcMyPage
|
||||
} from '@/api/workFlow/template'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mescrollTop: 206,
|
||||
statusList: [],
|
||||
|
||||
tabsList: [{
|
||||
fullName: '在办',
|
||||
fullName: '我的消息',
|
||||
category: '1',
|
||||
key: 3,
|
||||
enCode: "workFlow.flowLaunch"
|
||||
},{
|
||||
fullName: '待办任务',
|
||||
category: '2',
|
||||
key: 2,
|
||||
enCode: "workFlow.flowDoing"
|
||||
}, {
|
||||
fullName: '发起',
|
||||
category: null,
|
||||
key: 3,
|
||||
enCode: "workFlow.flowLaunch"
|
||||
}, {
|
||||
fullName: '已办',
|
||||
fullName: '已办任务',
|
||||
category: '3',
|
||||
key: 4,
|
||||
enCode: "workFlow.flowDone"
|
||||
}, {
|
||||
fullName: '抄送',
|
||||
fullName: '抄送任务',
|
||||
category: '4',
|
||||
key: 5,
|
||||
enCode: "workFlow.flowCirculate"
|
||||
@@ -147,7 +152,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.statusList = statusMap[this.tabsList[val].key]
|
||||
this.mescrollTop = 322 / 2
|
||||
this.mescrollTop = 220 / 2
|
||||
this.category = this.tabsList[this.current].category
|
||||
},
|
||||
immediate: true,
|
||||
@@ -182,9 +187,9 @@ export default {
|
||||
}
|
||||
}
|
||||
];
|
||||
configToCheck.forEach(config => {
|
||||
if (this.sysConfigInfo[config.key] === 1) return this.tabsList.unshift(config.tab);
|
||||
});
|
||||
// configToCheck.forEach(config => {
|
||||
// if (this.sysConfigInfo[config.key] === 1) return this.tabsList.unshift(config.tab);
|
||||
// });
|
||||
this.menuList = uni.getStorageSync("menuList");
|
||||
let workFlowList = this.menuList.filter(o => o.enCode === 'workFlow')
|
||||
if (!workFlowList.length) return
|
||||
@@ -203,6 +208,8 @@ export default {
|
||||
/* tab1 */
|
||||
change(index) {
|
||||
let item = this.tabsList[index]
|
||||
console.log(item,'item------------')
|
||||
console.log(index,'index------------')
|
||||
this.current = index;
|
||||
this.status = ''
|
||||
this.keyword = ''
|
||||
@@ -225,13 +232,13 @@ export default {
|
||||
},
|
||||
/* 列表数据 */
|
||||
upCallback(page) {
|
||||
let methods = this.category ? getOperatorList : getFlowLaunchList;
|
||||
let methods = this.getList(this.category)
|
||||
let query = {
|
||||
currentPage: page.num,
|
||||
pageNo: page.num,
|
||||
pageSize: page.size,
|
||||
keyword: this.keyword,
|
||||
category: this.tabsList[this.current].category,
|
||||
status: this.status
|
||||
// category: this.tabsList[this.current].category,
|
||||
// status: this.status
|
||||
}
|
||||
methods(query, {
|
||||
load: page.num == 1
|
||||
@@ -245,11 +252,32 @@ export default {
|
||||
'swipeAction': this.swipeAction(o.status),
|
||||
...o
|
||||
}))
|
||||
console.log(list,'list---')
|
||||
this.list = this.list.concat(list);
|
||||
}).catch(() => {
|
||||
this.mescroll.endErr();
|
||||
})
|
||||
},
|
||||
// 流程列表接口
|
||||
getList(category){
|
||||
let methods = ''
|
||||
console.log(category,'category---')
|
||||
switch(category){
|
||||
case '1':
|
||||
methods = getMyPage
|
||||
break;
|
||||
case '2':
|
||||
methods = getTodoPage
|
||||
break;
|
||||
case '3':
|
||||
methods = getDonePage
|
||||
break;
|
||||
case '4':
|
||||
methods = getCcMyPage
|
||||
break;
|
||||
}
|
||||
return methods
|
||||
},
|
||||
swipeAction(status) {
|
||||
let swipeAction = true
|
||||
if (this.tabsList[this.current].key === 3 && !this.category && (status == '0' || status == '9'))
|
||||
|
||||
@@ -11,20 +11,27 @@
|
||||
<view class='common-lable-entrust' v-if="item.delegateUser">
|
||||
{{!category ? '委托' : '代理' }}
|
||||
</view>
|
||||
<view class='common-lable'
|
||||
:class="{'urgent-lable':item.flowUrgent==2,'important-lable':item.flowUrgent==3}">
|
||||
{{getLableValue(item.flowUrgent)}}
|
||||
<view class='common-lable'>
|
||||
单号
|
||||
</view>
|
||||
<text class="title u-font-28 u-line-1">{{item.fullName}}</text>
|
||||
<text class="title u-font-28 u-line-1">{{item.businessInfo.billNo}}</text>
|
||||
</view>
|
||||
<text class="title u-line-1 u-font-24">审批节点:{{item.currentNodeName}}<text
|
||||
<text class="title u-line-1 u-font-24">单据类型:{{item.name || item.processInstanceName}}<text
|
||||
class="titInner">{{item.thisStep ? item.thisStep : ''}}</text></text>
|
||||
<text class="time title u-font-24">发起时间:<text
|
||||
class="titInner">{{item.startTime?$u.timeFormat(item.startTime, 'yyyy-mm-dd hh:MM:ss'):''}}</text></text>
|
||||
class="titInner">{{item.createTime?$u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss'):''}}</text></text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<image :src="item.flowStatus" mode="widthFix" class="item-right-img">
|
||||
</image>
|
||||
<view v-if="category == 2" class="item-right">
|
||||
<image v-if="item.result == 1" src="./img/jihuo.png" mode="widthFix" class="item-right-img" />
|
||||
<image v-else src="./img/wanc.png" mode="widthFix" class="item-right-img" />
|
||||
</view>
|
||||
<view v-else class="item-right">
|
||||
<image v-if="item.result == 1" src="./img/doing.png" mode="widthFix" class="item-right-img" />
|
||||
<image v-if="item.result == 2" src="./img/togo.png" mode="widthFix" class="item-right-img" />
|
||||
<image v-if="item.result == 3" src="./img/pass.png" mode="widthFix" class="item-right-img" />
|
||||
<image v-if="item.result == 4" src="./img/quxiao.png" mode="widthFix" class="item-right-img" />
|
||||
<image v-if="item.result == 5" src="./img/REJECTED.png" mode="widthFix" class="item-right-img" />
|
||||
<image v-if="item.result == 6" src="./img/weipai.png" mode="widthFix" class="item-right-img" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -105,24 +112,6 @@
|
||||
this.list.splice(index, 1)
|
||||
})
|
||||
},
|
||||
getLableValue(value) {
|
||||
var lableValue = ''
|
||||
switch (value) {
|
||||
case 1:
|
||||
lableValue = '普通'
|
||||
break;
|
||||
case 2:
|
||||
lableValue = '重要'
|
||||
break;
|
||||
case 3:
|
||||
lableValue = '紧急'
|
||||
break;
|
||||
default:
|
||||
lableValue = '普通'
|
||||
break;
|
||||
}
|
||||
return lableValue
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
BIN
pages/workFlow/flowTodo/img/REJECTED.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
pages/workFlow/flowTodo/img/doing.png
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
pages/workFlow/flowTodo/img/jihuo.png
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
pages/workFlow/flowTodo/img/pass.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
pages/workFlow/flowTodo/img/quxiao.png
Normal file
|
After Width: | Height: | Size: 2.0 MiB |
BIN
pages/workFlow/flowTodo/img/togo.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
pages/workFlow/flowTodo/img/wanc.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
pages/workFlow/flowTodo/img/wanchen.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
pages/workFlow/flowTodo/img/weipai.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
@@ -10,11 +10,11 @@
|
||||
<u-tabs ref="tabs" :list="tabsList" active-color="#0177FF" inactive-color="#303133" font-size="30"
|
||||
v-model="current" name="fullName" @change="change" height="80" :is-scroll="false"></u-tabs>
|
||||
</view>
|
||||
<view class="flow-status-tabs" v-if="statusList.length">
|
||||
<!-- <view class="flow-status-tabs" v-if="statusList.length">
|
||||
<u-subsection :list="statusList" :current="subsectionIndex" name="name" active-color="#2979FF"
|
||||
inactive-color="#999999" bg-color="#F2F3F7" font-size="24" :bold="false"
|
||||
@change="subsection"></u-subsection>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
|
||||
:up="upOption" :top="mescrollTop">
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
this.userInfo = uni.getStorageSync('userInfo') || {}
|
||||
this.setting = data
|
||||
this.formConf = data.formConf ? JSON.parse(data.formConf) : {}
|
||||
console.log(this.formConf,'formConf112')
|
||||
this.dataForm.id = data.id || null;
|
||||
this.dataForm.flowId = data.flowId;
|
||||
this.loading = true;
|
||||
@@ -74,91 +75,91 @@
|
||||
},
|
||||
fillFormData(form, data) {
|
||||
form.disabled = this.setting.readonly
|
||||
const loop = (list, parent) => {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i]
|
||||
let vModel = item.__vModel__
|
||||
let config = item.__config__
|
||||
if (vModel) {
|
||||
let val = data.hasOwnProperty(vModel) ? data[vModel] : config.defaultValue
|
||||
if (!config.isSubTable) config.defaultValue = val
|
||||
if (this.isAdd || config.isSubTable) { //新增时候,默认当前
|
||||
if (config.defaultCurrent) {
|
||||
if (config.jnpfKey === 'datePicker') {
|
||||
if (!data.hasOwnProperty(vModel)) {
|
||||
let format = this.jnpf.handelFormat(item.format)
|
||||
let dateStr = this.jnpf.toDate(new Date().getTime(), format)
|
||||
let time = format === 'yyyy' ? '-01-01 00:00:00' : format === 'yyyy-MM' ?
|
||||
'-01 00:00:00' : format === 'yyyy-MM-dd' ?
|
||||
' 00:00:00' : ''
|
||||
val = new Date(dateStr + time).getTime()
|
||||
config.defaultValue = val
|
||||
}
|
||||
}
|
||||
if (config.jnpfKey === 'timePicker') {
|
||||
if (!data.hasOwnProperty(vModel)) {
|
||||
config.defaultValue = this.jnpf.toDate(new Date(), item.format)
|
||||
}
|
||||
}
|
||||
if (config.jnpfKey === 'organizeSelect' && this.userInfo.organizeIds?.length) {
|
||||
config.defaultValue = item.multiple ? this.userInfo.organizeIds :
|
||||
this.userInfo.organizeId
|
||||
}
|
||||
if (config.jnpfKey === 'posSelect' && this.userInfo.positionIds?.length) {
|
||||
config.defaultValue = item.multiple ? this.userInfo.positionIds :
|
||||
this.userInfo.positionId
|
||||
}
|
||||
const userId = this.userInfo.userId
|
||||
if (config.jnpfKey === 'userSelect' && userId) {
|
||||
config.defaultValue = item.multiple ? [userId] : userId;
|
||||
}
|
||||
if (config.jnpfKey === 'usersSelect' && userId) {
|
||||
config.defaultValue = [userId + '--user'];
|
||||
}
|
||||
if (config.jnpfKey === 'sign' && this.userInfo.signImg) {
|
||||
config.defaultValue = this.userInfo.signImg
|
||||
}
|
||||
}
|
||||
}
|
||||
let noShow = item.__config__.noShow || false,
|
||||
isDisabled = item.disabled || false,
|
||||
required = item.__config__.required || false,
|
||||
isVisibility = false
|
||||
if (!item.__config__.visibility || (Array.isArray(item.__config__.visibility) && item
|
||||
.__config__.visibility.includes('app'))) isVisibility = true
|
||||
if (this.setting.formOperates && this.setting.formOperates.length) {
|
||||
let id = item.__config__.isSubTable ? parent?.__vModel__ + '-' + item?.__vModel__ :
|
||||
item
|
||||
.__vModel__
|
||||
let arr = this.setting.formOperates.filter(o => o.id === id) || []
|
||||
if (arr.length) {
|
||||
let obj = arr[0]
|
||||
noShow = !obj.read
|
||||
isDisabled = !obj.write
|
||||
required = obj.required ? obj.required : item.__config__.required
|
||||
}
|
||||
}
|
||||
isDisabled = item.readonly ? item.readonly : isDisabled;
|
||||
if (this.setting.readonly || config.disabled) isDisabled = true
|
||||
if (this.setting.origin === 'scan') isDisabled = true
|
||||
this.$set(item, 'disabled', isDisabled)
|
||||
this.$set(item.__config__, 'noShow', noShow)
|
||||
this.$set(item.__config__, 'required', required)
|
||||
this.$set(item.__config__, 'isVisibility', isVisibility)
|
||||
} else {
|
||||
let noShow = item.__config__.noShow ? item.__config__.noShow : false,
|
||||
isVisibility = false
|
||||
if (!item.__config__.visibility || (Array.isArray(item.__config__.visibility) && item
|
||||
.__config__.visibility.includes('app'))) isVisibility = true
|
||||
this.$set(item.__config__, 'isVisibility', isVisibility)
|
||||
this.$set(item.__config__, 'noShow', noShow)
|
||||
}
|
||||
if (item.__config__ && item.__config__.children && Array.isArray(item.__config__.children)) {
|
||||
loop(item.__config__.children, item)
|
||||
}
|
||||
}
|
||||
}
|
||||
loop(form.fields)
|
||||
// const loop = (list, parent) => {
|
||||
// for (let i = 0; i < list?.length; i++) {
|
||||
// let item = list[i]
|
||||
// let vModel = item.__vModel__
|
||||
// let config = item.__config__
|
||||
// if (vModel) {
|
||||
// let val = data.hasOwnProperty(vModel) ? data[vModel] : config.defaultValue
|
||||
// if (!config.isSubTable) config.defaultValue = val
|
||||
// if (this.isAdd || config.isSubTable) { //新增时候,默认当前
|
||||
// if (config.defaultCurrent) {
|
||||
// if (config.jnpfKey === 'datePicker') {
|
||||
// if (!data.hasOwnProperty(vModel)) {
|
||||
// let format = this.jnpf.handelFormat(item.format)
|
||||
// let dateStr = this.jnpf.toDate(new Date().getTime(), format)
|
||||
// let time = format === 'yyyy' ? '-01-01 00:00:00' : format === 'yyyy-MM' ?
|
||||
// '-01 00:00:00' : format === 'yyyy-MM-dd' ?
|
||||
// ' 00:00:00' : ''
|
||||
// val = new Date(dateStr + time).getTime()
|
||||
// config.defaultValue = val
|
||||
// }
|
||||
// }
|
||||
// if (config.jnpfKey === 'timePicker') {
|
||||
// if (!data.hasOwnProperty(vModel)) {
|
||||
// config.defaultValue = this.jnpf.toDate(new Date(), item.format)
|
||||
// }
|
||||
// }
|
||||
// if (config.jnpfKey === 'organizeSelect' && this.userInfo.organizeIds?.length) {
|
||||
// config.defaultValue = item.multiple ? this.userInfo.organizeIds :
|
||||
// this.userInfo.organizeId
|
||||
// }
|
||||
// if (config.jnpfKey === 'posSelect' && this.userInfo.positionIds?.length) {
|
||||
// config.defaultValue = item.multiple ? this.userInfo.positionIds :
|
||||
// this.userInfo.positionId
|
||||
// }
|
||||
// const userId = this.userInfo.userId
|
||||
// if (config.jnpfKey === 'userSelect' && userId) {
|
||||
// config.defaultValue = item.multiple ? [userId] : userId;
|
||||
// }
|
||||
// if (config.jnpfKey === 'usersSelect' && userId) {
|
||||
// config.defaultValue = [userId + '--user'];
|
||||
// }
|
||||
// if (config.jnpfKey === 'sign' && this.userInfo.signImg) {
|
||||
// config.defaultValue = this.userInfo.signImg
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// let noShow = item.__config__.noShow || false,
|
||||
// isDisabled = item.disabled || false,
|
||||
// required = item.__config__.required || false,
|
||||
// isVisibility = false
|
||||
// if (!item.__config__.visibility || (Array.isArray(item.__config__.visibility) && item
|
||||
// .__config__.visibility.includes('app'))) isVisibility = true
|
||||
// if (this.setting.formOperates && this.setting.formOperates.length) {
|
||||
// let id = item.__config__.isSubTable ? parent?.__vModel__ + '-' + item?.__vModel__ :
|
||||
// item
|
||||
// .__vModel__
|
||||
// let arr = this.setting.formOperates.filter(o => o.id === id) || []
|
||||
// if (arr.length) {
|
||||
// let obj = arr[0]
|
||||
// noShow = !obj.read
|
||||
// isDisabled = !obj.write
|
||||
// required = obj.required ? obj.required : item.__config__.required
|
||||
// }
|
||||
// }
|
||||
// isDisabled = item.readonly ? item.readonly : isDisabled;
|
||||
// if (this.setting.readonly || config.disabled) isDisabled = true
|
||||
// if (this.setting.origin === 'scan') isDisabled = true
|
||||
// this.$set(item, 'disabled', isDisabled)
|
||||
// this.$set(item.__config__, 'noShow', noShow)
|
||||
// this.$set(item.__config__, 'required', required)
|
||||
// this.$set(item.__config__, 'isVisibility', isVisibility)
|
||||
// } else {
|
||||
// let noShow = item.__config__.noShow ? item.__config__.noShow : false,
|
||||
// isVisibility = false
|
||||
// if (!item.__config__.visibility || (Array.isArray(item.__config__.visibility) && item
|
||||
// .__config__.visibility.includes('app'))) isVisibility = true
|
||||
// this.$set(item.__config__, 'isVisibility', isVisibility)
|
||||
// this.$set(item.__config__, 'noShow', noShow)
|
||||
// }
|
||||
// if (item.__config__ && item.__config__.children && Array.isArray(item.__config__.children)) {
|
||||
// loop(item.__config__.children, item)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// loop(form.fields)
|
||||
form.formData = data
|
||||
},
|
||||
sumbitForm(data, callback) {
|
||||
|
||||