Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39bbe5d36b | ||
|
|
625c9d0d5b | ||
| 05cd45a18d | |||
| 301c0199d2 | |||
|
|
fccdf57954 | ||
|
|
39cf1c9b1e | ||
|
|
2edf0f5df3 | ||
|
|
99362bf3c2 |
@@ -36,7 +36,8 @@
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<template #label>控件字段<BasicHelp :text="fieldText" /></template>
|
||||
<yunzhupaas-input v-model:value="activeData.__vModel__" disabled v-if="yunzhupaasKey === 'table'" />
|
||||
<!-- <yunzhupaas-input v-model:value="activeData.__vModel__" disabled v-if="yunzhupaasKey === 'table'" /> -->
|
||||
<yunzhupaas-input v-model:value="activeData.__vModel__" v-if="yunzhupaasKey === 'table'" />
|
||||
<yunzhupaas-select
|
||||
v-model:value="activeData.__vModel__"
|
||||
ref="fieldSelectRef"
|
||||
@@ -98,9 +99,16 @@
|
||||
<yunzhupaas-input
|
||||
v-model:value="activeData.__vModel__"
|
||||
placeholder="请输入数据库字段"
|
||||
:disabled="yunzhupaasKey === 'table' || !!formInfo.isKit"
|
||||
@change="onInputFieldChange($event, config.formId, config.parentVModel)" />
|
||||
</a-form-item>
|
||||
<!-- <a-form-item>
|
||||
<template #label>控件字段<BasicHelp :text="fieldText" /></template>
|
||||
<yunzhupaas-input
|
||||
v-model:value="activeData.__vModel__"
|
||||
placeholder="请输入数据库字段"
|
||||
:disabled="yunzhupaasKey === 'table' || !!formInfo.isKit"
|
||||
@change="onInputFieldChange($event, config.formId, config.parentVModel)" />
|
||||
</a-form-item> -->
|
||||
</div>
|
||||
</div>
|
||||
<a-form-item label="控件标题" v-if="!layoutList.includes(yunzhupaasKey) || yunzhupaasKey === 'table'">
|
||||
|
||||
169
src/views/bsc/billingitem/Detail.vue
Normal file
169
src/views/bsc/billingitem/Detail.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" :title="title" width="600px" showFooter
|
||||
:showOkBtn="false">
|
||||
<template #insertFooter>
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form ">
|
||||
<!-- 表单 -->
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" ref="formRef" >
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="billing_item_code" >
|
||||
<template #label>计费项目编码
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.billing_item_code"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.billing_item_code" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="billing_item_name" >
|
||||
<template #label>计费项目名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.billing_item_name"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.billing_item_name" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="billing_item_type" >
|
||||
<template #label>费用类别
|
||||
</template> <p>{{dataForm.billing_item_type}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remark" >
|
||||
<template #label>备注
|
||||
</template> <p>{{dataForm.remark}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicDrawer>
|
||||
<!-- 有关联表单详情:开始 -->
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<!-- 有关联表单详情:结束 -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getDetailInfo } from './helper/api';
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev';
|
||||
import { reactive, toRefs, nextTick, ref, computed, unref ,toRaw} from 'vue';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { BasicDrawer, useDrawer } from '@/components/Drawer';
|
||||
// 有关联表单详情
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { getDataChange } from '@/api/onlineDev/visualDev';
|
||||
import { getDataInterfaceDataInfoByIds } from '@/api/systemData/dataInterface';
|
||||
import ExtraRelationInfo from '@/components/yunzhupaas/RelationForm/src/ExtraRelationInfo.vue';
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
title: string;
|
||||
maskConfig: any;
|
||||
interfaceRes: any;
|
||||
locationScope: any;
|
||||
extraOptions: any;
|
||||
extraData: any;
|
||||
|
||||
}
|
||||
|
||||
defineOptions({ name: 'Detail' });
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const [registerDrawer, { openDrawer, setDrawerProps, closeDrawer }] = useDrawer();
|
||||
|
||||
const { t } = useI18n();
|
||||
const relationDetailRef = ref<any>(null);
|
||||
const state = reactive<State>({
|
||||
dataForm:{},
|
||||
title: t('common.detailText','详情'),
|
||||
maskConfig:{
|
||||
billing_item_code: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
billing_item_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
}
|
||||
,
|
||||
interfaceRes: {"billing_item_name":[],"billing_item_type":[],"billing_item_code":[],"remark":[]},
|
||||
locationScope:{
|
||||
}
|
||||
,
|
||||
extraOptions: {
|
||||
}
|
||||
,
|
||||
extraData: {
|
||||
}
|
||||
,
|
||||
});
|
||||
const { title, dataForm, maskConfig } = toRefs(state);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.dataForm.id = data.id;
|
||||
openDrawer();
|
||||
nextTick(() => {
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
closeDrawer();
|
||||
}
|
||||
}
|
||||
function getData(id) {
|
||||
getDetailInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
nextTick(() => {
|
||||
changeLoading(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setDrawerProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setFormProps({ loading });
|
||||
}
|
||||
|
||||
function getParamList(key) {
|
||||
let templateJson: any[] = state.interfaceRes[key];
|
||||
if (!templateJson || !templateJson.length || !state.dataForm) return templateJson;
|
||||
for (let i = 0; i < templateJson.length; i++) {
|
||||
if (templateJson[i].relationField && templateJson[i].sourceType == 1) {
|
||||
templateJson[i].defaultValue = state.dataForm[templateJson[i].relationField + '_id'] || '';
|
||||
}
|
||||
}
|
||||
return templateJson;
|
||||
}
|
||||
</script>
|
||||
384
src/views/bsc/billingitem/Form.vue
Normal file
384
src/views/bsc/billingitem/Form.vue
Normal file
@@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" width="600px" showFooter
|
||||
:cancelText="t('common.cancelText','取消')"
|
||||
:okText="t('common.okText','确定')"
|
||||
@ok="handleSubmit" :closeFunc="onClose">
|
||||
<template #title>
|
||||
<a-space :size="10">
|
||||
<div class="text-16px font-medium">{{ title }}</div>
|
||||
<a-space-compact size="small" block v-if="dataForm.id">
|
||||
<a-tooltip :title="t('common.prevRecord')">
|
||||
<a-button size="small" :disabled="getPrevDisabled" @click="handlePrev">
|
||||
<i class="icon-ym icon-ym-caret-left text-10px"></i>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip :title="t('common.nextRecord')">
|
||||
<a-button size="small" :disabled="getNextDisabled" @click="handleNext">
|
||||
<i class="icon-ym icon-ym-caret-right text-10px"></i>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space-compact>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #insertFooter>
|
||||
<div class="float-left mt-5px">
|
||||
<yunzhupaasCheckboxSingle v-model:value="submitType" :label="continueText" />
|
||||
</div>
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form ">
|
||||
<!-- 表单 -->
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" :rules="dataRule" ref="formRef" >
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="billing_item_code" >
|
||||
<template #label>计费项目编码
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.billing_item_code" @change="changeData('billing_item_code',-1)"
|
||||
placeholder="请输入" :allowClear='true' :style='{"width":"100%"}' :maskConfig = "maskConfig.billing_item_code" :showCount = "false" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="billing_item_name" >
|
||||
<template #label>计费项目名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.billing_item_name" @change="changeData('billing_item_name',-1)"
|
||||
placeholder="请输入" :allowClear='true' :style='{"width":"100%"}' :maskConfig = "maskConfig.billing_item_name" :showCount = "false" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="billing_item_type" >
|
||||
<template #label>费用类别
|
||||
</template> <YunzhupaasSelect v-model:value="dataForm.billing_item_type" @change="changeData('billing_item_type',-1)"
|
||||
placeholder="请选择" :templateJson="state.interfaceRes.billing_item_type" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.billing_item_typeOptions" :fieldNames="optionsObj.billing_item_typeProps"
|
||||
>
|
||||
</YunzhupaasSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remark" >
|
||||
<template #label>备注
|
||||
</template> <YunzhupaasTextarea v-model:value="dataForm.remark" @change="changeData('remark',-1)"
|
||||
placeholder="请输入" :allowClear='true' :style='{"width":"100%"}' :autoSize='{"minRows":4,"maxRows":4}' :showCount = "false" >
|
||||
</YunzhupaasTextarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { create, update, getInfo } from './helper/api';
|
||||
import { reactive, toRefs, nextTick, ref, unref, computed,toRaw, inject } from 'vue';
|
||||
import { BasicDrawer, useDrawer } from '@/components/Drawer';
|
||||
import { yunzhupaasRelationForm } from '@/components/yunzhupaas';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import type { FormInstance } from 'ant-design-vue';
|
||||
import { thousandsFormat , getDateTimeUnit, getTimeUnit} from '@/utils/yunzhupaas';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import dayjs from 'dayjs';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
tableRows: any;
|
||||
dataRule: any;
|
||||
optionsObj: any;
|
||||
childIndex: any;
|
||||
isEdit: any;
|
||||
interfaceRes: any;
|
||||
//可选范围默认值
|
||||
ableAll: any;
|
||||
//掩码配置
|
||||
maskConfig:any;
|
||||
//定位属性
|
||||
locationScope:any;
|
||||
extraOptions: any;
|
||||
title: string;
|
||||
continueText: string; allList: any[];
|
||||
currIndex: number;
|
||||
isContinue: boolean;
|
||||
submitType: number;
|
||||
showContinueBtn: boolean;
|
||||
}
|
||||
|
||||
const emit = defineEmits(['reload']);
|
||||
const getLeftTreeActiveInfo: (() => any) | null = inject('getLeftTreeActiveInfo', null);
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const [registerDrawer, { openDrawer, setDrawerProps }] = useDrawer();
|
||||
const formRef = ref<FormInstance>();
|
||||
const state = reactive<State>({
|
||||
dataForm: {
|
||||
billing_item_code:undefined,
|
||||
billing_item_name:undefined,
|
||||
billing_item_type:'',
|
||||
remark:undefined,
|
||||
},
|
||||
|
||||
tableRows:{
|
||||
},
|
||||
|
||||
dataRule: {
|
||||
billing_item_code: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
billing_item_name: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
billing_item_type: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.arrayRequiredPrefix ','请至少选择一个'),
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
optionsObj:{
|
||||
billing_item_typeOptions:[{"fullName":"周期类","id":"Recurring"},{"fullName":"固定金额","id":"Fixed"},{"fullName":"单价 × 约定数量","id":"UnitQty"},{"fullName":"单价 × 实际用量","id":"Usage"},{"fullName":"比例费用","id":"Percentage"},{"fullName":"条件费用","id":"Conditional"}],
|
||||
billing_item_typeProps:{"label":"fullName","value":"id" },
|
||||
},
|
||||
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {"billing_item_name":[],"billing_item_type":[],"billing_item_code":[],"remark":[]},
|
||||
//可选范围默认值
|
||||
ableAll:{
|
||||
},
|
||||
|
||||
//掩码配置
|
||||
maskConfig:{
|
||||
billing_item_code: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
billing_item_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
},
|
||||
|
||||
//定位属性
|
||||
locationScope:{
|
||||
},
|
||||
|
||||
extraOptions:{
|
||||
},
|
||||
|
||||
title: "",
|
||||
continueText: "", allList: [],
|
||||
currIndex: 0,
|
||||
isContinue: false,
|
||||
submitType: 0,
|
||||
showContinueBtn: true ,
|
||||
});
|
||||
const { title, continueText, showContinueBtn, dataRule, dataForm, optionsObj, ableAll, maskConfig,submitType } = toRefs(state);
|
||||
|
||||
const getPrevDisabled = computed(() => state.currIndex === 0);
|
||||
const getNextDisabled = computed(() => state.currIndex === state.allList.length - 1);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.submitType = 0;
|
||||
state.isContinue = false;
|
||||
state.title = !data.id ? t('common.add2Text','新增') : t('common.editText','编辑');
|
||||
state.continueText = !data.id ? t('common.continueAndAddText','确定并新增') : t('common.continueText','确定并继续'); setFormProps({ continueLoading: false });
|
||||
state.dataForm.id = data.id;
|
||||
openDrawer();
|
||||
state.allList = data.allList;
|
||||
state.currIndex = state.allList.length && data.id ? state.allList.findIndex((item) => item.id === data.id) : 0;
|
||||
nextTick(() => {
|
||||
getForm().resetFields();
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
//初始化options
|
||||
|
||||
// 设置默认值
|
||||
state.dataForm={
|
||||
billing_item_code:undefined,
|
||||
billing_item_name:undefined,
|
||||
billing_item_type:'',
|
||||
remark:undefined,
|
||||
};
|
||||
if (getLeftTreeActiveInfo) state.dataForm = {...state.dataForm, ...(getLeftTreeActiveInfo() || {}) };
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
}
|
||||
}
|
||||
function getForm() {
|
||||
const form = unref(formRef);
|
||||
if (!form) {
|
||||
throw new Error('form is null!');
|
||||
}
|
||||
return form;
|
||||
}
|
||||
function getData(id) {
|
||||
getInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
});
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
const values = await getForm()?.validate();
|
||||
if (!values) return;
|
||||
|
||||
|
||||
setFormProps({ confirmLoading: true });
|
||||
const formMethod = state.dataForm.id ? update : create;
|
||||
formMethod(state.dataForm)
|
||||
.then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
setFormProps({ confirmLoading: false });
|
||||
if (state.submitType == 1) {
|
||||
initData();
|
||||
state.isContinue = true;
|
||||
} else {
|
||||
setFormProps({ open: false });
|
||||
emit('reload');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setFormProps({ confirmLoading: false });
|
||||
});
|
||||
} catch (_) {}
|
||||
}
|
||||
function handlePrev() {
|
||||
state.currIndex--;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleNext() {
|
||||
state.currIndex++;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleGetNewInfo() {
|
||||
changeLoading(true);
|
||||
getForm().resetFields();
|
||||
const id = state.allList[state.currIndex].id;
|
||||
getData(id);
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setDrawerProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setDrawerProps({ loading });
|
||||
}
|
||||
async function onClose() {
|
||||
if (state.isContinue) emit('reload');
|
||||
return true;
|
||||
}
|
||||
|
||||
function changeData(model, index) {
|
||||
state.isEdit = false
|
||||
state.childIndex = index
|
||||
for (let key in state.interfaceRes) {
|
||||
if (key != model) {
|
||||
let faceReList = state.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
let relationField = faceReList[i].relationField;
|
||||
if(relationField){
|
||||
let modelAll = relationField.split('-');
|
||||
let faceMode = '';
|
||||
let faceMode2 = modelAll.length == 2?modelAll[0].substring(0, modelAll[0].length-4) +modelAll[1]:""
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
if (faceMode == model || faceMode2 == model ) {
|
||||
let options = 'get' + key + 'Options';
|
||||
eval(options)(true);
|
||||
changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function changeDataFormData(type, data, model,index,defaultValue) {
|
||||
if(!state.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < state.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
state.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
state.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
}
|
||||
function getRelationDate(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue: any = null;
|
||||
let timeValue = Number(timeValueData);
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue;
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime();
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).valueOf();
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
function getRelationTime(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType;
|
||||
let timeDataValue: any = null;
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00';
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue;
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00';
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = dayjs().format(format);
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget + 3);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).format(format);
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
</script>
|
||||
34
src/views/bsc/billingitem/helper/api.ts
Normal file
34
src/views/bsc/billingitem/helper/api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bc/BillingItem/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bc/BillingItem', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bc/BillingItem/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bc/BillingItem/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bc/BillingItem/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bc/BillingItem/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bc/BillingItem/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bc/BillingItem/Actions/Export', data });
|
||||
}
|
||||
303
src/views/bsc/billingitem/helper/columnList.ts
Normal file
303
src/views/bsc/billingitem/helper/columnList.ts
Normal file
@@ -0,0 +1,303 @@
|
||||
const columnList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem6d4cd8",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"计费项目编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484553554,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"unique":true,
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"billing_item_code",
|
||||
"__vModel__":"billing_item_code",
|
||||
"disabled":false,
|
||||
"id":"billing_item_code",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"计费项目编码",
|
||||
"label":"计费项目编码",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem4f4dd9",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"计费项目名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484558269,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"billing_item_name",
|
||||
"__vModel__":"billing_item_name",
|
||||
"disabled":false,
|
||||
"id":"billing_item_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"计费项目名称",
|
||||
"label":"计费项目名称",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"select",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"multiple":false,
|
||||
"fullName":"费用类别",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"费用类别",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484563169,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItema781b9",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"费用类别",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"billing_item_type",
|
||||
"width":null,
|
||||
"options":[
|
||||
{
|
||||
"fullName":"周期类",
|
||||
"id":"Recurring"
|
||||
},
|
||||
{
|
||||
"fullName":"固定金额",
|
||||
"id":"Fixed"
|
||||
},
|
||||
{
|
||||
"fullName":"单价 × 约定数量",
|
||||
"id":"UnitQty"
|
||||
},
|
||||
{
|
||||
"fullName":"单价 × 实际用量",
|
||||
"id":"Usage"
|
||||
},
|
||||
{
|
||||
"fullName":"比例费用",
|
||||
"id":"Percentage"
|
||||
},
|
||||
{
|
||||
"fullName":"条件费用",
|
||||
"id":"Conditional"
|
||||
}
|
||||
],
|
||||
"__vModel__":"billing_item_type",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"billing_item_type",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"textarea",
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"备注",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"autoSize":{
|
||||
"minRows":4,
|
||||
"maxRows":4
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem683e9d",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484793248,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"remark",
|
||||
"width":null,
|
||||
"__vModel__":"remark",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"placeholder":"请输入",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default columnList
|
||||
164
src/views/bsc/billingitem/helper/searchList.ts
Normal file
164
src/views/bsc/billingitem/helper/searchList.ts
Normal file
@@ -0,0 +1,164 @@
|
||||
const searchList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem4f4dd9",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"计费项目名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484558269,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"billing_item_name",
|
||||
"__vModel__":"billing_item_name",
|
||||
"searchMultiple":false,
|
||||
"disabled":false,
|
||||
"id":"billing_item_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"searchType":2,
|
||||
"maxlength":null,
|
||||
"fullName":"计费项目名称",
|
||||
"label":"计费项目名称",
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"isKeyword":false,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"select",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"searchType":1,
|
||||
"multiple":false,
|
||||
"fullName":"费用类别",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"费用类别",
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484563169,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItema781b9",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"费用类别",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"billing_item_type",
|
||||
"options":[
|
||||
{
|
||||
"fullName":"周期类",
|
||||
"id":"Recurring"
|
||||
},
|
||||
{
|
||||
"fullName":"固定金额",
|
||||
"id":"Fixed"
|
||||
},
|
||||
{
|
||||
"fullName":"单价 × 约定数量",
|
||||
"id":"UnitQty"
|
||||
},
|
||||
{
|
||||
"fullName":"单价 × 实际用量",
|
||||
"id":"Usage"
|
||||
},
|
||||
{
|
||||
"fullName":"比例费用",
|
||||
"id":"Percentage"
|
||||
},
|
||||
{
|
||||
"fullName":"条件费用",
|
||||
"id":"Conditional"
|
||||
}
|
||||
],
|
||||
"__vModel__":"billing_item_type",
|
||||
"searchMultiple":true,
|
||||
"isKeyword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"billing_item_type",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default searchList
|
||||
267
src/views/bsc/billingitem/helper/superQueryJson.ts
Normal file
267
src/views/bsc/billingitem/helper/superQueryJson.ts
Normal file
@@ -0,0 +1,267 @@
|
||||
const superQueryJson = [
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"计费项目编码",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem6d4cd8",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"计费项目编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484553554,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"unique":true,
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"billing_item_code",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"billing_item_code",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"计费项目名称",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem4f4dd9",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"计费项目名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484558269,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"billing_item_name",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"billing_item_name",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"费用类别",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484563169,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItema781b9",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"费用类别",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[
|
||||
{
|
||||
"fullName":"周期类",
|
||||
"id":"Recurring"
|
||||
},
|
||||
{
|
||||
"fullName":"固定金额",
|
||||
"id":"Fixed"
|
||||
},
|
||||
{
|
||||
"fullName":"单价 × 约定数量",
|
||||
"id":"UnitQty"
|
||||
},
|
||||
{
|
||||
"fullName":"单价 × 实际用量",
|
||||
"id":"Usage"
|
||||
},
|
||||
{
|
||||
"fullName":"比例费用",
|
||||
"id":"Percentage"
|
||||
},
|
||||
{
|
||||
"fullName":"条件费用",
|
||||
"id":"Conditional"
|
||||
}
|
||||
],
|
||||
"__vModel__":"billing_item_type",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"billing_item_type",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"autoSize":{
|
||||
"minRows":4,
|
||||
"maxRows":4
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem683e9d",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_billing_item",
|
||||
"renderKey":1778484793248,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"__vModel__":"remark",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"placeholder":"请输入",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default superQueryJson
|
||||
673
src/views/bsc/billingitem/index.vue
Normal file
673
src/views/bsc/billingitem/index.vue
Normal file
@@ -0,0 +1,673 @@
|
||||
<template>
|
||||
<div class="yunzhupaas-content-wrapper">
|
||||
<div class="yunzhupaas-content-wrapper-center">
|
||||
<div class="yunzhupaas-content-wrapper-search-box" v-if="getSearchList.length">
|
||||
<BasicForm @register="registerSearchForm" :schemas="getSearchList"
|
||||
@advanced-change="redoHeight" @submit="handleSearchSubmit" @reset="handleSearchReset"
|
||||
class="search-form">
|
||||
</BasicForm>
|
||||
</div>
|
||||
<div class="yunzhupaas-content-wrapper-content bg-white">
|
||||
<BasicTable @register="registerTable" v-bind="getTableBindValue" ref="tableRef"
|
||||
@columns-change="handleColumnChange">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" v-auth="'btn_add'"
|
||||
@click="addHandle()"> {{t('common.add2Text','新增')}}</a-button>
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-download" v-auth="'btn_download'"
|
||||
@click="openExportModal(true, { columnList: state.exportList, selectIds: getSelectRowKeys(), showExportSelected: true })"> {{t('common.exportText','导出')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
<template #title>
|
||||
<span>{{ t('common.superQuery') }}</span>
|
||||
</template>
|
||||
<filter-outlined @click="openSuperQuery(true, { columnOptions: superQueryJson })" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #toolbarAfter>
|
||||
<ViewList :menuId="route.meta.modelId" :viewList="viewList" @itemClick="handleViewClick" @reload="initViewList" />
|
||||
<ViewSetting :menuId="route.meta.modelId" :viewList="viewList" :currentView="currentView" @reload="initViewList" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-for="(item, index) in childColumnList" v-if="childColumnList.length">
|
||||
<template
|
||||
v-if="column?.id?.includes('-') && item.children && item.children[0] && column.key === item.children[0]?.dataIndex">
|
||||
<ChildTableColumn :data="record[item.prop]" :head="item.children"
|
||||
@toggleExpand="toggleExpand(record, item.prop+`Expand`)" @toDetail="toDetail"
|
||||
:expand="record[item.prop+`Expand`]" :key="index" :showOverflow="true "/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="!(record.top || column.id?.includes('-'))">
|
||||
<template v-if="column.yunzhupaasKey === 'relationForm'">
|
||||
<p class="link-text"
|
||||
@click="toDetail(column.modelId, record[column.dataIndex+`_id`], column.propsValue)">
|
||||
{{ record[column.dataIndex] }}</p>
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'inputNumber'">
|
||||
<yunzhupaas-input-number v-model:value="record[column.prop]" :precision="column.precision" :thousands="column.thousands" disabled detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'calculate'">
|
||||
<yunzhupaas-calculate
|
||||
v-model:value="record[column.prop]"
|
||||
:isStorage="column.isStorage"
|
||||
:precision="column.precision"
|
||||
:thousands="column.thousands"
|
||||
detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'sign'">
|
||||
<yunzhupaas-sign v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'signature'">
|
||||
<yunzhupaas-signature v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'rate'">
|
||||
<yunzhupaas-rate v-model:value="record[column.prop]" :count="column.count" :allowHalf="column.allowHalf" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'slider'">
|
||||
<yunzhupaas-slider v-model:value="record[column.prop]" :min="column.min" :max="column.max" :step="column.step" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadImg'">
|
||||
<yunzhupaas-upload-img v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadFile'">
|
||||
<yunzhupaas-upload-file v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'input'">
|
||||
<yunzhupaas-input
|
||||
v-model:value="record[column.prop]"
|
||||
:useMask="column.useMask"
|
||||
:maskConfig="column.maskConfig"
|
||||
:showOverflow="true"
|
||||
detailed />
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'action' && !record.top">
|
||||
<TableAction :actions="getTableActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
<Form ref="formRef" @reload="reload" />
|
||||
<Detail ref="detailRef" />
|
||||
<ExportModal @register="registerExportModal" @download="handleDownload" />
|
||||
<ImportModal @register="registerImportModal" @reload="reload" />
|
||||
<PrintSelect @register="registerPrintSelect" @change="handleShowBrowse" />
|
||||
<PrintBrowse @register="registerPrintBrowse" />
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<SuperQueryModal @register="registerSuperQueryModal" @superQuery="handleSuperQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { getList, del, exportData, batchDelete } from './helper/api';
|
||||
import { getConfigData,getViewList } from '@/api/onlineDev/visualDev';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import { getOrgByOrganizeCondition,getDepartmentSelectAsyncList } from '@/api/permission/organize';
|
||||
import { ref, reactive, onMounted, toRefs, computed, unref, nextTick, toRaw, provide } from 'vue';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useOrganizeStore } from '@/store/modules/organize';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { usePopup } from '@/components/Popup';
|
||||
import { ScrollContainer } from '@/components/Container';
|
||||
import { BasicLeftTree, TreeActionType } from '@/components/Tree';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { BasicTable, useTable, TableAction, ActionItem, TableActionType, SorterResult } from '@/components/Table';
|
||||
import { SuperQueryModal } from '@/components/CommonModal';
|
||||
import Form from './Form.vue';
|
||||
import Detail from './Detail.vue';
|
||||
// 有关联表单详情:开始
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 有关联表单详情:结束
|
||||
import ChildTableColumn from '@/views/common/dynamicModel/list/ChildTableColumn.vue';
|
||||
import { ExportModal } from '@/components/CommonModal';
|
||||
import { downloadByUrl } from '@/utils/file/download';
|
||||
import { ImportModal} from '@/components/CommonModal';
|
||||
// 打印模板多条生成PrintSelect
|
||||
import PrintSelect from '@/components/PrintDesign/printSelect/index.vue';
|
||||
import PrintBrowse from '@/components/PrintDesign/printBrowse/index.vue';
|
||||
import { useRoute,useRouter } from 'vue-router';
|
||||
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||
import { getSearchFormSchemas } from '@/components/FormGenerator/src/helper/transform';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import columnList from './helper/columnList';
|
||||
import searchList from './helper/searchList';
|
||||
import superQueryJson from './helper/superQueryJson';
|
||||
import { dyOptionsList, systemComponentsList } from '@/components/FormGenerator/src/helper/config';
|
||||
import { thousandsFormat, getParamList} from '@/utils/yunzhupaas';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
|
||||
import ViewSetting from '@/views/common/dynamicModel/list/components/ViewSetting.vue';
|
||||
import ViewList from '@/views/common/dynamicModel/list/components/ViewList.vue';
|
||||
|
||||
interface State {
|
||||
config: any;
|
||||
columnList: any[];
|
||||
printListOptions: any[];
|
||||
columnBtnsList: any[];
|
||||
customBtnsList: any[];
|
||||
treeFieldNames: any;
|
||||
leftTreeData: any[];
|
||||
leftTreeLoading: boolean;
|
||||
treeActiveId: string;
|
||||
treeActiveNodePath: any;
|
||||
columns: any[];
|
||||
complexColumns: any[];
|
||||
childColumnList: any[];
|
||||
exportList: any[];
|
||||
cacheList: any[];
|
||||
currFlow: any;
|
||||
isCustomCopy: boolean;
|
||||
candidateType: number;
|
||||
currRow: any;
|
||||
workFlowFormData: any;
|
||||
expandObj: any;
|
||||
columnSettingList: any[];
|
||||
searchSchemas: any[];
|
||||
treeRelationObj: any;
|
||||
treeQueryJson: any;
|
||||
leftTreeActiveInfo: any;
|
||||
keyword: string;
|
||||
viewList: any[];
|
||||
currentView: any;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const { hasBtnP } = usePermission();
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const organizeStore = useOrganizeStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const [registerExportModal, { openModal: openExportModal, closeModal: closeExportModal, setModalProps: setExportModalProps }] = useModal();
|
||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||
const [registerSuperQueryModal, { openModal: openSuperQuery }] = useModal();
|
||||
const formRef = ref<any>(null);
|
||||
const tableRef = ref<Nullable<TableActionType>>(null);
|
||||
const detailRef = ref<any>(null);
|
||||
const relationDetailRef = ref<any>(null);
|
||||
|
||||
const state = reactive<State>({
|
||||
config: {},
|
||||
columnList: [],
|
||||
printListOptions: [],
|
||||
columnBtnsList: [],
|
||||
customBtnsList: [],
|
||||
treeFieldNames: {
|
||||
children: 'children' ,
|
||||
title: 'fullName' ,
|
||||
key: 'id' ,
|
||||
isLeaf: 'isLeaf',
|
||||
},
|
||||
leftTreeData: [],
|
||||
leftTreeLoading: false,
|
||||
treeActiveId: '',
|
||||
treeActiveNodePath: [],
|
||||
columns: [],
|
||||
complexColumns: [], // 复杂表头
|
||||
childColumnList: [],
|
||||
exportList: [],
|
||||
cacheList: [],
|
||||
currFlow: {},
|
||||
isCustomCopy: false,
|
||||
candidateType: 1,
|
||||
currRow: {},
|
||||
workFlowFormData: {},
|
||||
expandObj: {},
|
||||
columnSettingList: [],
|
||||
searchSchemas: [],
|
||||
treeRelationObj: null,
|
||||
treeQueryJson: {},
|
||||
leftTreeActiveInfo: {},
|
||||
keyword: '',
|
||||
viewList: [],
|
||||
currentView: {},
|
||||
});
|
||||
const defaultSearchInfo = {
|
||||
menuId: route.meta.modelId as string,
|
||||
moduleId:'823544899306521605',
|
||||
superQueryJson: '',
|
||||
dataType:0,
|
||||
};
|
||||
const searchInfo = reactive({
|
||||
...cloneDeep(defaultSearchInfo),
|
||||
});
|
||||
const { childColumnList, searchSchemas, viewList, currentView} = toRefs(state);
|
||||
const [registerSearchForm, { updateSchema, resetFields, submit: searchFormSubmit, setFieldsValue}] = useForm({
|
||||
baseColProps: { span: 6 },
|
||||
showActionButtonGroup: true,
|
||||
showAdvancedButton: true,
|
||||
compact: true,
|
||||
});
|
||||
const [registerTable, { reload, setLoading, getFetchParams, getSelectRows, getSelectRowKeys, redoHeight,clearSelectedRowKeys }] = useTable({
|
||||
api: getList,
|
||||
immediate: false,
|
||||
clickToRowSelect: false,
|
||||
tableSetting: { setting: false },
|
||||
afterFetch: (data) => {
|
||||
const list = data.map((o) => ({
|
||||
...o,
|
||||
...state.expandObj,
|
||||
}));
|
||||
state.cacheList = cloneDeep(list);
|
||||
return list;
|
||||
},
|
||||
});
|
||||
const [registerChildTable] = useTable({
|
||||
pagination: false,
|
||||
canResize: false,
|
||||
showTableSetting: false,
|
||||
});
|
||||
|
||||
provide('getLeftTreeActiveInfo', () => state.leftTreeActiveInfo);
|
||||
|
||||
const getHasBatchBtn = computed(() => {
|
||||
let btnsList =[]
|
||||
btnsList.push('download')
|
||||
btnsList=btnsList.filter(o => hasBtnP('btn_' + o))
|
||||
return !!btnsList.length
|
||||
});
|
||||
|
||||
|
||||
const getColumns = computed(() => {
|
||||
const columns = state.complexColumns;
|
||||
return setListValue(state.currentView?.columnList, columns, 'prop');
|
||||
});
|
||||
const getSearchList = computed(() => {
|
||||
const searchSchemas = cloneDeep(state.searchSchemas).map(o => ({ ...o, show: true }));
|
||||
return setListValue(state.currentView?.searchList, searchSchemas, 'field');
|
||||
});
|
||||
const getTableBindValue = computed(() => {
|
||||
let columns = unref(getColumns);
|
||||
const defaultSortConfig= [];
|
||||
const sortField = defaultSortConfig.map(o => (o.sort === 'desc' ? '-' : '') + o.field);
|
||||
const data: any = {
|
||||
pagination: { pageSize: 20 }, //有分页
|
||||
searchInfo: unref(searchInfo),
|
||||
defSort: { sidx: sortField.join(',') },
|
||||
sortFn: (sortInfo: SorterResult | SorterResult[]) => {
|
||||
if (Array.isArray(sortInfo)) {
|
||||
const sortList = sortInfo.map(o => (o.order === 'descend' ? '-' : '') + o.field);
|
||||
return { sidx: sortList.join(',') };
|
||||
} else {
|
||||
const { field, order } = sortInfo;
|
||||
if (field && order) {
|
||||
// 排序字段
|
||||
return { sidx: (order === 'descend' ? '-' : '') + field };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
ellipsis:true ,
|
||||
columns,
|
||||
bordered: true,
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
title: t('component.table.action'),
|
||||
dataIndex: 'action',
|
||||
},
|
||||
};
|
||||
if (unref(getHasBatchBtn)) {
|
||||
const rowSelection: any = { type: 'checkbox' };
|
||||
data.rowSelection = rowSelection;
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
function init() {
|
||||
state.config = {};
|
||||
searchInfo.menuId = route.meta.modelId as string;
|
||||
state.columnList = columnList;
|
||||
setLoading(true);
|
||||
getSearchSchemas();
|
||||
getColumnList();
|
||||
initViewList();
|
||||
nextTick(() => {
|
||||
unref(getSearchList)?.length ? searchFormSubmit() : reload({ page: 1 });
|
||||
});
|
||||
}
|
||||
function getSearchSchemas() {
|
||||
|
||||
const schemas = getSearchFormSchemas(searchList);
|
||||
state.searchSchemas = schemas;
|
||||
schemas.forEach((cur) => {
|
||||
const config = cur.__config__;
|
||||
if (dyOptionsList.includes(config.yunzhupaasKey)) {
|
||||
if (config.dataType === 'dictionary') {
|
||||
if (!config.dictionaryType) return;
|
||||
getDictionaryDataSelector(config.dictionaryType).then((res) => {
|
||||
updateSchema([{ field: cur.field, componentProps: { options: res.data.list } }]);
|
||||
});
|
||||
}
|
||||
if (config.dataType === 'dynamic') {
|
||||
if (!config.propsUrl) return;
|
||||
const query = { paramList: getParamList(config.templateJson) };
|
||||
getDataInterfaceRes(config.propsUrl, query).then((res) => {
|
||||
const data = Array.isArray(res.data) ? res.data : [];
|
||||
updateSchema([{ field: cur.field, componentProps: { options: data } }]);
|
||||
});
|
||||
}
|
||||
}
|
||||
cur.defaultValue = cur.value;
|
||||
});
|
||||
}
|
||||
function getColumnList() {
|
||||
// 没有开启列表权限
|
||||
let columnList = state.columnList;
|
||||
state.exportList = columnList;
|
||||
let columns = columnList.map((o) => ({
|
||||
...o,
|
||||
title: o.labelI18nCode ? t(o.labelI18nCode, o.label) : o.label,
|
||||
dataIndex: o.prop,
|
||||
align: o.align,
|
||||
fixed: o.fixed == 'none' ? false : o.fixed,
|
||||
sorter: o.sortable ? { multiple: 1 } : o.sortable,
|
||||
width: o.width || 100,
|
||||
}));
|
||||
//添加复杂表头
|
||||
columns = getComplexColumns(columns);
|
||||
state.columns = columns.filter((o) => o.prop.indexOf('-') < 0);
|
||||
//子表表头
|
||||
getChildComplexColumns(columns);
|
||||
}
|
||||
|
||||
|
||||
//复杂表头
|
||||
function getComplexColumns(columns) {
|
||||
//这里生成复杂表头的配置
|
||||
let complexHeaderList: any[] = [];
|
||||
if (!complexHeaderList.length) return columns;
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.label = e.fullName;
|
||||
e.labelI18nCode = e.fullNameI18nCode;
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.dataIndex = e.id;
|
||||
e.prop = e.id;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < columns.length; j++) {
|
||||
const o = columns[j];
|
||||
if (o.prop == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].prop);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
const e = columns[i];
|
||||
if (!childColumns.includes(e.prop)) {
|
||||
list.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.prop)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.prop));
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//子表表头
|
||||
function getChildComplexColumns(columnList) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i];
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e);
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0];
|
||||
let vModel = e.prop.split('-')[1];
|
||||
let label = e.label.split('-')[0];
|
||||
let childLabel = e.label.replace(label + '-', '');
|
||||
if (e.fullNameI18nCode && Array.isArray(e.fullNameI18nCode) && e.fullNameI18nCode[0]) label = t(e.fullNameI18nCode[0], label);
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
yunzhupaasKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
title: label,
|
||||
dataIndex: prop,
|
||||
children: [],
|
||||
};
|
||||
e.dataIndex = vModel;
|
||||
e.title = e.labelI18nCode ? t(e.labelI18nCode, childLabel) : childLabel;
|
||||
if (!state.expandObj.hasOwnProperty(prop+`Expand`)) state.expandObj[prop+`Expand`] = false;
|
||||
if (!list.some((o) => o.prop === prop)) list.push(newItem);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 行内分组展示
|
||||
getMergeList(list);
|
||||
|
||||
state.complexColumns = list;
|
||||
state.childColumnList = list.filter((o) => o.yunzhupaasKey === 'table');
|
||||
|
||||
// 子表分组展示宽度取100
|
||||
for (let i = 0; i < state.childColumnList.length; i++) {
|
||||
const e = state.childColumnList[i];
|
||||
if (e.children?.length) e.children = e.children.map(o => ({ ...o, width: 100 }));
|
||||
}
|
||||
}
|
||||
function getMergeList(list) {
|
||||
list.forEach((item) => {
|
||||
if (item.yunzhupaasKey === 'table' && item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
child.customCell = () => ({
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
class: 'child-table-box',
|
||||
});
|
||||
} else {
|
||||
child.customCell = () => ({
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleExpand(row, field) {
|
||||
row[field] = !row[field];
|
||||
}
|
||||
// 关联表单查看详情
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function handleColumnChange(data) {
|
||||
state.columnSettingList = data;
|
||||
}
|
||||
function getTableActions(record): ActionItem[] {
|
||||
return [
|
||||
{
|
||||
label: t('common.editText','编辑') ,
|
||||
onClick: updateHandle.bind(null, record),
|
||||
auth: 'btn_edit', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.delText','删除') ,
|
||||
color: 'error',
|
||||
modelConfirm: {
|
||||
onOk: handleDelete.bind(null, record.id),
|
||||
},
|
||||
auth: 'btn_remove', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.detailText','详情') ,
|
||||
onClick: goDetail.bind(null, record),
|
||||
auth: 'btn_detail', //有按钮权限
|
||||
},
|
||||
];
|
||||
}
|
||||
// 编辑
|
||||
function updateHandle(record) {
|
||||
// 不带工作流
|
||||
const data = {
|
||||
id: record.id,
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 删除
|
||||
function handleDelete(id) {
|
||||
const query={ids:[id] }
|
||||
batchDelete(query).then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
});
|
||||
}
|
||||
// 查看详情
|
||||
function goDetail(record) {
|
||||
// 不带流程
|
||||
const data = {
|
||||
id: record.id,
|
||||
};
|
||||
detailRef.value?.init(data);
|
||||
}
|
||||
// 新增
|
||||
function addHandle() {
|
||||
// 不带流程新增
|
||||
const data = {
|
||||
id: '',
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 导出
|
||||
function handleDownload(data) {
|
||||
let query = { ...getFetchParams(), ...data };
|
||||
exportData(query)
|
||||
.then((res) => {
|
||||
setExportModalProps({ confirmLoading: false });
|
||||
if (!res.data.url) return;
|
||||
downloadByUrl({ url: res.data.url });
|
||||
closeExportModal();
|
||||
})
|
||||
.catch(() => {
|
||||
setExportModalProps({ confirmLoading: false });
|
||||
});
|
||||
}
|
||||
// 高级查询
|
||||
function handleSuperQuery(superQueryJson) {
|
||||
searchInfo.superQueryJson = superQueryJson;
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function handleSearchReset() {
|
||||
clearSelectedRowKeys();
|
||||
if (!state.resetFromTree) updateSearchFormValue();
|
||||
if (state.resetFromTree) state.resetFromTree = false;
|
||||
}
|
||||
|
||||
function handleSearchSubmit(data) {
|
||||
clearSelectedRowKeys();
|
||||
let obj = {
|
||||
...defaultSearchInfo,
|
||||
superQueryJson: searchInfo.superQueryJson,
|
||||
...data,
|
||||
};
|
||||
Object.keys(searchInfo).map(key => {
|
||||
delete searchInfo[key];
|
||||
});
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
searchInfo[key.replaceAll('-', '_')] = value;
|
||||
}
|
||||
console.log(searchInfo);
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function updateSearchFormValue() {
|
||||
if (!state.treeActiveId) return searchFormSubmit();
|
||||
let queryJson: any = {};
|
||||
let leftTreeActiveInfo: any = {};
|
||||
const isMultiple = !state.treeRelationObj ? false : state.treeRelationObj.searchMultiple;
|
||||
//多级左侧树,需要拼父级->转为查询参数
|
||||
if (state.treeRelationObj && state.treeRelationObj.yunzhupaasKey && ['organizeSelect', 'cascader', 'areaSelect'].includes(state.treeRelationObj.yunzhupaasKey)) {
|
||||
let currValue = [];
|
||||
currValue = state.treeActiveNodePath.map(o => o[state.treeFieldNames.key]);
|
||||
queryJson = { '': isMultiple ? [currValue] : currValue };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [currValue] : currValue };
|
||||
} else {
|
||||
queryJson = { '': isMultiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
}
|
||||
state.leftTreeActiveInfo = leftTreeActiveInfo;
|
||||
if(unref(getSearchList)?.length){
|
||||
// 有搜索列表
|
||||
setFieldsValue(queryJson);
|
||||
searchFormSubmit();
|
||||
}else{
|
||||
// 无搜索列表
|
||||
handleSearchSubmit(queryJson);
|
||||
}
|
||||
}
|
||||
function initViewList(currentId = '') {
|
||||
const query = {
|
||||
menuId: route.meta.modelId,
|
||||
};
|
||||
getViewList(query).then(res => {
|
||||
const columns : any[]= state.complexColumns;
|
||||
const searchList: any[] = state.searchSchemas.map(o => ({ label: o.label, id: o.field, show: o.show, labelI18nCode: o.labelI18nCode }));
|
||||
const columnList: any[] = columns.map(o => ({ label: o.label, id: o.prop, show: true, fixed: o.fixed || 'none', labelI18nCode: o.labelI18nCode }));
|
||||
state.viewList = (res.data || []).map(o => {
|
||||
if (o.type == 0) return { ...o, searchList, columnList };
|
||||
return { ...o, searchList: o.searchList ? JSON.parse(o.searchList) : [], columnList: o.columnList ? JSON.parse(o.columnList) : [] };
|
||||
});
|
||||
if (currentId) {
|
||||
state.currentView = state.viewList.filter(o => o.id === currentId)[0] || state.viewList[0];
|
||||
} else {
|
||||
state.currentView = state.viewList.filter(o => o.status === 1)[0] || state.viewList[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleViewClick(item) {
|
||||
state.currentView = item;
|
||||
}
|
||||
|
||||
function setListValue(data: any[] = [], defaultData: any[] = [], key) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
for (let j = 0; j < defaultData.length; j++) {
|
||||
if (data[i].show && data[i].id == defaultData[j][key]) list.push(defaultData[j]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
182
src/views/bsc/projecttype/Detail.vue
Normal file
182
src/views/bsc/projecttype/Detail.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" :title="title" width="600px" showFooter
|
||||
:showOkBtn="false">
|
||||
<template #insertFooter>
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form ">
|
||||
<!-- 表单 -->
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" ref="formRef" >
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="project_type_code" >
|
||||
<template #label>项目分类编码
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.project_type_code"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.project_type_code" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="project_type_name" >
|
||||
<template #label>项目分类名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.project_type_name"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.project_type_name" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="pid" >
|
||||
<template #label>上级项目分类
|
||||
</template> <p>{{dataForm.pid}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="seq_num" >
|
||||
<template #label>顺序号
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.seq_num"
|
||||
placeholder="请输入" disabled
|
||||
detailed :style='{"width":"100%"}' :step="1" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remark" >
|
||||
<template #label>备注
|
||||
</template> <YunzhupaasUploadFile v-model:value="dataForm.remark"
|
||||
disabled
|
||||
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" timeFormat="YYYY" buttonText="点击上传" >
|
||||
</YunzhupaasUploadFile>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicDrawer>
|
||||
<!-- 有关联表单详情:开始 -->
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<!-- 有关联表单详情:结束 -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getDetailInfo } from './helper/api';
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev';
|
||||
import { reactive, toRefs, nextTick, ref, computed, unref ,toRaw} from 'vue';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { BasicDrawer, useDrawer } from '@/components/Drawer';
|
||||
// 有关联表单详情
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { getDataChange } from '@/api/onlineDev/visualDev';
|
||||
import { getDataInterfaceDataInfoByIds } from '@/api/systemData/dataInterface';
|
||||
import ExtraRelationInfo from '@/components/yunzhupaas/RelationForm/src/ExtraRelationInfo.vue';
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
title: string;
|
||||
maskConfig: any;
|
||||
interfaceRes: any;
|
||||
locationScope: any;
|
||||
extraOptions: any;
|
||||
extraData: any;
|
||||
|
||||
}
|
||||
|
||||
defineOptions({ name: 'Detail' });
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const [registerDrawer, { openDrawer, setDrawerProps, closeDrawer }] = useDrawer();
|
||||
|
||||
const { t } = useI18n();
|
||||
const relationDetailRef = ref<any>(null);
|
||||
const state = reactive<State>({
|
||||
dataForm:{},
|
||||
title: t('common.detailText','详情'),
|
||||
maskConfig:{
|
||||
project_type_code: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
project_type_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
}
|
||||
,
|
||||
interfaceRes: {"pid":[],"remark":[],"project_type_name":[],"seq_num":[],"project_type_code":[]},
|
||||
locationScope:{
|
||||
}
|
||||
,
|
||||
extraOptions: {
|
||||
}
|
||||
,
|
||||
extraData: {
|
||||
}
|
||||
,
|
||||
});
|
||||
const { title, dataForm, maskConfig } = toRefs(state);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.dataForm.id = data.id;
|
||||
openDrawer();
|
||||
nextTick(() => {
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
closeDrawer();
|
||||
}
|
||||
}
|
||||
function getData(id) {
|
||||
getDetailInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
nextTick(() => {
|
||||
changeLoading(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setDrawerProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setFormProps({ loading });
|
||||
}
|
||||
|
||||
function getParamList(key) {
|
||||
let templateJson: any[] = state.interfaceRes[key];
|
||||
if (!templateJson || !templateJson.length || !state.dataForm) return templateJson;
|
||||
for (let i = 0; i < templateJson.length; i++) {
|
||||
if (templateJson[i].relationField && templateJson[i].sourceType == 1) {
|
||||
templateJson[i].defaultValue = state.dataForm[templateJson[i].relationField + '_id'] || '';
|
||||
}
|
||||
}
|
||||
return templateJson;
|
||||
}
|
||||
</script>
|
||||
443
src/views/bsc/projecttype/Form.vue
Normal file
443
src/views/bsc/projecttype/Form.vue
Normal file
@@ -0,0 +1,443 @@
|
||||
<template>
|
||||
<BasicDrawer
|
||||
v-bind="$attrs"
|
||||
@register="registerDrawer"
|
||||
width="600px"
|
||||
showFooter
|
||||
:cancelText="t('common.cancelText', '取消')"
|
||||
:okText="t('common.okText', '确定')"
|
||||
@ok="handleSubmit"
|
||||
:closeFunc="onClose">
|
||||
<template #title>
|
||||
<a-space :size="10">
|
||||
<div class="text-16px font-medium">{{ title }}</div>
|
||||
</a-space>
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form">
|
||||
<!-- 表单 -->
|
||||
<a-form
|
||||
:colon="false"
|
||||
size="middle"
|
||||
layout="horizontal"
|
||||
labelAlign="right"
|
||||
:labelCol="{ style: { width: '100px' } }"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="formRef">
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="project_type_code">
|
||||
<template #label>项目分类编码 </template>
|
||||
<YunzhupaasInput
|
||||
v-model:value="dataForm.project_type_code"
|
||||
@change="changeData('project_type_code', -1)"
|
||||
placeholder="请输入"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:maskConfig="maskConfig.project_type_code"
|
||||
:showCount="false">
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="project_type_name">
|
||||
<template #label>项目分类名称 </template>
|
||||
<YunzhupaasInput
|
||||
v-model:value="dataForm.project_type_name"
|
||||
@change="changeData('project_type_name', -1)"
|
||||
placeholder="请输入"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:maskConfig="maskConfig.project_type_name"
|
||||
:showCount="false">
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="pid">
|
||||
<template #label>上级项目分类 </template>
|
||||
<YunzhupaasTreeSelect
|
||||
v-model:value="dataForm.pid"
|
||||
@change="changeData('pid', -1)"
|
||||
placeholder="请选择"
|
||||
:templateJson="state.interfaceRes.pid"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:showSearch="false"
|
||||
:options="optionsObj.pidOptions"
|
||||
:fieldNames="optionsObj.pidProps">
|
||||
</YunzhupaasTreeSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="seq_num">
|
||||
<template #label>顺序号 </template>
|
||||
<YunzhupaasInputNumber
|
||||
v-model:value="dataForm.seq_num"
|
||||
@change="changeData('seq_num', -1)"
|
||||
placeholder="请输入"
|
||||
:style="{ width: '100%' }"
|
||||
:step="1"
|
||||
:controls="false">
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="remark">
|
||||
<template #label>备注 </template>
|
||||
<YunzhupaasUploadFile
|
||||
v-model:value="dataForm.remark"
|
||||
@change="changeData('remark', -1)"
|
||||
:fileSize="10"
|
||||
sizeUnit="MB"
|
||||
:limit="9"
|
||||
pathType="defaultPath"
|
||||
timeFormat="YYYY"
|
||||
buttonText="点击上传">
|
||||
</YunzhupaasUploadFile>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { create, update, getInfo,getTreeList } from './helper/api';
|
||||
import { reactive, toRefs, nextTick, ref, unref, computed, toRaw, inject } from 'vue';
|
||||
import { BasicDrawer, useDrawer } from '@/components/Drawer';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import type { FormInstance } from 'ant-design-vue';
|
||||
import { thousandsFormat, getDateTimeUnit, getTimeUnit } from '@/utils/yunzhupaas';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import dayjs from 'dayjs';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
tableRows: any;
|
||||
dataRule: any;
|
||||
optionsObj: any;
|
||||
childIndex: any;
|
||||
isEdit: any;
|
||||
interfaceRes: any;
|
||||
//可选范围默认值
|
||||
ableAll: any;
|
||||
//掩码配置
|
||||
maskConfig: any;
|
||||
//定位属性
|
||||
locationScope: any;
|
||||
extraOptions: any;
|
||||
title: string;
|
||||
continueText: string;
|
||||
allList: any[];
|
||||
currIndex: number;
|
||||
isContinue: boolean;
|
||||
submitType: number;
|
||||
showContinueBtn: boolean;
|
||||
}
|
||||
|
||||
const emit = defineEmits(['reload']);
|
||||
const getLeftTreeActiveInfo: (() => any) | null = inject('getLeftTreeActiveInfo', null);
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const [registerDrawer, { openDrawer, setDrawerProps }] = useDrawer();
|
||||
const formRef = ref<FormInstance>();
|
||||
const state = reactive<State>({
|
||||
dataForm: {
|
||||
project_type_code: undefined,
|
||||
project_type_name: undefined,
|
||||
pid: undefined,
|
||||
seq_num: undefined,
|
||||
remark: [],
|
||||
},
|
||||
|
||||
tableRows: {},
|
||||
|
||||
dataRule: {
|
||||
project_type_code: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
project_type_name: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
seq_num: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: ["blur","change"]
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
optionsObj: {
|
||||
pidOptions: [],
|
||||
pidProps: { label: 'projectTypeName', value: 'projectTypeId', children: 'children' },
|
||||
},
|
||||
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: { pid: [], remark: [], project_type_name: [], seq_num: [], project_type_code: [] },
|
||||
//可选范围默认值
|
||||
ableAll: {},
|
||||
|
||||
//掩码配置
|
||||
maskConfig: {
|
||||
project_type_code: {
|
||||
prefixType: 1,
|
||||
useUnrealMask: false,
|
||||
maskType: 1,
|
||||
unrealMaskLength: 1,
|
||||
prefixLimit: 0,
|
||||
suffixLimit: 0,
|
||||
filler: '*',
|
||||
prefixSpecifyChar: '',
|
||||
suffixType: 1,
|
||||
ignoreChar: '',
|
||||
suffixSpecifyChar: '',
|
||||
},
|
||||
project_type_name: {
|
||||
prefixType: 1,
|
||||
useUnrealMask: false,
|
||||
maskType: 1,
|
||||
unrealMaskLength: 1,
|
||||
prefixLimit: 0,
|
||||
suffixLimit: 0,
|
||||
filler: '*',
|
||||
prefixSpecifyChar: '',
|
||||
suffixType: 1,
|
||||
ignoreChar: '',
|
||||
suffixSpecifyChar: '',
|
||||
},
|
||||
},
|
||||
|
||||
//定位属性
|
||||
locationScope: {},
|
||||
|
||||
extraOptions: {},
|
||||
|
||||
title: '',
|
||||
continueText: '',
|
||||
allList: [],
|
||||
currIndex: 0,
|
||||
isContinue: false,
|
||||
submitType: 0,
|
||||
showContinueBtn: true,
|
||||
});
|
||||
const { title, continueText, showContinueBtn, dataRule, dataForm, optionsObj, ableAll, maskConfig, submitType } = toRefs(state);
|
||||
|
||||
const getPrevDisabled = computed(() => state.currIndex === 0);
|
||||
const getNextDisabled = computed(() => state.currIndex === state.allList.length - 1);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.submitType = 0;
|
||||
state.isContinue = false;
|
||||
state.title = !data.id ? t('common.add2Text', '新增') : t('common.editText', '编辑');
|
||||
state.continueText = !data.id ? t('common.continueAndAddText', '确定并新增') : t('common.continueText', '确定并继续');
|
||||
setFormProps({ continueLoading: false });
|
||||
state.dataForm.id = data.id;
|
||||
openDrawer();
|
||||
state.allList = data.allList;
|
||||
state.currIndex = state.allList.length && data.id ? state.allList.findIndex(item => item.id === data.id) : 0;
|
||||
nextTick(() => {
|
||||
getForm().resetFields();
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
TreeList()
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
//初始化options
|
||||
|
||||
// 设置默认值
|
||||
state.dataForm = {
|
||||
project_type_code: undefined,
|
||||
project_type_name: undefined,
|
||||
pid: undefined,
|
||||
seq_num: undefined,
|
||||
remark: [],
|
||||
};
|
||||
if (getLeftTreeActiveInfo) state.dataForm = { ...state.dataForm, ...(getLeftTreeActiveInfo() || {}) };
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
}
|
||||
}
|
||||
function TreeList(){
|
||||
getTreeList().then(res => {
|
||||
state.optionsObj.pidOptions = res.data || [];
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
function getForm() {
|
||||
const form = unref(formRef);
|
||||
if (!form) {
|
||||
throw new Error('form is null!');
|
||||
}
|
||||
return form;
|
||||
}
|
||||
function getData(id) {
|
||||
getInfo(id).then(res => {
|
||||
state.dataForm = res.data || {};
|
||||
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
});
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
const values = await getForm()?.validate();
|
||||
if (!values) return;
|
||||
|
||||
setFormProps({ confirmLoading: true });
|
||||
const formMethod = state.dataForm.id ? update : create;
|
||||
formMethod(state.dataForm)
|
||||
.then(res => {
|
||||
createMessage.success(res.msg);
|
||||
setFormProps({ confirmLoading: false });
|
||||
if (state.submitType == 1) {
|
||||
initData();
|
||||
state.isContinue = true;
|
||||
} else {
|
||||
setFormProps({ open: false });
|
||||
emit('reload');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setFormProps({ confirmLoading: false });
|
||||
});
|
||||
} catch (_) {}
|
||||
}
|
||||
function handlePrev() {
|
||||
state.currIndex--;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleNext() {
|
||||
state.currIndex++;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleGetNewInfo() {
|
||||
changeLoading(true);
|
||||
getForm().resetFields();
|
||||
const id = state.allList[state.currIndex].id;
|
||||
getData(id);
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setDrawerProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setDrawerProps({ loading });
|
||||
}
|
||||
async function onClose() {
|
||||
if (state.isContinue) emit('reload');
|
||||
return true;
|
||||
}
|
||||
|
||||
function changeData(model, index) {
|
||||
state.isEdit = false;
|
||||
state.childIndex = index;
|
||||
for (let key in state.interfaceRes) {
|
||||
if (key != model) {
|
||||
let faceReList = state.interfaceRes[key];
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
let relationField = faceReList[i].relationField;
|
||||
if (relationField) {
|
||||
let modelAll = relationField.split('-');
|
||||
let faceMode = '';
|
||||
let faceMode2 = modelAll.length == 2 ? modelAll[0].substring(0, modelAll[0].length - 4) + modelAll[1] : '';
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
if (faceMode == model || faceMode2 == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
eval(options)(true);
|
||||
changeData(key, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!state.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < state.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
state.dataForm[data][i][model] = defaultValue;
|
||||
} else if (index == i) {
|
||||
state.dataForm[data][i][model] = defaultValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.dataForm[data] = defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getRelationDate(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue: any = null;
|
||||
let timeValue = Number(timeValueData);
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue;
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime();
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).valueOf();
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
function getRelationTime(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType;
|
||||
let timeDataValue: any = null;
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00';
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue;
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00';
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = dayjs().format(format);
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget + 3);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).format(format);
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
</script>
|
||||
39
src/views/bsc/projecttype/helper/api.ts
Normal file
39
src/views/bsc/projecttype/helper/api.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bc/ProjectType/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bc/ProjectType', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bc/ProjectType/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bc/ProjectType/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bc/ProjectType/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bc/ProjectType/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bc/ProjectType/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bc/ProjectType/Actions/Export', data });
|
||||
}
|
||||
// 树状列表查询
|
||||
export function getTreeList() {
|
||||
return defHttp.get({ url: '/api/bc/ProjectType/getTreeList' });
|
||||
}
|
||||
|
||||
347
src/views/bsc/projecttype/helper/columnList.ts
Normal file
347
src/views/bsc/projecttype/helper/columnList.ts
Normal file
@@ -0,0 +1,347 @@
|
||||
const columnList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemede56d",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目分类编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778687997809,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"project_type_code",
|
||||
"__vModel__":"project_type_code",
|
||||
"disabled":false,
|
||||
"id":"project_type_code",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"项目分类编码",
|
||||
"label":"项目分类编码",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem98d1b5",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目分类名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778688012177,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"project_type_name",
|
||||
"__vModel__":"project_type_name",
|
||||
"disabled":false,
|
||||
"id":"project_type_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"项目分类名称",
|
||||
"label":"项目分类名称",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"multiple":false,
|
||||
"fullName":"上级项目分类",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"上级项目分类",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"props":{
|
||||
"children":"children",
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"defaultValue":null,
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778757286660,
|
||||
"tagIcon":"icon-ym icon-ym-generator-tree",
|
||||
"tag":"YunzhupaasTreeSelect",
|
||||
"formId":"formItemb2dbd9",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"上级项目分类",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"pid",
|
||||
"width":null,
|
||||
"options":[
|
||||
{
|
||||
"children":[
|
||||
{
|
||||
"fullName":"选项1-1",
|
||||
"id":"2"
|
||||
}
|
||||
],
|
||||
"fullName":"选项1",
|
||||
"id":"1"
|
||||
}
|
||||
],
|
||||
"__vModel__":"pid",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"pid",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"controls":false,
|
||||
"resizable":true,
|
||||
"fullName":"顺序号",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"顺序号",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItemad2faf",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"顺序号",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778756981845,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"seq_num",
|
||||
"width":null,
|
||||
"__vModel__":"seq_num",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"seq_num",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"uploadFile",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"__config__":{
|
||||
"formId":"formItem1de75c",
|
||||
"yunzhupaasKey":"uploadFile",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":[],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1779096055133,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-upload",
|
||||
"tag":"YunzhupaasUploadFile",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"remark",
|
||||
"limit":9,
|
||||
"__vModel__":"remark",
|
||||
"sizeUnit":"MB",
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"buttonText":"点击上传",
|
||||
"resizable":true,
|
||||
"fullName":"备注",
|
||||
"label":"备注",
|
||||
"sortable":false,
|
||||
"pathType":"defaultPath",
|
||||
"accept":"",
|
||||
"folder":"",
|
||||
"fileSize":10,
|
||||
"sortRule":[],
|
||||
"timeFormat":"YYYY",
|
||||
"width":null,
|
||||
"tipText":"",
|
||||
"fixed":"none",
|
||||
"labelI18nCode":""
|
||||
}
|
||||
]
|
||||
export default columnList
|
||||
76
src/views/bsc/projecttype/helper/searchList.ts
Normal file
76
src/views/bsc/projecttype/helper/searchList.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
const searchList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem98d1b5",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目分类名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778688012177,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"project_type_name",
|
||||
"__vModel__":"project_type_name",
|
||||
"searchMultiple":false,
|
||||
"disabled":false,
|
||||
"id":"project_type_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"searchType":2,
|
||||
"maxlength":null,
|
||||
"fullName":"项目分类名称",
|
||||
"label":"分类名称",
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"isKeyword":false,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
}
|
||||
]
|
||||
export default searchList
|
||||
302
src/views/bsc/projecttype/helper/superQueryJson.ts
Normal file
302
src/views/bsc/projecttype/helper/superQueryJson.ts
Normal file
@@ -0,0 +1,302 @@
|
||||
const superQueryJson = [
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"项目分类编码",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemede56d",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目分类编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778687997809,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"project_type_code",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"project_type_code",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"项目分类名称",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem98d1b5",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目分类名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778688012177,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"project_type_name",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"project_type_name",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"上级项目分类",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"children":"children",
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"defaultValue":null,
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778757286660,
|
||||
"tagIcon":"icon-ym icon-ym-generator-tree",
|
||||
"tag":"YunzhupaasTreeSelect",
|
||||
"formId":"formItemb2dbd9",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"上级项目分类",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[
|
||||
{
|
||||
"children":[
|
||||
{
|
||||
"fullName":"选项1-1",
|
||||
"id":"2"
|
||||
}
|
||||
],
|
||||
"fullName":"选项1",
|
||||
"id":"1"
|
||||
}
|
||||
],
|
||||
"__vModel__":"pid",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"pid",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"controls":false,
|
||||
"fullName":"顺序号",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItemad2faf",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"顺序号",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1778756981845,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"__vModel__":"seq_num",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"seq_num",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"buttonText":"点击上传",
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"pathType":"defaultPath",
|
||||
"accept":"",
|
||||
"__config__":{
|
||||
"formId":"formItem1de75c",
|
||||
"yunzhupaasKey":"uploadFile",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":[],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"bc_project_type",
|
||||
"renderKey":1779096055133,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-upload",
|
||||
"tag":"YunzhupaasUploadFile",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"folder":"",
|
||||
"fileSize":10,
|
||||
"sortRule":[],
|
||||
"timeFormat":"YYYY",
|
||||
"limit":9,
|
||||
"__vModel__":"remark",
|
||||
"sizeUnit":"MB",
|
||||
"tipText":"",
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default superQueryJson
|
||||
653
src/views/bsc/projecttype/index.vue
Normal file
653
src/views/bsc/projecttype/index.vue
Normal file
@@ -0,0 +1,653 @@
|
||||
<template>
|
||||
<div class="yunzhupaas-content-wrapper">
|
||||
<div class="yunzhupaas-content-wrapper-center">
|
||||
<div class="yunzhupaas-content-wrapper-search-box" v-if="getSearchList.length">
|
||||
<BasicForm @register="registerSearchForm" :schemas="getSearchList"
|
||||
@advanced-change="redoHeight" @submit="handleSearchSubmit" @reset="handleSearchReset"
|
||||
class="search-form">
|
||||
</BasicForm>
|
||||
</div>
|
||||
<div class="yunzhupaas-content-wrapper-content bg-white">
|
||||
<BasicTable @register="registerTable" v-bind="getTableBindValue" ref="tableRef"
|
||||
@columns-change="handleColumnChange">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" v-auth="'btn_add'"
|
||||
@click="addHandle()"> {{t('common.add2Text','新增')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
<template #title>
|
||||
<span>{{ t('common.superQuery') }}</span>
|
||||
</template>
|
||||
<filter-outlined @click="openSuperQuery(true, { columnOptions: superQueryJson })" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #toolbarAfter>
|
||||
<ViewList :menuId="route.meta.modelId" :viewList="viewList" @itemClick="handleViewClick" @reload="initViewList" />
|
||||
<ViewSetting :menuId="route.meta.modelId" :viewList="viewList" :currentView="currentView" @reload="initViewList" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-for="(item, index) in childColumnList" v-if="childColumnList.length">
|
||||
<template
|
||||
v-if="column?.id?.includes('-') && item.children && item.children[0] && column.key === item.children[0]?.dataIndex">
|
||||
<ChildTableColumn :data="record[item.prop]" :head="item.children"
|
||||
@toggleExpand="toggleExpand(record, item.prop+`Expand`)" @toDetail="toDetail"
|
||||
:expand="record[item.prop+`Expand`]" :key="index" :showOverflow="true "/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="!(record.top || column.id?.includes('-'))">
|
||||
<template v-if="column.yunzhupaasKey === 'relationForm'">
|
||||
<p class="link-text"
|
||||
@click="toDetail(column.modelId, record[column.dataIndex+`_id`], column.propsValue)">
|
||||
{{ record[column.dataIndex] }}</p>
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'inputNumber'">
|
||||
<yunzhupaas-input-number v-model:value="record[column.prop]" :precision="column.precision" :thousands="column.thousands" disabled detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'calculate'">
|
||||
<yunzhupaas-calculate
|
||||
v-model:value="record[column.prop]"
|
||||
:isStorage="column.isStorage"
|
||||
:precision="column.precision"
|
||||
:thousands="column.thousands"
|
||||
detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'sign'">
|
||||
<yunzhupaas-sign v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'signature'">
|
||||
<yunzhupaas-signature v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'rate'">
|
||||
<yunzhupaas-rate v-model:value="record[column.prop]" :count="column.count" :allowHalf="column.allowHalf" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'slider'">
|
||||
<yunzhupaas-slider v-model:value="record[column.prop]" :min="column.min" :max="column.max" :step="column.step" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadImg'">
|
||||
<yunzhupaas-upload-img v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadFile'">
|
||||
<yunzhupaas-upload-file v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'input'">
|
||||
<yunzhupaas-input
|
||||
v-model:value="record[column.prop]"
|
||||
:useMask="column.useMask"
|
||||
:maskConfig="column.maskConfig"
|
||||
:showOverflow="true"
|
||||
detailed />
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'action' && !record.top">
|
||||
<TableAction :actions="getTableActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
<Form ref="formRef" @reload="reload" />
|
||||
<Detail ref="detailRef" />
|
||||
<ExportModal @register="registerExportModal" @download="handleDownload" />
|
||||
<ImportModal @register="registerImportModal" @reload="reload" />
|
||||
<PrintSelect @register="registerPrintSelect" @change="handleShowBrowse" />
|
||||
<PrintBrowse @register="registerPrintBrowse" />
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<SuperQueryModal @register="registerSuperQueryModal" @superQuery="handleSuperQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { getList, del, exportData, batchDelete } from './helper/api';
|
||||
import { getConfigData,getViewList } from '@/api/onlineDev/visualDev';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import { getOrgByOrganizeCondition,getDepartmentSelectAsyncList } from '@/api/permission/organize';
|
||||
import { ref, reactive, onMounted, toRefs, computed, unref, nextTick, toRaw, provide } from 'vue';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useOrganizeStore } from '@/store/modules/organize';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { usePopup } from '@/components/Popup';
|
||||
import { ScrollContainer } from '@/components/Container';
|
||||
import { BasicLeftTree, TreeActionType } from '@/components/Tree';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { BasicTable, useTable, TableAction, ActionItem, TableActionType, SorterResult } from '@/components/Table';
|
||||
import { SuperQueryModal } from '@/components/CommonModal';
|
||||
import Form from './Form.vue';
|
||||
import Detail from './Detail.vue';
|
||||
// 有关联表单详情:开始
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 有关联表单详情:结束
|
||||
import ChildTableColumn from '@/views/common/dynamicModel/list/ChildTableColumn.vue';
|
||||
import { ExportModal } from '@/components/CommonModal';
|
||||
import { downloadByUrl } from '@/utils/file/download';
|
||||
import { ImportModal} from '@/components/CommonModal';
|
||||
// 打印模板多条生成PrintSelect
|
||||
import PrintSelect from '@/components/PrintDesign/printSelect/index.vue';
|
||||
import PrintBrowse from '@/components/PrintDesign/printBrowse/index.vue';
|
||||
import { useRoute,useRouter } from 'vue-router';
|
||||
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||
import { getSearchFormSchemas } from '@/components/FormGenerator/src/helper/transform';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import columnList from './helper/columnList';
|
||||
import searchList from './helper/searchList';
|
||||
import superQueryJson from './helper/superQueryJson';
|
||||
import { dyOptionsList, systemComponentsList } from '@/components/FormGenerator/src/helper/config';
|
||||
import { thousandsFormat, getParamList} from '@/utils/yunzhupaas';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
|
||||
import ViewSetting from '@/views/common/dynamicModel/list/components/ViewSetting.vue';
|
||||
import ViewList from '@/views/common/dynamicModel/list/components/ViewList.vue';
|
||||
|
||||
interface State {
|
||||
config: any;
|
||||
columnList: any[];
|
||||
printListOptions: any[];
|
||||
columnBtnsList: any[];
|
||||
customBtnsList: any[];
|
||||
treeFieldNames: any;
|
||||
leftTreeData: any[];
|
||||
leftTreeLoading: boolean;
|
||||
treeActiveId: string;
|
||||
treeActiveNodePath: any;
|
||||
columns: any[];
|
||||
complexColumns: any[];
|
||||
childColumnList: any[];
|
||||
exportList: any[];
|
||||
cacheList: any[];
|
||||
currFlow: any;
|
||||
isCustomCopy: boolean;
|
||||
candidateType: number;
|
||||
currRow: any;
|
||||
workFlowFormData: any;
|
||||
expandObj: any;
|
||||
columnSettingList: any[];
|
||||
searchSchemas: any[];
|
||||
treeRelationObj: any;
|
||||
treeQueryJson: any;
|
||||
leftTreeActiveInfo: any;
|
||||
keyword: string;
|
||||
viewList: any[];
|
||||
currentView: any;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const { hasBtnP } = usePermission();
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const organizeStore = useOrganizeStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const [registerExportModal, { openModal: openExportModal, closeModal: closeExportModal, setModalProps: setExportModalProps }] = useModal();
|
||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||
const [registerSuperQueryModal, { openModal: openSuperQuery }] = useModal();
|
||||
const formRef = ref<any>(null);
|
||||
const tableRef = ref<Nullable<TableActionType>>(null);
|
||||
const detailRef = ref<any>(null);
|
||||
const relationDetailRef = ref<any>(null);
|
||||
|
||||
const state = reactive<State>({
|
||||
config: {},
|
||||
columnList: [],
|
||||
printListOptions: [],
|
||||
columnBtnsList: [],
|
||||
customBtnsList: [],
|
||||
treeFieldNames: {
|
||||
children: 'children' ,
|
||||
title: 'fullName' ,
|
||||
key: 'id' ,
|
||||
isLeaf: 'isLeaf',
|
||||
},
|
||||
leftTreeData: [],
|
||||
leftTreeLoading: false,
|
||||
treeActiveId: '',
|
||||
treeActiveNodePath: [],
|
||||
columns: [],
|
||||
complexColumns: [], // 复杂表头
|
||||
childColumnList: [],
|
||||
exportList: [],
|
||||
cacheList: [],
|
||||
currFlow: {},
|
||||
isCustomCopy: false,
|
||||
candidateType: 1,
|
||||
currRow: {},
|
||||
workFlowFormData: {},
|
||||
expandObj: {},
|
||||
columnSettingList: [],
|
||||
searchSchemas: [],
|
||||
treeRelationObj: null,
|
||||
treeQueryJson: {},
|
||||
leftTreeActiveInfo: {},
|
||||
keyword: '',
|
||||
viewList: [],
|
||||
currentView: {},
|
||||
});
|
||||
const defaultSearchInfo = {
|
||||
menuId: route.meta.modelId as string,
|
||||
moduleId:'824397917879010373',
|
||||
superQueryJson: '',
|
||||
pageSize:1000000, //没有分页,树形,分组
|
||||
};
|
||||
const searchInfo = reactive({
|
||||
...cloneDeep(defaultSearchInfo),
|
||||
});
|
||||
const { childColumnList, searchSchemas, viewList, currentView} = toRefs(state);
|
||||
const [registerSearchForm, { updateSchema, resetFields, submit: searchFormSubmit, setFieldsValue}] = useForm({
|
||||
baseColProps: { span: 6 },
|
||||
showActionButtonGroup: true,
|
||||
showAdvancedButton: true,
|
||||
compact: true,
|
||||
});
|
||||
const [registerTable, { reload, setLoading, getFetchParams, getSelectRows, getSelectRowKeys, redoHeight,clearSelectedRowKeys }] = useTable({
|
||||
api: getList,
|
||||
immediate: false,
|
||||
clickToRowSelect: false,
|
||||
tableSetting: { setting: false },
|
||||
afterFetch: (data) => {
|
||||
const list = data.map((o) => ({
|
||||
...o,
|
||||
...state.expandObj,
|
||||
}));
|
||||
state.cacheList = cloneDeep(list);
|
||||
return list;
|
||||
},
|
||||
});
|
||||
const [registerChildTable] = useTable({
|
||||
pagination: false,
|
||||
canResize: false,
|
||||
showTableSetting: false,
|
||||
});
|
||||
|
||||
provide('getLeftTreeActiveInfo', () => state.leftTreeActiveInfo);
|
||||
|
||||
const getHasBatchBtn = computed(() => {
|
||||
let btnsList =[]
|
||||
btnsList=btnsList.filter(o => hasBtnP('btn_' + o))
|
||||
return !!btnsList.length
|
||||
});
|
||||
|
||||
|
||||
const getColumns = computed(() => {
|
||||
const columns = state.complexColumns;
|
||||
return setListValue(state.currentView?.columnList, columns, 'prop');
|
||||
});
|
||||
const getSearchList = computed(() => {
|
||||
const searchSchemas = cloneDeep(state.searchSchemas).map(o => ({ ...o, show: true }));
|
||||
return setListValue(state.currentView?.searchList, searchSchemas, 'field');
|
||||
});
|
||||
const getTableBindValue = computed(() => {
|
||||
let columns = unref(getColumns);
|
||||
const defaultSortConfig=[{"field":"seq_num","sort":"asc","id":"sort413263"}];
|
||||
const sortField = defaultSortConfig.map(o => (o.sort === 'desc' ? '-' : '') + o.field);
|
||||
const data: any = {
|
||||
pagination: false, //没有分页,树形,分组
|
||||
searchInfo: unref(searchInfo),
|
||||
defSort: { sidx: sortField.join(',') },
|
||||
sortFn: (sortInfo: SorterResult | SorterResult[]) => {
|
||||
if (Array.isArray(sortInfo)) {
|
||||
const sortList = sortInfo.map(o => (o.order === 'descend' ? '-' : '') + o.field);
|
||||
return { sidx: sortList.join(',') };
|
||||
} else {
|
||||
const { field, order } = sortInfo;
|
||||
if (field && order) {
|
||||
// 排序字段
|
||||
return { sidx: (order === 'descend' ? '-' : '') + field };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
ellipsis:true ,
|
||||
columns,
|
||||
isTreeTable: true,
|
||||
bordered: true,
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
title: t('component.table.action'),
|
||||
dataIndex: 'action',
|
||||
},
|
||||
};
|
||||
return data;
|
||||
});
|
||||
|
||||
function init() {
|
||||
state.config = {};
|
||||
searchInfo.menuId = route.meta.modelId as string;
|
||||
state.columnList = columnList;
|
||||
setLoading(true);
|
||||
getSearchSchemas();
|
||||
getColumnList();
|
||||
initViewList();
|
||||
nextTick(() => {
|
||||
unref(getSearchList)?.length ? searchFormSubmit() : reload({ page: 1 });
|
||||
});
|
||||
}
|
||||
function getSearchSchemas() {
|
||||
|
||||
const schemas = getSearchFormSchemas(searchList);
|
||||
state.searchSchemas = schemas;
|
||||
schemas.forEach((cur) => {
|
||||
const config = cur.__config__;
|
||||
if (dyOptionsList.includes(config.yunzhupaasKey)) {
|
||||
if (config.dataType === 'dictionary') {
|
||||
if (!config.dictionaryType) return;
|
||||
getDictionaryDataSelector(config.dictionaryType).then((res) => {
|
||||
updateSchema([{ field: cur.field, componentProps: { options: res.data.list } }]);
|
||||
});
|
||||
}
|
||||
if (config.dataType === 'dynamic') {
|
||||
if (!config.propsUrl) return;
|
||||
const query = { paramList: getParamList(config.templateJson) };
|
||||
getDataInterfaceRes(config.propsUrl, query).then((res) => {
|
||||
const data = Array.isArray(res.data) ? res.data : [];
|
||||
updateSchema([{ field: cur.field, componentProps: { options: data } }]);
|
||||
});
|
||||
}
|
||||
}
|
||||
cur.defaultValue = cur.value;
|
||||
});
|
||||
}
|
||||
function getColumnList() {
|
||||
// 没有开启列表权限
|
||||
let columnList = state.columnList;
|
||||
state.exportList = columnList;
|
||||
let columns = columnList.map((o) => ({
|
||||
...o,
|
||||
title: o.labelI18nCode ? t(o.labelI18nCode, o.label) : o.label,
|
||||
dataIndex: o.prop,
|
||||
align: o.align,
|
||||
fixed: o.fixed == 'none' ? false : o.fixed,
|
||||
sorter: o.sortable ? { multiple: 1 } : o.sortable,
|
||||
width: o.width || 100,
|
||||
}));
|
||||
//添加复杂表头
|
||||
columns = getComplexColumns(columns);
|
||||
state.columns = columns.filter((o) => o.prop.indexOf('-') < 0);
|
||||
//子表表头
|
||||
getChildComplexColumns(columns);
|
||||
}
|
||||
|
||||
|
||||
//复杂表头
|
||||
function getComplexColumns(columns) {
|
||||
//这里生成复杂表头的配置
|
||||
let complexHeaderList: any[] = [];
|
||||
if (!complexHeaderList.length) return columns;
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.label = e.fullName;
|
||||
e.labelI18nCode = e.fullNameI18nCode;
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.dataIndex = e.id;
|
||||
e.prop = e.id;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < columns.length; j++) {
|
||||
const o = columns[j];
|
||||
if (o.prop == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].prop);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
const e = columns[i];
|
||||
if (!childColumns.includes(e.prop)) {
|
||||
list.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.prop)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.prop));
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//子表表头
|
||||
function getChildComplexColumns(columnList) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i];
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e);
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0];
|
||||
let vModel = e.prop.split('-')[1];
|
||||
let label = e.label.split('-')[0];
|
||||
let childLabel = e.label.replace(label + '-', '');
|
||||
if (e.fullNameI18nCode && Array.isArray(e.fullNameI18nCode) && e.fullNameI18nCode[0]) label = t(e.fullNameI18nCode[0], label);
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
yunzhupaasKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
title: label,
|
||||
dataIndex: prop,
|
||||
children: [],
|
||||
};
|
||||
e.dataIndex = vModel;
|
||||
e.title = e.labelI18nCode ? t(e.labelI18nCode, childLabel) : childLabel;
|
||||
if (!state.expandObj.hasOwnProperty(prop+`Expand`)) state.expandObj[prop+`Expand`] = false;
|
||||
if (!list.some((o) => o.prop === prop)) list.push(newItem);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 行内分组展示
|
||||
getMergeList(list);
|
||||
|
||||
state.complexColumns = list;
|
||||
state.childColumnList = list.filter((o) => o.yunzhupaasKey === 'table');
|
||||
|
||||
// 子表分组展示宽度取100
|
||||
for (let i = 0; i < state.childColumnList.length; i++) {
|
||||
const e = state.childColumnList[i];
|
||||
if (e.children?.length) e.children = e.children.map(o => ({ ...o, width: 100 }));
|
||||
}
|
||||
}
|
||||
function getMergeList(list) {
|
||||
list.forEach((item) => {
|
||||
if (item.yunzhupaasKey === 'table' && item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
child.customCell = () => ({
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
class: 'child-table-box',
|
||||
});
|
||||
} else {
|
||||
child.customCell = () => ({
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleExpand(row, field) {
|
||||
row[field] = !row[field];
|
||||
}
|
||||
// 关联表单查看详情
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function handleColumnChange(data) {
|
||||
state.columnSettingList = data;
|
||||
}
|
||||
function getTableActions(record): ActionItem[] {
|
||||
return [
|
||||
{
|
||||
label: t('common.editText','编辑') ,
|
||||
onClick: updateHandle.bind(null, record),
|
||||
auth: 'btn_edit', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.delText','删除') ,
|
||||
color: 'error',
|
||||
modelConfirm: {
|
||||
onOk: handleDelete.bind(null, record.id),
|
||||
},
|
||||
auth: 'btn_remove', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.detailText','详情') ,
|
||||
onClick: goDetail.bind(null, record),
|
||||
auth: 'btn_detail', //有按钮权限
|
||||
},
|
||||
];
|
||||
}
|
||||
// 编辑
|
||||
function updateHandle(record) {
|
||||
// 不带工作流
|
||||
const data = {
|
||||
id: record.id,
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 删除
|
||||
function handleDelete(id) {
|
||||
const query={ids:[id] }
|
||||
batchDelete(query).then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
});
|
||||
}
|
||||
// 查看详情
|
||||
function goDetail(record) {
|
||||
// 不带流程
|
||||
const data = {
|
||||
id: record.id,
|
||||
};
|
||||
detailRef.value?.init(data);
|
||||
}
|
||||
// 新增
|
||||
function addHandle() {
|
||||
// 不带流程新增
|
||||
const data = {
|
||||
id: '',
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 高级查询
|
||||
function handleSuperQuery(superQueryJson) {
|
||||
searchInfo.superQueryJson = superQueryJson;
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function handleSearchReset() {
|
||||
clearSelectedRowKeys();
|
||||
if (!state.resetFromTree) updateSearchFormValue();
|
||||
if (state.resetFromTree) state.resetFromTree = false;
|
||||
}
|
||||
|
||||
function handleSearchSubmit(data) {
|
||||
clearSelectedRowKeys();
|
||||
let obj = {
|
||||
...defaultSearchInfo,
|
||||
superQueryJson: searchInfo.superQueryJson,
|
||||
...data,
|
||||
};
|
||||
Object.keys(searchInfo).map(key => {
|
||||
delete searchInfo[key];
|
||||
});
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
searchInfo[key.replaceAll('-', '_')] = value;
|
||||
}
|
||||
console.log(searchInfo);
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function updateSearchFormValue() {
|
||||
if (!state.treeActiveId) return searchFormSubmit();
|
||||
let queryJson: any = {};
|
||||
let leftTreeActiveInfo: any = {};
|
||||
const isMultiple = !state.treeRelationObj ? false : state.treeRelationObj.searchMultiple;
|
||||
//多级左侧树,需要拼父级->转为查询参数
|
||||
if (state.treeRelationObj && state.treeRelationObj.yunzhupaasKey && ['organizeSelect', 'cascader', 'areaSelect'].includes(state.treeRelationObj.yunzhupaasKey)) {
|
||||
let currValue = [];
|
||||
currValue = state.treeActiveNodePath.map(o => o[state.treeFieldNames.key]);
|
||||
queryJson = { '': isMultiple ? [currValue] : currValue };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [currValue] : currValue };
|
||||
} else {
|
||||
queryJson = { '': isMultiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
}
|
||||
state.leftTreeActiveInfo = leftTreeActiveInfo;
|
||||
if(unref(getSearchList)?.length){
|
||||
// 有搜索列表
|
||||
setFieldsValue(queryJson);
|
||||
searchFormSubmit();
|
||||
}else{
|
||||
// 无搜索列表
|
||||
handleSearchSubmit(queryJson);
|
||||
}
|
||||
}
|
||||
function initViewList(currentId = '') {
|
||||
const query = {
|
||||
menuId: route.meta.modelId,
|
||||
};
|
||||
getViewList(query).then(res => {
|
||||
const columns : any[]= state.complexColumns;
|
||||
const searchList: any[] = state.searchSchemas.map(o => ({ label: o.label, id: o.field, show: o.show, labelI18nCode: o.labelI18nCode }));
|
||||
const columnList: any[] = columns.map(o => ({ label: o.label, id: o.prop, show: true, fixed: o.fixed || 'none', labelI18nCode: o.labelI18nCode }));
|
||||
state.viewList = (res.data || []).map(o => {
|
||||
if (o.type == 0) return { ...o, searchList, columnList };
|
||||
return { ...o, searchList: o.searchList ? JSON.parse(o.searchList) : [], columnList: o.columnList ? JSON.parse(o.columnList) : [] };
|
||||
});
|
||||
if (currentId) {
|
||||
state.currentView = state.viewList.filter(o => o.id === currentId)[0] || state.viewList[0];
|
||||
} else {
|
||||
state.currentView = state.viewList.filter(o => o.status === 1)[0] || state.viewList[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleViewClick(item) {
|
||||
state.currentView = item;
|
||||
}
|
||||
|
||||
function setListValue(data: any[] = [], defaultData: any[] = [], key) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
for (let j = 0; j < defaultData.length; j++) {
|
||||
if (data[i].show && data[i].id == defaultData[j][key]) list.push(defaultData[j]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
5248
src/views/cm/contract/Form.vue
Normal file
5248
src/views/cm/contract/Form.vue
Normal file
File diff suppressed because it is too large
Load Diff
50
src/views/cm/contract/SelectContractModal.vue
Normal file
50
src/views/cm/contract/SelectContractModal.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="选择合同模板" @ok="handleOk" width="1000px" :minHeight="200">
|
||||
<BasicTable @register="registerTable" :rowSelection="{ type: 'radio', onChange: handleSelectChange }" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '@/components/Modal';
|
||||
import { BasicTable, useTable } from '@/components/Table';
|
||||
// 假设你有一个获取所有合同的API,这里需要根据你的项目实际情况引入
|
||||
// 如果返回的数据结构和 index 页面的 getList 一样,甚至可以复用
|
||||
import { getList as getContractList } from '@/views/mdm/asset/helper/api';
|
||||
|
||||
const emit = defineEmits(['confirm']);
|
||||
const selectedRow = ref({});
|
||||
|
||||
const [registerModal, { closeModal }] = useModalInner();
|
||||
|
||||
// 注册表格,配置你的表格列和API
|
||||
const [registerTable] = useTable({
|
||||
api: getContractList, // 复用获取列表的API
|
||||
immediate: true, // 弹框打开后立即加载数据
|
||||
showIndexColumn: false,
|
||||
rowKey: 'id',
|
||||
columns: [
|
||||
// 这里配置你想在弹框中显示的列,尽量精简
|
||||
{ title: '合同编码', dataIndex: 'contract_code', width: 150 },
|
||||
{ title: '合同名称', dataIndex: 'contract_name' },
|
||||
{ title: '我方单位', dataIndex: 'our_company_name', width: 200 },
|
||||
{ title: '合作单位', dataIndex: 'second_party_name', width: 200 },
|
||||
// ... 其他需要的列
|
||||
],
|
||||
});
|
||||
|
||||
const handleSelectChange = (selectedRowKeys, rows) => {
|
||||
if (rows && rows.length) {
|
||||
selectedRow.value = rows[0];
|
||||
}
|
||||
};
|
||||
|
||||
const handleOk = () => {
|
||||
if (!selectedRow.value.id) {
|
||||
// 可以在这里加一个提示,请选择一条数据
|
||||
return;
|
||||
}
|
||||
emit('confirm', selectedRow.value);
|
||||
closeModal();
|
||||
};
|
||||
</script>
|
||||
34
src/views/cm/contract/helper/api.ts
Normal file
34
src/views/cm/contract/helper/api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/cm/Contract/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/cm/Contract', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/cm/Contract/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/cm/Contract/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/cm/Contract/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/cm/Contract/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/cm/Contract/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/cm/Contract/Actions/Export', data });
|
||||
}
|
||||
1091
src/views/cm/contract/helper/columnList.ts
Normal file
1091
src/views/cm/contract/helper/columnList.ts
Normal file
File diff suppressed because it is too large
Load Diff
285
src/views/cm/contract/helper/searchList.ts
Normal file
285
src/views/cm/contract/helper/searchList.ts
Normal file
@@ -0,0 +1,285 @@
|
||||
const searchList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem667983",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"合同名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract",
|
||||
"renderKey":1778233391557,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":16
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"contract_name",
|
||||
"__vModel__":"contract_name",
|
||||
"searchMultiple":false,
|
||||
"disabled":false,
|
||||
"id":"contract_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"searchType":2,
|
||||
"maxlength":null,
|
||||
"fullName":"合同名称",
|
||||
"label":"合同名称",
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"isKeyword":false,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"organizeSelect",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"searchType":1,
|
||||
"ableIds":[],
|
||||
"multiple":false,
|
||||
"fullName":"归属组织",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"归属组织",
|
||||
"__config__":{
|
||||
"formId":"formItem19e51b",
|
||||
"yunzhupaasKey":"organizeSelect",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":[],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"归属组织",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract",
|
||||
"renderKey":1778234738473,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-company",
|
||||
"defaultCurrent":true,
|
||||
"tag":"YunzhupaasOrganizeSelect",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":8
|
||||
},
|
||||
"prop":"org_id",
|
||||
"__vModel__":"org_id",
|
||||
"searchMultiple":true,
|
||||
"isKeyword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"selectType":"all",
|
||||
"disabled":false,
|
||||
"id":"org_id",
|
||||
"placeholder":"请选择",
|
||||
"value":[],
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"select",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"searchType":1,
|
||||
"multiple":false,
|
||||
"fullName":"合同分类",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"合同分类",
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract",
|
||||
"renderKey":1778234785187,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItema4f236",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dictionary",
|
||||
"dictionaryType":"contractCategory",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"合同分类",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":8
|
||||
},
|
||||
"prop":"contract_category",
|
||||
"options":[
|
||||
{
|
||||
"enCode":"1010",
|
||||
"children":null,
|
||||
"hasChildren":false,
|
||||
"fullName":"商品销售合同",
|
||||
"id":"contractCategory-1010",
|
||||
"parentId":"0"
|
||||
},
|
||||
{
|
||||
"enCode":"1020",
|
||||
"children":null,
|
||||
"hasChildren":false,
|
||||
"fullName":"材料采购合同",
|
||||
"id":"contractCategory-1020",
|
||||
"parentId":"0"
|
||||
},
|
||||
{
|
||||
"enCode":"1030",
|
||||
"children":null,
|
||||
"hasChildren":false,
|
||||
"fullName":"资产采购合同",
|
||||
"id":"contractCategory-1030",
|
||||
"parentId":"0"
|
||||
},
|
||||
{
|
||||
"enCode":"1040",
|
||||
"children":null,
|
||||
"hasChildren":false,
|
||||
"fullName":"资产租赁合同",
|
||||
"id":"contractCategory-1040",
|
||||
"parentId":"0"
|
||||
},
|
||||
{
|
||||
"enCode":"1050",
|
||||
"children":null,
|
||||
"hasChildren":false,
|
||||
"fullName":"软件销售合同",
|
||||
"id":"contractCategory-1050",
|
||||
"parentId":"0"
|
||||
}
|
||||
],
|
||||
"__vModel__":"contract_category",
|
||||
"searchMultiple":true,
|
||||
"isKeyword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"contract_category",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"billRule",
|
||||
"searchType":2,
|
||||
"fullName":"合同编码",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"合同编码",
|
||||
"__config__":{
|
||||
"formId":"formItemaa97ea",
|
||||
"yunzhupaasKey":"billRule",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"rule":"contractCode",
|
||||
"className":[],
|
||||
"label":"合同编码",
|
||||
"trigger":"change",
|
||||
"ruleConfig":{},
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract",
|
||||
"renderKey":1778233919360,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-documents",
|
||||
"ruleType":1,
|
||||
"ruleName":"合同编码",
|
||||
"tag":"YunzhupaasInput",
|
||||
"tableAlign":"left",
|
||||
"span":8
|
||||
},
|
||||
"readonly":true,
|
||||
"prop":"contract_code",
|
||||
"__vModel__":"contract_code",
|
||||
"searchMultiple":false,
|
||||
"isKeyword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"id":"contract_code",
|
||||
"placeholder":"系统自动生成",
|
||||
"labelI18nCode":""
|
||||
}
|
||||
]
|
||||
export default searchList
|
||||
6173
src/views/cm/contract/helper/superQueryJson.ts
Normal file
6173
src/views/cm/contract/helper/superQueryJson.ts
Normal file
File diff suppressed because it is too large
Load Diff
741
src/views/cm/contract/index.vue
Normal file
741
src/views/cm/contract/index.vue
Normal file
@@ -0,0 +1,741 @@
|
||||
<template>
|
||||
<div class="yunzhupaas-content-wrapper">
|
||||
<div class="yunzhupaas-content-wrapper-center">
|
||||
<div class="yunzhupaas-content-wrapper-search-box" v-if="getSearchList.length">
|
||||
<BasicForm @register="registerSearchForm" :schemas="getSearchList"
|
||||
@advanced-change="redoHeight" @submit="handleSearchSubmit" @reset="handleSearchReset"
|
||||
class="search-form">
|
||||
</BasicForm>
|
||||
</div>
|
||||
<div class="yunzhupaas-content-wrapper-content bg-white">
|
||||
<BasicTable @register="registerTable" v-bind="getTableBindValue" ref="tableRef"
|
||||
@columns-change="handleColumnChange">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" v-auth="'btn_add'"
|
||||
@click="addHandle()"> {{t('common.add2Text','新增')}}</a-button>
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-download" v-auth="'btn_download'"
|
||||
@click="openExportModal(true, { columnList: state.exportList, selectIds: getSelectRowKeys(), showExportSelected: true })"> {{t('common.exportText','导出')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
<template #title>
|
||||
<span>{{ t('common.superQuery') }}</span>
|
||||
</template>
|
||||
<filter-outlined @click="openSuperQuery(true, { columnOptions: superQueryJson })" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #toolbarAfter>
|
||||
<ViewList :menuId="route.meta.modelId" :viewList="viewList" @itemClick="handleViewClick" @reload="initViewList" />
|
||||
<ViewSetting :menuId="route.meta.modelId" :viewList="viewList" :currentView="currentView" @reload="initViewList" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-for="(item, index) in childColumnList" v-if="childColumnList.length">
|
||||
<template
|
||||
v-if="column?.id?.includes('-') && item.children && item.children[0] && column.key === item.children[0]?.dataIndex">
|
||||
<ChildTableColumn :data="record[item.prop]" :head="item.children"
|
||||
@toggleExpand="toggleExpand(record, item.prop+`Expand`)" @toDetail="toDetail"
|
||||
:expand="record[item.prop+`Expand`]" :key="index" :showOverflow="true "/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="!(record.top || column.id?.includes('-'))">
|
||||
<template v-if="column.yunzhupaasKey === 'relationForm'">
|
||||
<p class="link-text"
|
||||
@click="toDetail(column.modelId, record[column.dataIndex+`_id`], column.propsValue)">
|
||||
{{ record[column.dataIndex] }}</p>
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'inputNumber'">
|
||||
<yunzhupaas-input-number v-model:value="record[column.prop]" :precision="column.precision" :thousands="column.thousands" disabled detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'calculate'">
|
||||
<yunzhupaas-calculate
|
||||
v-model:value="record[column.prop]"
|
||||
:isStorage="column.isStorage"
|
||||
:precision="column.precision"
|
||||
:thousands="column.thousands"
|
||||
detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'sign'">
|
||||
<yunzhupaas-sign v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'signature'">
|
||||
<yunzhupaas-signature v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'rate'">
|
||||
<yunzhupaas-rate v-model:value="record[column.prop]" :count="column.count" :allowHalf="column.allowHalf" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'slider'">
|
||||
<yunzhupaas-slider v-model:value="record[column.prop]" :min="column.min" :max="column.max" :step="column.step" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadImg'">
|
||||
<yunzhupaas-upload-img v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadFile'">
|
||||
<yunzhupaas-upload-file v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'input'">
|
||||
<yunzhupaas-input
|
||||
v-model:value="record[column.prop]"
|
||||
:useMask="column.useMask"
|
||||
:maskConfig="column.maskConfig"
|
||||
:showOverflow="true"
|
||||
detailed />
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'flowState' && !record.top">
|
||||
<yunzhupaasTextTag :content="getFlowStatusContent(record.flowState)" :color="getFlowStatusColor(record.flowState)" />
|
||||
</template>
|
||||
<template v-if="column.key === 'action' && !record.top">
|
||||
<TableAction :actions="getTableActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
<ExportModal @register="registerExportModal" @download="handleDownload" />
|
||||
<ImportModal @register="registerImportModal" @reload="reload" />
|
||||
<PrintSelect @register="registerPrintSelect" @change="handleShowBrowse" />
|
||||
<PrintBrowse @register="registerPrintBrowse" />
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<SuperQueryModal @register="registerSuperQueryModal" @superQuery="handleSuperQuery" />
|
||||
<FlowParser @register="registerFlowParser" @reload="reload" />
|
||||
<SelectContractModal @register="registerSelectModal" @confirm="handleSelectConfirm" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import SelectContractModal from './SelectContractModal.vue';
|
||||
|
||||
|
||||
import { getList, del, exportData, batchDelete } from './helper/api';
|
||||
import { getConfigData,getViewList } from '@/api/onlineDev/visualDev';
|
||||
// 工作流
|
||||
import FlowParser from '@/views/workFlow/components/FlowParser.vue';
|
||||
import { useDefineSetting } from '@/hooks/setting/useDefineSetting';
|
||||
import { getFlowStartFormId } from '@/api/workFlow/template';
|
||||
import { useTabs } from '@/hooks/web/useTabs';
|
||||
// 工作流
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import { getOrgByOrganizeCondition,getDepartmentSelectAsyncList } from '@/api/permission/organize';
|
||||
import { ref, reactive, onMounted, toRefs, computed, unref, nextTick, toRaw, provide } from 'vue';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useOrganizeStore } from '@/store/modules/organize';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { usePopup } from '@/components/Popup';
|
||||
import { ScrollContainer } from '@/components/Container';
|
||||
import { BasicLeftTree, TreeActionType } from '@/components/Tree';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { BasicTable, useTable, TableAction, ActionItem, TableActionType, SorterResult } from '@/components/Table';
|
||||
import { SuperQueryModal } from '@/components/CommonModal';
|
||||
// 有关联表单详情:开始
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 有关联表单详情:结束
|
||||
import ChildTableColumn from '@/views/common/dynamicModel/list/ChildTableColumn.vue';
|
||||
import { ExportModal } from '@/components/CommonModal';
|
||||
import { downloadByUrl } from '@/utils/file/download';
|
||||
import { ImportModal} from '@/components/CommonModal';
|
||||
// 打印模板多条生成PrintSelect
|
||||
import PrintSelect from '@/components/PrintDesign/printSelect/index.vue';
|
||||
import PrintBrowse from '@/components/PrintDesign/printBrowse/index.vue';
|
||||
import { useRoute,useRouter } from 'vue-router';
|
||||
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||
import { getSearchFormSchemas } from '@/components/FormGenerator/src/helper/transform';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import columnList from './helper/columnList';
|
||||
import searchList from './helper/searchList';
|
||||
import superQueryJson from './helper/superQueryJson';
|
||||
import { dyOptionsList, systemComponentsList } from '@/components/FormGenerator/src/helper/config';
|
||||
import { thousandsFormat, getParamList} from '@/utils/yunzhupaas';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
|
||||
import ViewSetting from '@/views/common/dynamicModel/list/components/ViewSetting.vue';
|
||||
import ViewList from '@/views/common/dynamicModel/list/components/ViewList.vue';
|
||||
|
||||
interface State {
|
||||
config: any;
|
||||
flowId: string;
|
||||
columnList: any[];
|
||||
printListOptions: any[];
|
||||
columnBtnsList: any[];
|
||||
customBtnsList: any[];
|
||||
treeFieldNames: any;
|
||||
leftTreeData: any[];
|
||||
leftTreeLoading: boolean;
|
||||
treeActiveId: string;
|
||||
treeActiveNodePath: any;
|
||||
columns: any[];
|
||||
complexColumns: any[];
|
||||
childColumnList: any[];
|
||||
exportList: any[];
|
||||
cacheList: any[];
|
||||
currFlow: any;
|
||||
isCustomCopy: boolean;
|
||||
candidateType: number;
|
||||
currRow: any;
|
||||
workFlowFormData: any;
|
||||
expandObj: any;
|
||||
columnSettingList: any[];
|
||||
searchSchemas: any[];
|
||||
treeRelationObj: any;
|
||||
treeQueryJson: any;
|
||||
leftTreeActiveInfo: any;
|
||||
keyword: string;
|
||||
viewList: any[];
|
||||
currentView: any;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const { hasBtnP } = usePermission();
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const organizeStore = useOrganizeStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const [registerExportModal, { openModal: openExportModal, closeModal: closeExportModal, setModalProps: setExportModalProps }] = useModal();
|
||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||
const [registerSuperQueryModal, { openModal: openSuperQuery }] = useModal();
|
||||
const [registerSelectModal, { openModal: openSelectModal }] = useModal();
|
||||
|
||||
// 工作流
|
||||
const { close } = useTabs();
|
||||
const router = useRouter();
|
||||
const [registerFlowParser, { openPopup: openFlowParser }] = usePopup();
|
||||
const { getFlowStatusContent, getFlowStatusColor } = useDefineSetting();
|
||||
const formRef = ref<any>(null);
|
||||
const tableRef = ref<Nullable<TableActionType>>(null);
|
||||
const detailRef = ref<any>(null);
|
||||
const relationDetailRef = ref<any>(null);
|
||||
|
||||
const state = reactive<State>({
|
||||
config: {},
|
||||
flowId:'826818224476657349',//请在这里填写流程模板id
|
||||
columnList: [],
|
||||
printListOptions: [],
|
||||
columnBtnsList: [],
|
||||
customBtnsList: [],
|
||||
treeFieldNames: {
|
||||
children: 'children' ,
|
||||
title: 'fullName' ,
|
||||
key: 'id' ,
|
||||
isLeaf: 'isLeaf',
|
||||
},
|
||||
leftTreeData: [],
|
||||
leftTreeLoading: false,
|
||||
treeActiveId: '',
|
||||
treeActiveNodePath: [],
|
||||
columns: [],
|
||||
complexColumns: [], // 复杂表头
|
||||
childColumnList: [],
|
||||
exportList: [],
|
||||
cacheList: [],
|
||||
currFlow: {},
|
||||
isCustomCopy: false,
|
||||
candidateType: 1,
|
||||
currRow: {},
|
||||
workFlowFormData: {},
|
||||
expandObj: {},
|
||||
columnSettingList: [],
|
||||
searchSchemas: [],
|
||||
treeRelationObj: null,
|
||||
treeQueryJson: {},
|
||||
leftTreeActiveInfo: {},
|
||||
keyword: '',
|
||||
viewList: [],
|
||||
currentView: {},
|
||||
});
|
||||
const defaultSearchInfo = {
|
||||
menuId: route.meta.modelId as string,
|
||||
moduleId:'822512474837222405',
|
||||
superQueryJson: '',
|
||||
flowId: state.flowId,
|
||||
dataType:0,
|
||||
};
|
||||
const searchInfo = reactive({
|
||||
...cloneDeep(defaultSearchInfo),
|
||||
});
|
||||
const { childColumnList, searchSchemas, viewList, currentView, flowId } = toRefs(state);
|
||||
const [registerSearchForm, { updateSchema, resetFields, submit: searchFormSubmit, setFieldsValue}] = useForm({
|
||||
baseColProps: { span: 6 },
|
||||
showActionButtonGroup: true,
|
||||
showAdvancedButton: true,
|
||||
compact: true,
|
||||
});
|
||||
const [registerTable, { reload, setLoading, getFetchParams, getSelectRows, getSelectRowKeys, redoHeight,clearSelectedRowKeys }] = useTable({
|
||||
api: getList,
|
||||
immediate: false,
|
||||
clickToRowSelect: false,
|
||||
tableSetting: { setting: false },
|
||||
afterFetch: (data) => {
|
||||
const list = data.map((o) => ({
|
||||
...o,
|
||||
...state.expandObj,
|
||||
}));
|
||||
state.cacheList = cloneDeep(list);
|
||||
return list;
|
||||
},
|
||||
});
|
||||
const [registerChildTable] = useTable({
|
||||
pagination: false,
|
||||
canResize: false,
|
||||
showTableSetting: false,
|
||||
});
|
||||
|
||||
provide('getLeftTreeActiveInfo', () => state.leftTreeActiveInfo);
|
||||
|
||||
const getHasBatchBtn = computed(() => {
|
||||
let btnsList =[]
|
||||
btnsList.push('download')
|
||||
btnsList=btnsList.filter(o => hasBtnP('btn_' + o))
|
||||
return !!btnsList.length
|
||||
});
|
||||
|
||||
|
||||
const getColumns = computed(() => {
|
||||
const columns = state.complexColumns;
|
||||
return setListValue(state.currentView?.columnList, columns, 'prop');
|
||||
});
|
||||
const getSearchList = computed(() => {
|
||||
const searchSchemas = cloneDeep(state.searchSchemas).map(o => ({ ...o, show: true }));
|
||||
return setListValue(state.currentView?.searchList, searchSchemas, 'field');
|
||||
});
|
||||
const getTableBindValue = computed(() => {
|
||||
let columns = unref(getColumns);
|
||||
const boo=columns.some(o=>o.dataIndex==='flowState')
|
||||
if(!boo) columns.push({ title: t('component.table.status'), dataIndex: 'flowState', width: 100, align: 'center', fixed: columns.some(o => o.fixed == 'right') ? 'right' : false, });
|
||||
const defaultSortConfig=[{"field":"org_id","sort":"asc","id":"sort38782b"},{"field":"project_id","sort":"asc","id":"sort5aa35a"},{"field":"contract_code","sort":"desc","id":"sortb70f27"}];
|
||||
const sortField = defaultSortConfig.map(o => (o.sort === 'desc' ? '-' : '') + o.field);
|
||||
const data: any = {
|
||||
pagination: { pageSize: 20 }, //有分页
|
||||
searchInfo: unref(searchInfo),
|
||||
defSort: { sidx: sortField.join(',') },
|
||||
sortFn: (sortInfo: SorterResult | SorterResult[]) => {
|
||||
if (Array.isArray(sortInfo)) {
|
||||
const sortList = sortInfo.map(o => (o.order === 'descend' ? '-' : '') + o.field);
|
||||
return { sidx: sortList.join(',') };
|
||||
} else {
|
||||
const { field, order } = sortInfo;
|
||||
if (field && order) {
|
||||
// 排序字段
|
||||
return { sidx: (order === 'descend' ? '-' : '') + field };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
ellipsis:true ,
|
||||
columns,
|
||||
bordered: true,
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
title: t('component.table.action'),
|
||||
dataIndex: 'action',
|
||||
},
|
||||
};
|
||||
if (unref(getHasBatchBtn)) {
|
||||
const rowSelection: any = { type: 'checkbox' };
|
||||
data.rowSelection = rowSelection;
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
function init() {
|
||||
state.config = {};
|
||||
searchInfo.menuId = route.meta.modelId as string;
|
||||
state.columnList = columnList;
|
||||
setLoading(true);
|
||||
getSearchSchemas();
|
||||
getColumnList();
|
||||
initViewList();
|
||||
nextTick(() => {
|
||||
unref(getSearchList)?.length ? searchFormSubmit() : reload({ page: 1 });
|
||||
});
|
||||
}
|
||||
function getSearchSchemas() {
|
||||
|
||||
const schemas = getSearchFormSchemas(searchList);
|
||||
state.searchSchemas = schemas;
|
||||
schemas.forEach((cur) => {
|
||||
const config = cur.__config__;
|
||||
if (dyOptionsList.includes(config.yunzhupaasKey)) {
|
||||
if (config.dataType === 'dictionary') {
|
||||
if (!config.dictionaryType) return;
|
||||
getDictionaryDataSelector(config.dictionaryType).then((res) => {
|
||||
updateSchema([{ field: cur.field, componentProps: { options: res.data.list } }]);
|
||||
});
|
||||
}
|
||||
if (config.dataType === 'dynamic') {
|
||||
if (!config.propsUrl) return;
|
||||
const query = { paramList: getParamList(config.templateJson) };
|
||||
getDataInterfaceRes(config.propsUrl, query).then((res) => {
|
||||
const data = Array.isArray(res.data) ? res.data : [];
|
||||
updateSchema([{ field: cur.field, componentProps: { options: data } }]);
|
||||
});
|
||||
}
|
||||
}
|
||||
cur.defaultValue = cur.value;
|
||||
});
|
||||
}
|
||||
function getColumnList() {
|
||||
// 没有开启列表权限
|
||||
let columnList = state.columnList;
|
||||
state.exportList = columnList;
|
||||
let columns = columnList.map((o) => ({
|
||||
...o,
|
||||
title: o.labelI18nCode ? t(o.labelI18nCode, o.label) : o.label,
|
||||
dataIndex: o.prop,
|
||||
align: o.align,
|
||||
fixed: o.fixed == 'none' ? false : o.fixed,
|
||||
sorter: o.sortable ? { multiple: 1 } : o.sortable,
|
||||
width: o.width || 100,
|
||||
}));
|
||||
//添加复杂表头
|
||||
columns = getComplexColumns(columns);
|
||||
state.columns = columns.filter((o) => o.prop.indexOf('-') < 0);
|
||||
//子表表头
|
||||
getChildComplexColumns(columns);
|
||||
}
|
||||
|
||||
|
||||
//复杂表头
|
||||
function getComplexColumns(columns) {
|
||||
//这里生成复杂表头的配置
|
||||
let complexHeaderList: any[] = [];
|
||||
if (!complexHeaderList.length) return columns;
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.label = e.fullName;
|
||||
e.labelI18nCode = e.fullNameI18nCode;
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.dataIndex = e.id;
|
||||
e.prop = e.id;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < columns.length; j++) {
|
||||
const o = columns[j];
|
||||
if (o.prop == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].prop);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
const e = columns[i];
|
||||
if (!childColumns.includes(e.prop)) {
|
||||
list.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.prop)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.prop));
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//子表表头
|
||||
function getChildComplexColumns(columnList) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i];
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e);
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0];
|
||||
let vModel = e.prop.split('-')[1];
|
||||
let label = e.label.split('-')[0];
|
||||
let childLabel = e.label.replace(label + '-', '');
|
||||
if (e.fullNameI18nCode && Array.isArray(e.fullNameI18nCode) && e.fullNameI18nCode[0]) label = t(e.fullNameI18nCode[0], label);
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
yunzhupaasKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
title: label,
|
||||
dataIndex: prop,
|
||||
children: [],
|
||||
};
|
||||
e.dataIndex = vModel;
|
||||
e.title = e.labelI18nCode ? t(e.labelI18nCode, childLabel) : childLabel;
|
||||
if (!state.expandObj.hasOwnProperty(prop+`Expand`)) state.expandObj[prop+`Expand`] = false;
|
||||
if (!list.some((o) => o.prop === prop)) list.push(newItem);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 行内分组展示
|
||||
getMergeList(list);
|
||||
|
||||
state.complexColumns = list;
|
||||
state.childColumnList = list.filter((o) => o.yunzhupaasKey === 'table');
|
||||
|
||||
// 子表分组展示宽度取100
|
||||
for (let i = 0; i < state.childColumnList.length; i++) {
|
||||
const e = state.childColumnList[i];
|
||||
if (e.children?.length) e.children = e.children.map(o => ({ ...o, width: 100 }));
|
||||
}
|
||||
}
|
||||
function getMergeList(list) {
|
||||
list.forEach((item) => {
|
||||
if (item.yunzhupaasKey === 'table' && item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
child.customCell = () => ({
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
class: 'child-table-box',
|
||||
});
|
||||
} else {
|
||||
child.customCell = () => ({
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleExpand(row, field) {
|
||||
row[field] = !row[field];
|
||||
}
|
||||
// 关联表单查看详情
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function handleColumnChange(data) {
|
||||
state.columnSettingList = data;
|
||||
}
|
||||
function getTableActions(record): ActionItem[] {
|
||||
return [
|
||||
{
|
||||
label: t('common.editText','编辑') ,
|
||||
disabled: ![0,8,9].includes(record.flowState), //有流程加上
|
||||
onClick: updateHandle.bind(null, record),
|
||||
auth: 'btn_edit', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.delText','删除') ,
|
||||
color: 'error',
|
||||
disabled: ![0,9].includes(record.flowState), //有流程加上
|
||||
modelConfirm: {
|
||||
onOk: handleDelete.bind(null, record.id),
|
||||
},
|
||||
auth: 'btn_remove', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.detailText','详情') ,
|
||||
disabled: !record.flowState, //有流程加上
|
||||
onClick: goDetail.bind(null, record),
|
||||
auth: 'btn_detail', //有按钮权限
|
||||
},
|
||||
];
|
||||
}
|
||||
// 编辑
|
||||
function updateHandle(record) {
|
||||
// 带工作流
|
||||
let data = {
|
||||
id: record.flowTaskId || record.id,
|
||||
flowId: state.flowId,
|
||||
opType: '-1',
|
||||
};
|
||||
openFlowParser(true, data);
|
||||
}
|
||||
// 删除
|
||||
function handleDelete(id) {
|
||||
const query={ids:[id] ,flowId:state.flowId }
|
||||
batchDelete(query).then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
});
|
||||
}
|
||||
// 查看详情
|
||||
function goDetail(record) {
|
||||
// 带流程
|
||||
const data = {
|
||||
id: record.flowTaskId,
|
||||
flowId: state.flowId,
|
||||
opType: 0,
|
||||
status: record.flowState,
|
||||
};
|
||||
openFlowParser(true, data);
|
||||
}
|
||||
// // 新增
|
||||
// function addHandle() {
|
||||
// // 带流程新增
|
||||
// const data = {
|
||||
// id: '',
|
||||
// flowId: state.flowId,
|
||||
// opType: '-1',
|
||||
// };
|
||||
// openFlowParser(true, data);
|
||||
// }
|
||||
function addHandle() {
|
||||
// 打开选择合同的弹框,而不是直接打开表单
|
||||
openSelectModal(true);
|
||||
}
|
||||
|
||||
// 4. 新增确认选择后的处理方法
|
||||
function handleSelectConfirm(selectedRow) {
|
||||
// 准备传递给 form 页面的数据
|
||||
// 关键点:你需要将选中的数据,构造成和通过工作流表单提交时相同的数据结构
|
||||
// 因为 form 页面的 selfGetInfo 方法会根据传入的 data 来填充表单。
|
||||
// 最简单的做法是,把 selectedRow 里的所有字段都放进去。
|
||||
const dataForForm = {
|
||||
id: '', // 新增时 id 为空
|
||||
flowId: state.flowId,
|
||||
opType: '-1',
|
||||
// 将选中的合同数据传递下去
|
||||
data: {
|
||||
...selectedRow,
|
||||
// 你可能还需要处理一些特殊字段,比如日期格式等
|
||||
// contract_date: selectedRow.contract_date ? dayjs(selectedRow.contract_date) : undefined,
|
||||
}
|
||||
};
|
||||
|
||||
// 打开工作流表单,并将数据传进去
|
||||
openFlowParser(true, dataForForm);
|
||||
}
|
||||
// 导出
|
||||
function handleDownload(data) {
|
||||
let query = { ...getFetchParams(), ...data };
|
||||
exportData(query)
|
||||
.then((res) => {
|
||||
setExportModalProps({ confirmLoading: false });
|
||||
if (!res.data.url) return;
|
||||
downloadByUrl({ url: res.data.url });
|
||||
closeExportModal();
|
||||
})
|
||||
.catch(() => {
|
||||
setExportModalProps({ confirmLoading: false });
|
||||
});
|
||||
}
|
||||
// 高级查询
|
||||
function handleSuperQuery(superQueryJson) {
|
||||
searchInfo.superQueryJson = superQueryJson;
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function handleSearchReset() {
|
||||
clearSelectedRowKeys();
|
||||
if (!state.resetFromTree) updateSearchFormValue();
|
||||
if (state.resetFromTree) state.resetFromTree = false;
|
||||
}
|
||||
|
||||
function handleSearchSubmit(data) {
|
||||
clearSelectedRowKeys();
|
||||
let obj = {
|
||||
...defaultSearchInfo,
|
||||
superQueryJson: searchInfo.superQueryJson,
|
||||
...data,
|
||||
};
|
||||
Object.keys(searchInfo).map(key => {
|
||||
delete searchInfo[key];
|
||||
});
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
searchInfo[key.replaceAll('-', '_')] = value;
|
||||
}
|
||||
console.log(searchInfo);
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function updateSearchFormValue() {
|
||||
if (!state.treeActiveId) return searchFormSubmit();
|
||||
let queryJson: any = {};
|
||||
let leftTreeActiveInfo: any = {};
|
||||
const isMultiple = !state.treeRelationObj ? false : state.treeRelationObj.searchMultiple;
|
||||
//多级左侧树,需要拼父级->转为查询参数
|
||||
if (state.treeRelationObj && state.treeRelationObj.yunzhupaasKey && ['organizeSelect', 'cascader', 'areaSelect'].includes(state.treeRelationObj.yunzhupaasKey)) {
|
||||
let currValue = [];
|
||||
currValue = state.treeActiveNodePath.map(o => o[state.treeFieldNames.key]);
|
||||
queryJson = { '': isMultiple ? [currValue] : currValue };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [currValue] : currValue };
|
||||
} else {
|
||||
queryJson = { '': isMultiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
}
|
||||
state.leftTreeActiveInfo = leftTreeActiveInfo;
|
||||
if(unref(getSearchList)?.length){
|
||||
// 有搜索列表
|
||||
setFieldsValue(queryJson);
|
||||
searchFormSubmit();
|
||||
}else{
|
||||
// 无搜索列表
|
||||
handleSearchSubmit(queryJson);
|
||||
}
|
||||
}
|
||||
function getFlowId(){
|
||||
if(!state.flowId){
|
||||
createMessage.error('流程模板的flowId未填写')
|
||||
close();
|
||||
router.replace('/404');
|
||||
return
|
||||
}
|
||||
getFlowStartFormId(state.flowId).then(res => {
|
||||
init()
|
||||
}).catch(() => {
|
||||
close();
|
||||
router.replace('/404');
|
||||
});
|
||||
}
|
||||
function initViewList(currentId = '') {
|
||||
const query = {
|
||||
menuId: route.meta.modelId,
|
||||
};
|
||||
getViewList(query).then(res => {
|
||||
const columns : any[]= state.complexColumns;
|
||||
const searchList: any[] = state.searchSchemas.map(o => ({ label: o.label, id: o.field, show: o.show, labelI18nCode: o.labelI18nCode }));
|
||||
const columnList: any[] = columns.map(o => ({ label: o.label, id: o.prop, show: true, fixed: o.fixed || 'none', labelI18nCode: o.labelI18nCode }));
|
||||
state.viewList = (res.data || []).map(o => {
|
||||
if (o.type == 0) return { ...o, searchList, columnList };
|
||||
return { ...o, searchList: o.searchList ? JSON.parse(o.searchList) : [], columnList: o.columnList ? JSON.parse(o.columnList) : [] };
|
||||
});
|
||||
if (currentId) {
|
||||
state.currentView = state.viewList.filter(o => o.id === currentId)[0] || state.viewList[0];
|
||||
} else {
|
||||
state.currentView = state.viewList.filter(o => o.status === 1)[0] || state.viewList[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleViewClick(item) {
|
||||
state.currentView = item;
|
||||
}
|
||||
|
||||
function setListValue(data: any[] = [], defaultData: any[] = [], key) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
for (let j = 0; j < defaultData.length; j++) {
|
||||
if (data[i].show && data[i].id == defaultData[j][key]) list.push(defaultData[j]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getFlowId()
|
||||
});
|
||||
</script>
|
||||
418
src/views/cm/contracttemp/Detail.vue
Normal file
418
src/views/cm/contracttemp/Detail.vue
Normal file
@@ -0,0 +1,418 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" :title="title" width="80%" showFooter
|
||||
:showOkBtn="false">
|
||||
<template #insertFooter>
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form ">
|
||||
<!-- 表单 -->
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" ref="formRef" >
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="contract_temp_code" >
|
||||
<template #label>合同模版编码
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.contract_temp_code"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.contract_temp_code" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="contract_temp_name" >
|
||||
<template #label>合同模版名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.contract_temp_name"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.contract_temp_name" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remark" >
|
||||
<template #label>备注
|
||||
</template> <p>{{dataForm.remark}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-tabs v-model:activeKey="state.activetabformItem45e7a2" tabPosition="left" class="mb-20" >
|
||||
<a-tab-pane tab="合同框架" key="1" forceRender>
|
||||
<a-row :gutter="15">
|
||||
<table class="table-grid-box" :style='{"--borderType":"solid","--borderColor":"#E2E0E0","--borderWidth":"1px"}'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="is_framework" >
|
||||
<template #label>框架合同
|
||||
<BasicHelp text="是:只有合同基本信息和合同主体,无合同清单、金额、付款计划。否:反之" /></template> <p>{{dataForm.is_framework}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="is_detail_list" >
|
||||
<template #label>清单合同
|
||||
<BasicHelp text="是:显示合同清单,合同金额根据清单金额汇总生成;否:不显示清单,只显示合同金额与付款计划,合同金额手工录入" /></template> <p>{{dataForm.is_detail_list}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableProductList" >
|
||||
<template #label>启用产品清单
|
||||
</template> <p>{{dataForm.enable_tableProductList}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableMaterialList" >
|
||||
<template #label>启用材料清单
|
||||
</template> <p>{{dataForm.enable_tableMaterialList}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableWorktypeList" >
|
||||
<template #label>启用人力清单
|
||||
</template> <p>{{dataForm.enable_tableWorktypeList}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableAssetList" >
|
||||
<template #label>启用资产清单
|
||||
</template> <p>{{dataForm.enable_tableAssetList}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableTaskList" >
|
||||
<template #label>启用任务清单
|
||||
</template> <p>{{dataForm.enable_tableTaskList}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</a-row>
|
||||
</a-tab-pane >
|
||||
<a-tab-pane tab="合同参数" key="2" forceRender>
|
||||
<a-row :gutter="15">
|
||||
<table class="table-grid-box" :style='{"--borderType":"solid","--borderColor":"#E2E0E0","--borderWidth":"1px"}'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="contract_type" >
|
||||
<template #label>合同类型
|
||||
</template> <p>{{dataForm.contract_type}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_printing" >
|
||||
<template #label>启用在线打印
|
||||
</template> <p>{{dataForm.enable_printing}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="our_company_type" >
|
||||
<template #label>我方签约类型
|
||||
</template> <p>{{dataForm.our_company_type}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="second_party_type" >
|
||||
<template #label>乙方签约类型
|
||||
</template> <p>{{dataForm.second_party_type}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" rowspan="1">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="third_party_type" >
|
||||
<template #label>丙方签约类型
|
||||
</template> <p>{{dataForm.third_party_type}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</a-row>
|
||||
</a-tab-pane >
|
||||
<a-tab-pane tab="打印模版" key="fbb4be" forceRender>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item mb-20px" >
|
||||
<a-form-item>
|
||||
<a-table :data-source="dataForm.tablePrintingTemp"
|
||||
:columns="contractPrintingTempColumns" size="small" :pagination="false" :scroll="{ x: 'max-content' }">
|
||||
<template #headerCell="{ column }">
|
||||
<span class="required-sign" v-if="column.required">*</span>
|
||||
{{ column.title }}
|
||||
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, index, record }">
|
||||
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
|
||||
<template v-if="column.key === 'printing_temp_id' ">
|
||||
<p>{{record.printing_temp_id}}</p>
|
||||
</template>
|
||||
<template v-if="column.key === 'is_enabled' ">
|
||||
<p>{{record.is_enabled}}</p>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-tab-pane >
|
||||
</a-tabs>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicDrawer>
|
||||
<!-- 有关联表单详情:开始 -->
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<!-- 有关联表单详情:结束 -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getDetailInfo } from './helper/api';
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev';
|
||||
import { reactive, toRefs, nextTick, ref, computed, unref ,toRaw} from 'vue';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { BasicDrawer, useDrawer } from '@/components/Drawer';
|
||||
// 有关联表单详情
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { getDataChange } from '@/api/onlineDev/visualDev';
|
||||
import { getDataInterfaceDataInfoByIds } from '@/api/systemData/dataInterface';
|
||||
import ExtraRelationInfo from '@/components/yunzhupaas/RelationForm/src/ExtraRelationInfo.vue';
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
title: string;
|
||||
maskConfig: any;
|
||||
interfaceRes: any;
|
||||
locationScope: any;
|
||||
extraOptions: any;
|
||||
extraData: any;
|
||||
|
||||
activetabformItem45e7a2:any;
|
||||
}
|
||||
|
||||
defineOptions({ name: 'Detail' });
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const [registerDrawer, { openDrawer, setDrawerProps, closeDrawer }] = useDrawer();
|
||||
const contractPrintingTempColumns: any[] = computed(() => {
|
||||
let list = [
|
||||
{
|
||||
title: '打印模版ID' ,
|
||||
dataIndex: 'printing_temp_id' ,
|
||||
key: 'printing_temp_id' ,
|
||||
width: 350,
|
||||
labelWidth: '' ,
|
||||
span:'24',
|
||||
tipLabel: '' ,
|
||||
required: false,
|
||||
style: {"width":"100%"} ,
|
||||
align: 'left',
|
||||
fixed: false ,
|
||||
formP: 'printing_temp_id' ,
|
||||
},
|
||||
{
|
||||
title: '是否启用' ,
|
||||
dataIndex: 'is_enabled' ,
|
||||
key: 'is_enabled' ,
|
||||
labelWidth: '' ,
|
||||
span:'24',
|
||||
tipLabel: '' ,
|
||||
required: false,
|
||||
style: '',
|
||||
align: 'left',
|
||||
fixed: false ,
|
||||
formP: 'is_enabled' ,
|
||||
},
|
||||
];
|
||||
const indexColumn = { title: '序号', showLabel: true, dataIndex: 'index', key: 'index', align: 'center', fixed: 'left', width: 50 };
|
||||
//子表复杂表头-处理
|
||||
let columnList = list;
|
||||
let complexHeaderList: any[] = [];
|
||||
if (complexHeaderList.length) {
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode,e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < list.length; j++) {
|
||||
const o = list[j];
|
||||
if (o.key == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].key);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let newList: any[] = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const e = list[i];
|
||||
if (!childColumns.includes(e.key) || e.fixed === 'left' || e.fixed === 'right') {
|
||||
newList.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.key)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.key));
|
||||
newList.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
columnList = newList;
|
||||
}
|
||||
let columns = [indexColumn, ...columnList]
|
||||
const leftFixedList = columns.filter(o => o.fixed === 'left');
|
||||
const rightFixedList = columns.filter(o => o.fixed === 'right');
|
||||
const noFixedList = columns.filter(o => o.fixed !== 'left' && o.fixed !== 'right');
|
||||
return [...leftFixedList, ...noFixedList, ...rightFixedList];
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
const relationDetailRef = ref<any>(null);
|
||||
const state = reactive<State>({
|
||||
dataForm:{},
|
||||
title: t('common.detailText','详情'),
|
||||
maskConfig:{
|
||||
contract_temp_code: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
contract_temp_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
}
|
||||
,
|
||||
interfaceRes: {"enable_tableAssetList":[],"is_framework":[],"enable_tableMaterialList":[],"enable_printing":[],"our_company_type":[],"third_party_type":[],"remark":[],"contractPrintingTempprinting_temp_id":[],"enable_tableWorktypeList":[],"contract_type":[],"enable_tableTaskList":[],"contractPrintingTempis_enabled":[],"contract_temp_code":[],"enable_tableProductList":[],"is_detail_list":[],"second_party_type":[],"contract_temp_name":[]},
|
||||
locationScope:{
|
||||
}
|
||||
,
|
||||
extraOptions: {
|
||||
}
|
||||
,
|
||||
extraData: {
|
||||
}
|
||||
,
|
||||
activetabformItem45e7a2:'1',
|
||||
});
|
||||
const { title, dataForm, maskConfig } = toRefs(state);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.dataForm.id = data.id;
|
||||
openDrawer();
|
||||
nextTick(() => {
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
state.activetabformItem45e7a2='1';
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
closeDrawer();
|
||||
}
|
||||
}
|
||||
function getData(id) {
|
||||
getDetailInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
nextTick(() => {
|
||||
changeLoading(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setDrawerProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setFormProps({ loading });
|
||||
}
|
||||
|
||||
function getParamList(key) {
|
||||
let templateJson: any[] = state.interfaceRes[key];
|
||||
if (!templateJson || !templateJson.length || !state.dataForm) return templateJson;
|
||||
for (let i = 0; i < templateJson.length; i++) {
|
||||
if (templateJson[i].relationField && templateJson[i].sourceType == 1) {
|
||||
templateJson[i].defaultValue = state.dataForm[templateJson[i].relationField + '_id'] || '';
|
||||
}
|
||||
}
|
||||
return templateJson;
|
||||
}
|
||||
</script>
|
||||
892
src/views/cm/contracttemp/Form.vue
Normal file
892
src/views/cm/contracttemp/Form.vue
Normal file
@@ -0,0 +1,892 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" width="80%" showFooter
|
||||
:cancelText="t('common.cancelText','取消')"
|
||||
:okText="t('common.okText','确定')"
|
||||
@ok="handleSubmit" :closeFunc="onClose">
|
||||
<template #title>
|
||||
<a-space :size="10">
|
||||
<div class="text-16px font-medium">{{ title }}</div>
|
||||
<a-space-compact size="small" block v-if="dataForm.id">
|
||||
<a-tooltip :title="t('common.prevRecord')">
|
||||
<a-button size="small" :disabled="getPrevDisabled" @click="handlePrev">
|
||||
<i class="icon-ym icon-ym-caret-left text-10px"></i>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip :title="t('common.nextRecord')">
|
||||
<a-button size="small" :disabled="getNextDisabled" @click="handleNext">
|
||||
<i class="icon-ym icon-ym-caret-right text-10px"></i>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space-compact>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #insertFooter>
|
||||
<div class="float-left mt-5px">
|
||||
<yunzhupaasCheckboxSingle v-model:value="submitType" :label="continueText" />
|
||||
</div>
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form ">
|
||||
<!-- 表单 -->
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" :rules="dataRule" ref="formRef" >
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="contract_temp_code" >
|
||||
<template #label>合同模版编码
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.contract_temp_code" @change="changeData('contract_temp_code',-1)"
|
||||
placeholder="请输入" :allowClear='true' :style='{"width":"100%"}' :maskConfig = "maskConfig.contract_temp_code" :showCount = "false" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="contract_temp_name" >
|
||||
<template #label>合同模版名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.contract_temp_name" @change="changeData('contract_temp_name',-1)"
|
||||
placeholder="请输入" :allowClear='true' :style='{"width":"100%"}' :maskConfig = "maskConfig.contract_temp_name" :showCount = "false" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remark" >
|
||||
<template #label>备注
|
||||
</template> <YunzhupaasTextarea v-model:value="dataForm.remark" @change="changeData('remark',-1)"
|
||||
placeholder="请输入" :allowClear='true' :style='{"width":"100%"}' :autoSize='{"minRows":3,"maxRows":3}' :showCount = "false" >
|
||||
</YunzhupaasTextarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-tabs v-model:activeKey="state.activetabformItem45e7a2" tabPosition="left" class="mb-20" >
|
||||
<a-tab-pane tab="合同框架" key="1" forceRender>
|
||||
<a-row :gutter="15">
|
||||
<table class="table-grid-box" :style='{"--borderType":"solid","--borderColor":"#E2E0E0","--borderWidth":"1px"}'>
|
||||
<tbody
|
||||
>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="is_framework" >
|
||||
<template #label>框架合同
|
||||
<BasicHelp text="是:只有合同基本信息和合同主体,无合同清单、金额、付款计划。否:反之" /></template> <YunzhupaasSwitch v-model:value="dataForm.is_framework" @change="changeData('is_framework',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="is_detail_list" >
|
||||
<template #label>清单合同
|
||||
<BasicHelp text="是:显示合同清单,合同金额根据清单金额汇总生成;否:不显示清单,只显示合同金额与付款计划,合同金额手工录入" /></template> <YunzhupaasSwitch v-model:value="dataForm.is_detail_list" @change="changeData('is_detail_list',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableProductList" >
|
||||
<template #label>启用产品清单
|
||||
</template> <YunzhupaasSwitch v-model:value="dataForm.enable_tableProductList" @change="changeData('enable_tableProductList',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableMaterialList" >
|
||||
<template #label>启用材料清单
|
||||
</template> <YunzhupaasSwitch v-model:value="dataForm.enable_tableMaterialList" @change="changeData('enable_tableMaterialList',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableWorktypeList" >
|
||||
<template #label>启用人力清单
|
||||
</template> <YunzhupaasSwitch v-model:value="dataForm.enable_tableWorktypeList" @change="changeData('enable_tableWorktypeList',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableAssetList" >
|
||||
<template #label>启用资产清单
|
||||
</template> <YunzhupaasSwitch v-model:value="dataForm.enable_tableAssetList" @change="changeData('enable_tableAssetList',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_tableTaskList" >
|
||||
<template #label>启用任务清单
|
||||
</template> <YunzhupaasSwitch v-model:value="dataForm.enable_tableTaskList" @change="changeData('enable_tableTaskList',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</a-row>
|
||||
</a-tab-pane >
|
||||
<a-tab-pane tab="合同参数" key="2" forceRender>
|
||||
<a-row :gutter="15">
|
||||
<table class="table-grid-box" :style='{"--borderType":"solid","--borderColor":"#E2E0E0","--borderWidth":"1px"}'>
|
||||
<tbody
|
||||
>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="contract_type" >
|
||||
<template #label>合同类型
|
||||
</template> <YunzhupaasSelect v-model:value="dataForm.contract_type" @change="changeData('contract_type',-1)"
|
||||
placeholder="请选择" :templateJson="state.interfaceRes.contract_type" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.contract_typeOptions" :fieldNames="optionsObj.contract_typeProps"
|
||||
>
|
||||
</YunzhupaasSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="enable_printing" >
|
||||
<template #label>启用在线打印
|
||||
</template> <YunzhupaasSwitch v-model:value="dataForm.enable_printing" @change="changeData('enable_printing',-1)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="our_company_type" >
|
||||
<template #label>我方签约类型
|
||||
</template> <YunzhupaasSelect v-model:value="dataForm.our_company_type" @change="changeData('our_company_type',-1)"
|
||||
placeholder="请选择" :templateJson="state.interfaceRes.our_company_type" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.our_company_typeOptions" :fieldNames="optionsObj.our_company_typeProps"
|
||||
>
|
||||
</YunzhupaasSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="second_party_type" >
|
||||
<template #label>乙方签约类型
|
||||
</template> <YunzhupaasSelect v-model:value="dataForm.second_party_type" @change="changeData('second_party_type',-1)"
|
||||
placeholder="请选择" :templateJson="state.interfaceRes.second_party_type" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.second_party_typeOptions" :fieldNames="optionsObj.second_party_typeProps"
|
||||
>
|
||||
</YunzhupaasSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="third_party_type" >
|
||||
<template #label>丙方签约类型
|
||||
</template> <YunzhupaasSelect v-model:value="dataForm.third_party_type" @change="changeData('third_party_type',-1)"
|
||||
placeholder="请选择" :templateJson="state.interfaceRes.third_party_type" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.third_party_typeOptions" :fieldNames="optionsObj.third_party_typeProps"
|
||||
>
|
||||
</YunzhupaasSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</td>
|
||||
<td colspan="1" rowspan="1"
|
||||
>
|
||||
<a-row :gutter="15">
|
||||
</a-row>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</a-row>
|
||||
</a-tab-pane >
|
||||
<a-tab-pane tab="打印模版" key="fbb4be" forceRender>
|
||||
<a-row :gutter="15">
|
||||
|
||||
<a-col :span="24" class="ant-col-item mb-20px" >
|
||||
<a-form-item>
|
||||
<a-table :data-source="dataForm.contractPrintingTempList"
|
||||
:columns="contractPrintingTempColumns" size="small" :pagination="false" :scroll="{ x: 'max-content' }"
|
||||
:rowSelection="getcontractPrintingTempRowSelection" rowKey="yunzhupaasId">
|
||||
<template #headerCell="{ column }">
|
||||
<span class="required-sign" v-if="column.required">*</span>
|
||||
{{ column.title }}
|
||||
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, index, record }">
|
||||
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
|
||||
<template v-if="column.key === 'printing_temp_id' ">
|
||||
<YunzhupaasPopupTableSelect v-model:value="record.printing_temp_id" @change="changeData('contractPrintingTempprinting_temp_id',index)"
|
||||
placeholder="请选择" :rowIndex="index" :formData="dataForm"
|
||||
:templateJson="state.interfaceRes.contractPrintingTempprinting_temp_id" :allowClear='true' :style='{"width":"100%"}' :showSearch='true' :field="'printing_temp_id'+index" interfaceId="826713957526931333"
|
||||
:columnOptions="optionsObj.contractPrintingTempprinting_temp_idcolumnOptions" propsValue="f_id" relationField="f_full_name" popupType="popover"
|
||||
popupTitle="选择数据" popupWidth="800px" >
|
||||
</YunzhupaasPopupTableSelect>
|
||||
</template>
|
||||
<template v-if="column.key === 'is_enabled' ">
|
||||
<YunzhupaasSwitch v-model:value="record.is_enabled" @change="changeData('contractPrintingTempis_enabled',index)"
|
||||
>
|
||||
</YunzhupaasSwitch>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-button class="action-btn" type="link" @click="copyContractPrintingTempRow(index)" size="small"> {{t('common.copyText', '复制')}} </a-button>
|
||||
<a-button class="action-btn" type="link" color="error" @click="removeContractPrintingTempRow(index,true)" size="small"> {{t('common.delText', '删除')}} </a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</a-table>
|
||||
<a-space class="input-table-footer-btn" >
|
||||
<a-button type ='primary' preIcon="icon-ym icon-ym-btn-add"
|
||||
@click="addContractPrintingTempRow"> {{t('common.add1Text','添加')}} </a-button>
|
||||
<a-button type ='danger' preIcon="icon-ym icon-ym-btn-clearn"
|
||||
@click="batchRemoveContractPrintingTempRow(true)"> {{t('common.batchDelText','批量删除')}} </a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-tab-pane >
|
||||
</a-tabs>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { create, update, getInfo } from './helper/api';
|
||||
import { reactive, toRefs, nextTick, ref, unref, computed,toRaw, inject } from 'vue';
|
||||
import { BasicDrawer, useDrawer } from '@/components/Drawer';
|
||||
import { yunzhupaasRelationForm } from '@/components/yunzhupaas';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import type { FormInstance } from 'ant-design-vue';
|
||||
import { thousandsFormat , getDateTimeUnit, getTimeUnit} from '@/utils/yunzhupaas';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import dayjs from 'dayjs';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
tableRows: any;
|
||||
dataRule: any;
|
||||
optionsObj: any;
|
||||
childIndex: any;
|
||||
isEdit: any;
|
||||
interfaceRes: any;
|
||||
//可选范围默认值
|
||||
ableAll: any;
|
||||
//掩码配置
|
||||
maskConfig:any;
|
||||
//定位属性
|
||||
locationScope:any;
|
||||
activetabformItem45e7a2:any;
|
||||
selectedcontractPrintingTempRowKeys : any;
|
||||
extraOptions: any;
|
||||
title: string;
|
||||
continueText: string; allList: any[];
|
||||
currIndex: number;
|
||||
isContinue: boolean;
|
||||
submitType: number;
|
||||
showContinueBtn: boolean;
|
||||
}
|
||||
|
||||
const emit = defineEmits(['reload']);
|
||||
const getLeftTreeActiveInfo: (() => any) | null = inject('getLeftTreeActiveInfo', null);
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const [registerDrawer, { openDrawer, setDrawerProps }] = useDrawer();
|
||||
const formRef = ref<FormInstance>();
|
||||
const contractPrintingTempColumns: any[] = computed(() => {
|
||||
let list = [
|
||||
{
|
||||
title: '打印模版ID' ,
|
||||
dataIndex: 'printing_temp_id' ,
|
||||
key: 'printing_temp_id' ,
|
||||
width: 350,
|
||||
labelWidth: '' ,
|
||||
span:'24',
|
||||
tipLabel: '' ,
|
||||
required: false,
|
||||
style: {"width":"100%"} ,
|
||||
align: 'left' ,
|
||||
fixed: false ,
|
||||
formP: 'printing_temp_id' ,
|
||||
},
|
||||
{
|
||||
title: '是否启用' ,
|
||||
dataIndex: 'is_enabled' ,
|
||||
key: 'is_enabled' ,
|
||||
labelWidth: '' ,
|
||||
span:'24',
|
||||
tipLabel: '' ,
|
||||
required: false,
|
||||
style: '',
|
||||
align: 'left' ,
|
||||
fixed: false ,
|
||||
formP: 'is_enabled' ,
|
||||
},
|
||||
];
|
||||
list.push({ title: t('component.table.action'), showLabel: true, dataIndex: 'action', key: 'action', align: 'center', fixed: 'right', width: 100 }); const indexColumn = { title: t('component.table.index'), showLabel: true, dataIndex: 'index', key: 'index', align: 'center', fixed: 'left', width: 50 };
|
||||
//子表复杂表头-处理
|
||||
let columnList = list;
|
||||
let complexHeaderList: any[] = [];
|
||||
if (complexHeaderList.length) {
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode,e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < list.length; j++) {
|
||||
const o = list[j];
|
||||
if (o.key == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].key);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let newList: any[] = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const e = list[i];
|
||||
if (!childColumns.includes(e.key) || e.fixed === 'left' || e.fixed === 'right') {
|
||||
newList.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.key)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.key));
|
||||
newList.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
columnList = newList;
|
||||
}
|
||||
let columns = [indexColumn, ...columnList]
|
||||
const leftFixedList = columns.filter(o => o.fixed === 'left');
|
||||
const rightFixedList = columns.filter(o => o.fixed === 'right');
|
||||
const noFixedList = columns.filter(o => o.fixed !== 'left' && o.fixed !== 'right');
|
||||
return [...leftFixedList, ...noFixedList, ...rightFixedList];
|
||||
});
|
||||
|
||||
const getcontractPrintingTempHasBatchBtn = computed(() =>{
|
||||
let flist:any[] = [{"btnIcon":"icon-ym icon-ym-btn-add","show":true,"label":"添加","btnType":"primary","value":"add","labelI18nCode":"common.add1Text"},{"btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":"true","show":true,"label":"批量删除","btnType":"danger","value":"batchRemove","labelI18nCode":"common.batchDelText"}]
|
||||
return flist?.length && flist.some(o => o.value == 'batchRemove' && !!o.show)
|
||||
});
|
||||
|
||||
const getcontractPrintingTempRowSelection = computed(() => {
|
||||
if (!unref(getcontractPrintingTempHasBatchBtn )) return undefined;
|
||||
const rowSelection = {
|
||||
selectedRowKeys: state.selectedcontractPrintingTempRowKeys,
|
||||
onChange: (selectedRowKeys: string[]) => {
|
||||
state.selectedcontractPrintingTempRowKeys = selectedRowKeys;
|
||||
},
|
||||
};
|
||||
return rowSelection;
|
||||
});
|
||||
|
||||
const state = reactive<State>({
|
||||
dataForm: {
|
||||
contract_temp_code:undefined,
|
||||
contract_temp_name:undefined,
|
||||
remark:undefined,
|
||||
is_framework:0,
|
||||
is_detail_list:1,
|
||||
enable_tableProductList:0,
|
||||
enable_tableMaterialList:0,
|
||||
enable_tableWorktypeList:0,
|
||||
enable_tableAssetList:0,
|
||||
enable_tableTaskList:0,
|
||||
contract_type:'',
|
||||
enable_printing:1,
|
||||
our_company_type:'PartA',
|
||||
second_party_type:'PartB',
|
||||
third_party_type:'PartC',
|
||||
contractPrintingTempList:[],
|
||||
},
|
||||
|
||||
tableRows:{
|
||||
contractPrintingTempList:{
|
||||
printing_temp_id : '',
|
||||
is_enabled : 0,
|
||||
enabledmark:undefined
|
||||
},
|
||||
},
|
||||
|
||||
dataRule: {
|
||||
contract_temp_code: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
contract_temp_name: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
contract_type: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.arrayRequiredPrefix ','请至少选择一个'),
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
optionsObj:{
|
||||
contract_typeOptions:[{"fullName":"收入合同","id":"REV"},{"fullName":"支出合同","id":"COS"}],
|
||||
contract_typeProps:{"label":"fullName","value":"id" },
|
||||
our_company_typeOptions:[{"fullName":"甲方","id":"PartA"},{"fullName":"乙方","id":"PartB"},{"fullName":"丙方","id":"PartC"}],
|
||||
our_company_typeProps:{"label":"fullName","value":"id" },
|
||||
second_party_typeOptions:[{"fullName":"甲方","id":"PartA"},{"fullName":"乙方","id":"PartB"},{"fullName":"丙方","id":"PartC"}],
|
||||
second_party_typeProps:{"label":"fullName","value":"id" },
|
||||
third_party_typeOptions:[{"fullName":"甲方","id":"PartA"},{"fullName":"乙方","id":"PartB"},{"fullName":"丙方","id":"PartC"}],
|
||||
third_party_typeProps:{"label":"fullName","value":"id" },
|
||||
contractPrintingTempprinting_temp_idcolumnOptions:[ {"label":"打印模版名称","value":"f_full_name"}, {"label":"打印模版描述","value":"f_description"},],
|
||||
},
|
||||
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {"enable_tableAssetList":[],"is_framework":[],"enable_tableMaterialList":[],"enable_printing":[],"our_company_type":[],"third_party_type":[],"remark":[],"contractPrintingTempprinting_temp_id":[],"enable_tableWorktypeList":[],"contract_type":[],"enable_tableTaskList":[],"contractPrintingTempis_enabled":[],"contract_temp_code":[],"enable_tableProductList":[],"is_detail_list":[],"second_party_type":[],"contract_temp_name":[]},
|
||||
//可选范围默认值
|
||||
ableAll:{
|
||||
},
|
||||
|
||||
//掩码配置
|
||||
maskConfig:{
|
||||
contract_temp_code: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
contract_temp_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
},
|
||||
|
||||
//定位属性
|
||||
locationScope:{
|
||||
},
|
||||
|
||||
activetabformItem45e7a2:'1',
|
||||
selectedcontractPrintingTempRowKeys : [],
|
||||
extraOptions:{
|
||||
},
|
||||
|
||||
title: "",
|
||||
continueText: "", allList: [],
|
||||
currIndex: 0,
|
||||
isContinue: false,
|
||||
submitType: 0,
|
||||
showContinueBtn: true ,
|
||||
});
|
||||
const { title, continueText, showContinueBtn, dataRule, dataForm, optionsObj, ableAll, maskConfig,submitType } = toRefs(state);
|
||||
|
||||
const getPrevDisabled = computed(() => state.currIndex === 0);
|
||||
const getNextDisabled = computed(() => state.currIndex === state.allList.length - 1);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.submitType = 0;
|
||||
state.isContinue = false;
|
||||
state.title = !data.id ? t('common.add2Text','新增') : t('common.editText','编辑');
|
||||
state.continueText = !data.id ? t('common.continueAndAddText','确定并新增') : t('common.continueText','确定并继续'); setFormProps({ continueLoading: false });
|
||||
state.dataForm.id = data.id;
|
||||
openDrawer();
|
||||
state.allList = data.allList;
|
||||
state.currIndex = state.allList.length && data.id ? state.allList.findIndex((item) => item.id === data.id) : 0;
|
||||
nextTick(() => {
|
||||
getForm().resetFields();
|
||||
state.dataForm.contractPrintingTempList = [];
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
state.activetabformItem45e7a2='1';
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
//初始化options
|
||||
|
||||
if (state.dataForm.contractPrintingTempList) {
|
||||
for (let i = 0; i < state.dataForm.contractPrintingTempList.length; i++) {
|
||||
state.childIndex = i;
|
||||
state.dataForm.contractPrintingTempList[i].yunzhupaasId = buildUUID();
|
||||
|
||||
}
|
||||
}
|
||||
// 设置默认值
|
||||
state.dataForm={
|
||||
contract_temp_code:undefined,
|
||||
contract_temp_name:undefined,
|
||||
remark:undefined,
|
||||
is_framework:0,
|
||||
is_detail_list:1,
|
||||
enable_tableProductList:0,
|
||||
enable_tableMaterialList:0,
|
||||
enable_tableWorktypeList:0,
|
||||
enable_tableAssetList:0,
|
||||
enable_tableTaskList:0,
|
||||
contract_type:'',
|
||||
enable_printing:1,
|
||||
our_company_type:'PartA',
|
||||
second_party_type:'PartB',
|
||||
third_party_type:'PartC',
|
||||
contractPrintingTempList:[],
|
||||
};
|
||||
if (getLeftTreeActiveInfo) state.dataForm = {...state.dataForm, ...(getLeftTreeActiveInfo() || {}) };
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
}
|
||||
}
|
||||
function getForm() {
|
||||
const form = unref(formRef);
|
||||
if (!form) {
|
||||
throw new Error('form is null!');
|
||||
}
|
||||
return form;
|
||||
}
|
||||
function getData(id) {
|
||||
getInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
|
||||
if (state.dataForm.contractPrintingTempList) {
|
||||
for (let i = 0; i < state.dataForm.contractPrintingTempList.length; i++) {
|
||||
state.childIndex = i;
|
||||
state.dataForm.contractPrintingTempList[i].yunzhupaasId = buildUUID();
|
||||
|
||||
}
|
||||
}
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
});
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
const values = await getForm()?.validate();
|
||||
if (!values) return;
|
||||
if(!contractPrintingTempExist()) return;
|
||||
|
||||
|
||||
setFormProps({ confirmLoading: true });
|
||||
const formMethod = state.dataForm.id ? update : create;
|
||||
formMethod(state.dataForm)
|
||||
.then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
setFormProps({ confirmLoading: false });
|
||||
if (state.submitType == 1) {
|
||||
initData();
|
||||
state.isContinue = true;
|
||||
} else {
|
||||
setFormProps({ open: false });
|
||||
emit('reload');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setFormProps({ confirmLoading: false });
|
||||
});
|
||||
} catch (_) {}
|
||||
}
|
||||
function handlePrev() {
|
||||
state.currIndex--;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleNext() {
|
||||
state.currIndex++;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleGetNewInfo() {
|
||||
changeLoading(true);
|
||||
getForm().resetFields();
|
||||
const id = state.allList[state.currIndex].id;
|
||||
getData(id);
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setDrawerProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setDrawerProps({ loading });
|
||||
}
|
||||
async function onClose() {
|
||||
if (state.isContinue) emit('reload');
|
||||
return true;
|
||||
}
|
||||
|
||||
function changeData(model, index) {
|
||||
state.isEdit = false
|
||||
state.childIndex = index
|
||||
for (let key in state.interfaceRes) {
|
||||
if (key != model) {
|
||||
let faceReList = state.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
let relationField = faceReList[i].relationField;
|
||||
if(relationField){
|
||||
let modelAll = relationField.split('-');
|
||||
let faceMode = '';
|
||||
let faceMode2 = modelAll.length == 2?modelAll[0].substring(0, modelAll[0].length-4) +modelAll[1]:""
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
if (faceMode == model || faceMode2 == model ) {
|
||||
let options = 'get' + key + 'Options';
|
||||
eval(options)(true);
|
||||
changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function changeDataFormData(type, data, model,index,defaultValue) {
|
||||
if(!state.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < state.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
state.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
state.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
}
|
||||
function addContractPrintingTempRow(){
|
||||
let item = {
|
||||
printing_temp_id:'',
|
||||
is_enabled:0,
|
||||
yunzhupaasId: buildUUID(),
|
||||
}
|
||||
state.dataForm.contractPrintingTempList.push(item)
|
||||
state.childIndex=state.dataForm.contractPrintingTempList.length-1
|
||||
state.childIndex = -1
|
||||
}
|
||||
|
||||
function removeContractPrintingTempRow(index,showConfirm=false){
|
||||
if(showConfirm){
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '提示',
|
||||
content: '此操作将永久删除该数据, 是否继续?',
|
||||
onOk: () => {
|
||||
state.dataForm.contractPrintingTempList.splice(index, 1);
|
||||
},
|
||||
});
|
||||
}else{
|
||||
state.dataForm.contractPrintingTempList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function copyContractPrintingTempRow(index){
|
||||
let item = cloneDeep(state.dataForm.contractPrintingTempList[index]);
|
||||
let copyData = {};
|
||||
for (let i = 0; i < unref(contractPrintingTempColumns).length; i++) {
|
||||
const cur = unref(contractPrintingTempColumns)[i];
|
||||
if (cur.key != 'index' && cur.key != 'action') {
|
||||
if (cur.children?.length && cur.yunzhupaasKey == 'complexHeader') {
|
||||
for (let j = 0; j < cur.children.length; j++) {
|
||||
copyData[cur.children[j].key] = item[cur.children[j].key];
|
||||
}
|
||||
} else {
|
||||
copyData[cur.key] = item[cur.key];
|
||||
}
|
||||
}
|
||||
}
|
||||
const copyItem = { ...copyData, yunzhupaasId: buildUUID() };
|
||||
state.dataForm.contractPrintingTempList.push(copyItem);
|
||||
state.childIndex=state.dataForm.contractPrintingTempList.length-1
|
||||
state.childIndex = -1
|
||||
}
|
||||
|
||||
function batchRemoveContractPrintingTempRow(showConfirm=false){
|
||||
if (!state.selectedcontractPrintingTempRowKeys.length) return createMessage.error('请选择一条数据');
|
||||
const handleRemove = ()=>{
|
||||
state.dataForm.contractPrintingTempList = state.dataForm.contractPrintingTempList.filter(
|
||||
o => !state.selectedcontractPrintingTempRowKeys.includes(o.yunzhupaasId),
|
||||
);
|
||||
nextTick(() => {
|
||||
state.selectedcontractPrintingTempRowKeys = [];
|
||||
});
|
||||
}
|
||||
if(showConfirm){
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '提示',
|
||||
content: '此操作将永久删除该数据, 是否继续?',
|
||||
onOk: ()=>{
|
||||
handleRemove()
|
||||
},
|
||||
});
|
||||
}else{
|
||||
handleRemove()
|
||||
}
|
||||
}
|
||||
|
||||
function contractPrintingTempExist(){
|
||||
let isOk = true;
|
||||
for(let i=0;i<state.dataForm.contractPrintingTempList.length;i++){
|
||||
const e = state.dataForm.contractPrintingTempList[i];
|
||||
}
|
||||
return isOk;
|
||||
}
|
||||
|
||||
function getcontractPrintingTempprinting_temp_idOptions() {
|
||||
const index = state.childIndex
|
||||
changeDataFormData(2,'contractPrintingTempList','contractPrintingTempprinting_temp_id',index,'')
|
||||
}
|
||||
function getRelationDate(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue: any = null;
|
||||
let timeValue = Number(timeValueData);
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue;
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime();
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).valueOf();
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
function getRelationTime(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType;
|
||||
let timeDataValue: any = null;
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00';
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue;
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00';
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = dayjs().format(format);
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget + 3);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).format(format);
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
</script>
|
||||
34
src/views/cm/contracttemp/helper/api.ts
Normal file
34
src/views/cm/contracttemp/helper/api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/cm/ContractTemp/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/cm/ContractTemp', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/cm/ContractTemp/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/cm/ContractTemp/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/cm/ContractTemp/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/cm/ContractTemp/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/cm/ContractTemp/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/cm/ContractTemp/Actions/Export', data });
|
||||
}
|
||||
214
src/views/cm/contracttemp/helper/columnList.ts
Normal file
214
src/views/cm/contracttemp/helper/columnList.ts
Normal file
@@ -0,0 +1,214 @@
|
||||
const columnList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemb3758f",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"合同模版编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779197093361,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"unique":true,
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12,
|
||||
"labelI18nCode":""
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"contract_temp_code",
|
||||
"__vModel__":"contract_temp_code",
|
||||
"disabled":false,
|
||||
"id":"contract_temp_code",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"合同模版编码",
|
||||
"label":"合同模版编码",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":200,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem7c816a",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"合同模版名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779197096173,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"contract_temp_name",
|
||||
"__vModel__":"contract_temp_name",
|
||||
"disabled":false,
|
||||
"id":"contract_temp_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"合同模版名称",
|
||||
"label":"合同模版名称",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":350,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"textarea",
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"备注",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"autoSize":{
|
||||
"minRows":3,
|
||||
"maxRows":3
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem4ef0df",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779197120754,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"remark",
|
||||
"width":null,
|
||||
"__vModel__":"remark",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"placeholder":"请输入",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default columnList
|
||||
2
src/views/cm/contracttemp/helper/searchList.ts
Normal file
2
src/views/cm/contracttemp/helper/searchList.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
const searchList = []
|
||||
export default searchList
|
||||
915
src/views/cm/contracttemp/helper/superQueryJson.ts
Normal file
915
src/views/cm/contracttemp/helper/superQueryJson.ts
Normal file
@@ -0,0 +1,915 @@
|
||||
const superQueryJson = [
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"合同模版编码",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemb3758f",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"合同模版编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779197093361,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"unique":true,
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12,
|
||||
"labelI18nCode":""
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"contract_temp_code",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"contract_temp_code",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"合同模版名称",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem7c816a",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"合同模版名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779197096173,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"contract_temp_name",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"contract_temp_name",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"autoSize":{
|
||||
"minRows":3,
|
||||
"maxRows":3
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem4ef0df",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779197120754,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"__vModel__":"remark",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"placeholder":"请输入",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItemfdc810",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":0,
|
||||
"noShow":false,
|
||||
"tipLabel":"是:只有合同基本信息和合同主体,无合同清单、金额、付款计划。否:反之",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"框架合同",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779204216891,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"is_framework",
|
||||
"fullName":"框架合同",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"is_framework",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItemda36db",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":1,
|
||||
"noShow":false,
|
||||
"tipLabel":"是:显示合同清单,合同金额根据清单金额汇总生成;否:不显示清单,只显示合同金额与付款计划,合同金额手工录入",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"清单合同",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779197789072,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"is_detail_list",
|
||||
"fullName":"清单合同",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"is_detail_list",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItemcdd9ba",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":0,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"启用产品清单",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779204672306,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"enable_tableProductList",
|
||||
"fullName":"启用产品清单",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"enable_tableProductList",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItem2787d4",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":0,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"启用材料清单",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779204756615,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"enable_tableMaterialList",
|
||||
"fullName":"启用材料清单",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"enable_tableMaterialList",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItem62a424",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":0,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"启用人力清单",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779204777094,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"enable_tableWorktypeList",
|
||||
"fullName":"启用人力清单",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"enable_tableWorktypeList",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItemc956e5",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":0,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"启用资产清单",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779204823252,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"enable_tableAssetList",
|
||||
"fullName":"启用资产清单",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"enable_tableAssetList",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItem1dceff",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":0,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"启用任务清单",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779205615044,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"enable_tableTaskList",
|
||||
"fullName":"启用任务清单",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"enable_tableTaskList",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"合同类型",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779206776300,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItem4917e5",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"合同类型",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[
|
||||
{
|
||||
"fullName":"收入合同",
|
||||
"id":"REV"
|
||||
},
|
||||
{
|
||||
"fullName":"支出合同",
|
||||
"id":"COS"
|
||||
}
|
||||
],
|
||||
"__vModel__":"contract_type",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"contract_type",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItem046684",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":1,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"启用在线打印",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779238994341,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"enable_printing",
|
||||
"fullName":"启用在线打印",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"enable_printing",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"我方签约类型",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"PartA",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779239106349,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItem709985",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"我方签约类型",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[
|
||||
{
|
||||
"fullName":"甲方",
|
||||
"id":"PartA"
|
||||
},
|
||||
{
|
||||
"fullName":"乙方",
|
||||
"id":"PartB"
|
||||
},
|
||||
{
|
||||
"fullName":"丙方",
|
||||
"id":"PartC"
|
||||
}
|
||||
],
|
||||
"__vModel__":"our_company_type",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"our_company_type",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"乙方签约类型",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"PartB",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779239278811,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItem3495e6",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"乙方签约类型",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[
|
||||
{
|
||||
"fullName":"甲方",
|
||||
"id":"PartA"
|
||||
},
|
||||
{
|
||||
"fullName":"乙方",
|
||||
"id":"PartB"
|
||||
},
|
||||
{
|
||||
"fullName":"丙方",
|
||||
"id":"PartC"
|
||||
}
|
||||
],
|
||||
"__vModel__":"second_party_type",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"second_party_type",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"丙方签约类型",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"PartC",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779239279825,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItem242830",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"static",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"丙方签约类型",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[
|
||||
{
|
||||
"fullName":"甲方",
|
||||
"id":"PartA"
|
||||
},
|
||||
{
|
||||
"fullName":"乙方",
|
||||
"id":"PartB"
|
||||
},
|
||||
{
|
||||
"fullName":"丙方",
|
||||
"id":"PartC"
|
||||
}
|
||||
],
|
||||
"__vModel__":"third_party_type",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"third_party_type",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"popupType":"popover",
|
||||
"hasPage":false,
|
||||
"pageSize":20,
|
||||
"columnOptions":[
|
||||
{
|
||||
"label":"打印模版名称",
|
||||
"value":"f_full_name"
|
||||
},
|
||||
{
|
||||
"label":"打印模版描述",
|
||||
"value":"f_description"
|
||||
}
|
||||
],
|
||||
"fullNameI18nCode":[
|
||||
"",
|
||||
""
|
||||
],
|
||||
"templateJson":[],
|
||||
"__config__":{
|
||||
"relationTable":"cm_contract_printing_temp",
|
||||
"yunzhupaasKey":"popupTableSelect",
|
||||
"defaultValue":"",
|
||||
"parentVModel":"tablePrintingTemp",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779240109576,
|
||||
"transferList":[],
|
||||
"tagIcon":"icon-ym icon-ym-generator-popupTableSelect",
|
||||
"isSubTable":true,
|
||||
"columnWidth":350,
|
||||
"tag":"YunzhupaasPopupTableSelect",
|
||||
"formId":"formItemb39d07",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"打印模版ID",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"__vModel__":"printing_temp_id",
|
||||
"disabled":false,
|
||||
"id":"tablePrintingTemp-printing_temp_id",
|
||||
"placeholder":"请选择",
|
||||
"interfaceName":"获取系统打印模版列表",
|
||||
"popupWidth":"800px",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"filterable":true,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"打印模板-打印模版ID",
|
||||
"relationField":"f_full_name",
|
||||
"extraOptions":[],
|
||||
"popupTitle":"选择数据",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"interfaceHasPage":0,
|
||||
"interfaceId":"826713957526931333",
|
||||
"propsValue":"f_id"
|
||||
},
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItemd53b4e",
|
||||
"relationTable":"cm_contract_printing_temp",
|
||||
"yunzhupaasKey":"switch",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":0,
|
||||
"noShow":false,
|
||||
"parentVModel":"tablePrintingTemp",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"是否启用",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"cm_contract_temp",
|
||||
"renderKey":1779240149420,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-switch",
|
||||
"isSubTable":true,
|
||||
"tag":"YunzhupaasSwitch",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"activeValue":1,
|
||||
"inactiveValue":0,
|
||||
"__vModel__":"is_enabled",
|
||||
"fullName":"打印模板-是否启用",
|
||||
"inactiveTxt":"N",
|
||||
"fullNameI18nCode":[
|
||||
"",
|
||||
""
|
||||
],
|
||||
"disabled":false,
|
||||
"activeTxt":"Y",
|
||||
"id":"tablePrintingTemp-is_enabled",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default superQueryJson
|
||||
652
src/views/cm/contracttemp/index.vue
Normal file
652
src/views/cm/contracttemp/index.vue
Normal file
@@ -0,0 +1,652 @@
|
||||
<template>
|
||||
<div class="yunzhupaas-content-wrapper">
|
||||
<div class="yunzhupaas-content-wrapper-center">
|
||||
<div class="yunzhupaas-content-wrapper-search-box" v-if="getSearchList.length">
|
||||
<BasicForm @register="registerSearchForm" :schemas="getSearchList"
|
||||
@advanced-change="redoHeight" @submit="handleSearchSubmit" @reset="handleSearchReset"
|
||||
class="search-form">
|
||||
</BasicForm>
|
||||
</div>
|
||||
<div class="yunzhupaas-content-wrapper-content bg-white">
|
||||
<BasicTable @register="registerTable" v-bind="getTableBindValue" ref="tableRef"
|
||||
@columns-change="handleColumnChange">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add"
|
||||
@click="addHandle()"> {{t('common.add2Text','新增')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
<template #title>
|
||||
<span>{{ t('common.superQuery') }}</span>
|
||||
</template>
|
||||
<filter-outlined @click="openSuperQuery(true, { columnOptions: superQueryJson })" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #toolbarAfter>
|
||||
<ViewList :menuId="route.meta.modelId" :viewList="viewList" @itemClick="handleViewClick" @reload="initViewList" />
|
||||
<ViewSetting :menuId="route.meta.modelId" :viewList="viewList" :currentView="currentView" @reload="initViewList" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-for="(item, index) in childColumnList" v-if="childColumnList.length">
|
||||
<template
|
||||
v-if="column?.id?.includes('-') && item.children && item.children[0] && column.key === item.children[0]?.dataIndex">
|
||||
<ChildTableColumn :data="record[item.prop]" :head="item.children"
|
||||
@toggleExpand="toggleExpand(record, item.prop+`Expand`)" @toDetail="toDetail"
|
||||
:expand="record[item.prop+`Expand`]" :key="index" :showOverflow="true "/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="!(record.top || column.id?.includes('-'))">
|
||||
<template v-if="column.yunzhupaasKey === 'relationForm'">
|
||||
<p class="link-text"
|
||||
@click="toDetail(column.modelId, record[column.dataIndex+`_id`], column.propsValue)">
|
||||
{{ record[column.dataIndex] }}</p>
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'inputNumber'">
|
||||
<yunzhupaas-input-number v-model:value="record[column.prop]" :precision="column.precision" :thousands="column.thousands" disabled detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'calculate'">
|
||||
<yunzhupaas-calculate
|
||||
v-model:value="record[column.prop]"
|
||||
:isStorage="column.isStorage"
|
||||
:precision="column.precision"
|
||||
:thousands="column.thousands"
|
||||
detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'sign'">
|
||||
<yunzhupaas-sign v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'signature'">
|
||||
<yunzhupaas-signature v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'rate'">
|
||||
<yunzhupaas-rate v-model:value="record[column.prop]" :count="column.count" :allowHalf="column.allowHalf" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'slider'">
|
||||
<yunzhupaas-slider v-model:value="record[column.prop]" :min="column.min" :max="column.max" :step="column.step" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadImg'">
|
||||
<yunzhupaas-upload-img v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadFile'">
|
||||
<yunzhupaas-upload-file v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'input'">
|
||||
<yunzhupaas-input
|
||||
v-model:value="record[column.prop]"
|
||||
:useMask="column.useMask"
|
||||
:maskConfig="column.maskConfig"
|
||||
:showOverflow="true"
|
||||
detailed />
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'action' && !record.top">
|
||||
<TableAction :actions="getTableActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
<Form ref="formRef" @reload="reload" />
|
||||
<Detail ref="detailRef" />
|
||||
<ExportModal @register="registerExportModal" @download="handleDownload" />
|
||||
<ImportModal @register="registerImportModal" @reload="reload" />
|
||||
<PrintSelect @register="registerPrintSelect" @change="handleShowBrowse" />
|
||||
<PrintBrowse @register="registerPrintBrowse" />
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<SuperQueryModal @register="registerSuperQueryModal" @superQuery="handleSuperQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { getList, del, exportData, batchDelete } from './helper/api';
|
||||
import { getConfigData,getViewList } from '@/api/onlineDev/visualDev';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import { getOrgByOrganizeCondition,getDepartmentSelectAsyncList } from '@/api/permission/organize';
|
||||
import { ref, reactive, onMounted, toRefs, computed, unref, nextTick, toRaw, provide } from 'vue';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useOrganizeStore } from '@/store/modules/organize';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { usePopup } from '@/components/Popup';
|
||||
import { ScrollContainer } from '@/components/Container';
|
||||
import { BasicLeftTree, TreeActionType } from '@/components/Tree';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { BasicTable, useTable, TableAction, ActionItem, TableActionType, SorterResult } from '@/components/Table';
|
||||
import { SuperQueryModal } from '@/components/CommonModal';
|
||||
import Form from './Form.vue';
|
||||
import Detail from './Detail.vue';
|
||||
// 有关联表单详情:开始
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 有关联表单详情:结束
|
||||
import ChildTableColumn from '@/views/common/dynamicModel/list/ChildTableColumn.vue';
|
||||
import { ExportModal } from '@/components/CommonModal';
|
||||
import { downloadByUrl } from '@/utils/file/download';
|
||||
import { ImportModal} from '@/components/CommonModal';
|
||||
// 打印模板多条生成PrintSelect
|
||||
import PrintSelect from '@/components/PrintDesign/printSelect/index.vue';
|
||||
import PrintBrowse from '@/components/PrintDesign/printBrowse/index.vue';
|
||||
import { useRoute,useRouter } from 'vue-router';
|
||||
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||
import { getSearchFormSchemas } from '@/components/FormGenerator/src/helper/transform';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import columnList from './helper/columnList';
|
||||
import searchList from './helper/searchList';
|
||||
import superQueryJson from './helper/superQueryJson';
|
||||
import { dyOptionsList, systemComponentsList } from '@/components/FormGenerator/src/helper/config';
|
||||
import { thousandsFormat, getParamList} from '@/utils/yunzhupaas';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
|
||||
import ViewSetting from '@/views/common/dynamicModel/list/components/ViewSetting.vue';
|
||||
import ViewList from '@/views/common/dynamicModel/list/components/ViewList.vue';
|
||||
|
||||
interface State {
|
||||
config: any;
|
||||
columnList: any[];
|
||||
printListOptions: any[];
|
||||
columnBtnsList: any[];
|
||||
customBtnsList: any[];
|
||||
treeFieldNames: any;
|
||||
leftTreeData: any[];
|
||||
leftTreeLoading: boolean;
|
||||
treeActiveId: string;
|
||||
treeActiveNodePath: any;
|
||||
columns: any[];
|
||||
complexColumns: any[];
|
||||
childColumnList: any[];
|
||||
exportList: any[];
|
||||
cacheList: any[];
|
||||
currFlow: any;
|
||||
isCustomCopy: boolean;
|
||||
candidateType: number;
|
||||
currRow: any;
|
||||
workFlowFormData: any;
|
||||
expandObj: any;
|
||||
columnSettingList: any[];
|
||||
searchSchemas: any[];
|
||||
treeRelationObj: any;
|
||||
treeQueryJson: any;
|
||||
leftTreeActiveInfo: any;
|
||||
keyword: string;
|
||||
viewList: any[];
|
||||
currentView: any;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const { hasBtnP } = usePermission();
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const organizeStore = useOrganizeStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const [registerExportModal, { openModal: openExportModal, closeModal: closeExportModal, setModalProps: setExportModalProps }] = useModal();
|
||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||
const [registerSuperQueryModal, { openModal: openSuperQuery }] = useModal();
|
||||
const formRef = ref<any>(null);
|
||||
const tableRef = ref<Nullable<TableActionType>>(null);
|
||||
const detailRef = ref<any>(null);
|
||||
const relationDetailRef = ref<any>(null);
|
||||
|
||||
const state = reactive<State>({
|
||||
config: {},
|
||||
columnList: [],
|
||||
printListOptions: [],
|
||||
columnBtnsList: [],
|
||||
customBtnsList: [],
|
||||
treeFieldNames: {
|
||||
children: 'children' ,
|
||||
title: 'fullName' ,
|
||||
key: 'id' ,
|
||||
isLeaf: 'isLeaf',
|
||||
},
|
||||
leftTreeData: [],
|
||||
leftTreeLoading: false,
|
||||
treeActiveId: '',
|
||||
treeActiveNodePath: [],
|
||||
columns: [],
|
||||
complexColumns: [], // 复杂表头
|
||||
childColumnList: [],
|
||||
exportList: [],
|
||||
cacheList: [],
|
||||
currFlow: {},
|
||||
isCustomCopy: false,
|
||||
candidateType: 1,
|
||||
currRow: {},
|
||||
workFlowFormData: {},
|
||||
expandObj: {},
|
||||
columnSettingList: [],
|
||||
searchSchemas: [],
|
||||
treeRelationObj: null,
|
||||
treeQueryJson: {},
|
||||
leftTreeActiveInfo: {},
|
||||
keyword: '',
|
||||
viewList: [],
|
||||
currentView: {},
|
||||
});
|
||||
const defaultSearchInfo = {
|
||||
menuId: route.meta.modelId as string,
|
||||
moduleId:'826534292984170373',
|
||||
superQueryJson: '',
|
||||
dataType:0,
|
||||
};
|
||||
const searchInfo = reactive({
|
||||
...cloneDeep(defaultSearchInfo),
|
||||
});
|
||||
const { childColumnList, searchSchemas, viewList, currentView} = toRefs(state);
|
||||
const [registerSearchForm, { updateSchema, resetFields, submit: searchFormSubmit, setFieldsValue}] = useForm({
|
||||
baseColProps: { span: 6 },
|
||||
showActionButtonGroup: true,
|
||||
showAdvancedButton: true,
|
||||
compact: true,
|
||||
});
|
||||
const [registerTable, { reload, setLoading, getFetchParams, getSelectRows, getSelectRowKeys, redoHeight,clearSelectedRowKeys }] = useTable({
|
||||
api: getList,
|
||||
immediate: false,
|
||||
clickToRowSelect: false,
|
||||
tableSetting: { setting: false },
|
||||
afterFetch: (data) => {
|
||||
const list = data.map((o) => ({
|
||||
...o,
|
||||
...state.expandObj,
|
||||
}));
|
||||
state.cacheList = cloneDeep(list);
|
||||
return list;
|
||||
},
|
||||
});
|
||||
const [registerChildTable] = useTable({
|
||||
pagination: false,
|
||||
canResize: false,
|
||||
showTableSetting: false,
|
||||
});
|
||||
|
||||
provide('getLeftTreeActiveInfo', () => state.leftTreeActiveInfo);
|
||||
|
||||
const getHasBatchBtn = computed(() => {
|
||||
let btnsList =[]
|
||||
return !!btnsList.length
|
||||
});
|
||||
|
||||
|
||||
const getColumns = computed(() => {
|
||||
const columns = state.complexColumns;
|
||||
return setListValue(state.currentView?.columnList, columns, 'prop');
|
||||
});
|
||||
const getSearchList = computed(() => {
|
||||
const searchSchemas = cloneDeep(state.searchSchemas).map(o => ({ ...o, show: true }));
|
||||
return setListValue(state.currentView?.searchList, searchSchemas, 'field');
|
||||
});
|
||||
const getTableBindValue = computed(() => {
|
||||
let columns = unref(getColumns);
|
||||
const defaultSortConfig= [];
|
||||
const sortField = defaultSortConfig.map(o => (o.sort === 'desc' ? '-' : '') + o.field);
|
||||
const data: any = {
|
||||
pagination: { pageSize: 20 }, //有分页
|
||||
searchInfo: unref(searchInfo),
|
||||
defSort: { sidx: sortField.join(',') },
|
||||
sortFn: (sortInfo: SorterResult | SorterResult[]) => {
|
||||
if (Array.isArray(sortInfo)) {
|
||||
const sortList = sortInfo.map(o => (o.order === 'descend' ? '-' : '') + o.field);
|
||||
return { sidx: sortList.join(',') };
|
||||
} else {
|
||||
const { field, order } = sortInfo;
|
||||
if (field && order) {
|
||||
// 排序字段
|
||||
return { sidx: (order === 'descend' ? '-' : '') + field };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
ellipsis:true ,
|
||||
columns,
|
||||
bordered: true,
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
title: t('component.table.action'),
|
||||
dataIndex: 'action',
|
||||
},
|
||||
};
|
||||
if (unref(getHasBatchBtn)) {
|
||||
const rowSelection: any = { type: 'checkbox' };
|
||||
data.rowSelection = rowSelection;
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
function init() {
|
||||
state.config = {};
|
||||
searchInfo.menuId = route.meta.modelId as string;
|
||||
state.columnList = columnList;
|
||||
setLoading(true);
|
||||
getSearchSchemas();
|
||||
getColumnList();
|
||||
initViewList();
|
||||
nextTick(() => {
|
||||
unref(getSearchList)?.length ? searchFormSubmit() : reload({ page: 1 });
|
||||
});
|
||||
}
|
||||
function getSearchSchemas() {
|
||||
|
||||
const schemas = getSearchFormSchemas(searchList);
|
||||
state.searchSchemas = schemas;
|
||||
schemas.forEach((cur) => {
|
||||
const config = cur.__config__;
|
||||
if (dyOptionsList.includes(config.yunzhupaasKey)) {
|
||||
if (config.dataType === 'dictionary') {
|
||||
if (!config.dictionaryType) return;
|
||||
getDictionaryDataSelector(config.dictionaryType).then((res) => {
|
||||
updateSchema([{ field: cur.field, componentProps: { options: res.data.list } }]);
|
||||
});
|
||||
}
|
||||
if (config.dataType === 'dynamic') {
|
||||
if (!config.propsUrl) return;
|
||||
const query = { paramList: getParamList(config.templateJson) };
|
||||
getDataInterfaceRes(config.propsUrl, query).then((res) => {
|
||||
const data = Array.isArray(res.data) ? res.data : [];
|
||||
updateSchema([{ field: cur.field, componentProps: { options: data } }]);
|
||||
});
|
||||
}
|
||||
}
|
||||
cur.defaultValue = cur.value;
|
||||
});
|
||||
}
|
||||
function getColumnList() {
|
||||
// 没有开启列表权限
|
||||
let columnList = state.columnList;
|
||||
state.exportList = columnList;
|
||||
let columns = columnList.map((o) => ({
|
||||
...o,
|
||||
title: o.labelI18nCode ? t(o.labelI18nCode, o.label) : o.label,
|
||||
dataIndex: o.prop,
|
||||
align: o.align,
|
||||
fixed: o.fixed == 'none' ? false : o.fixed,
|
||||
sorter: o.sortable ? { multiple: 1 } : o.sortable,
|
||||
width: o.width || 100,
|
||||
}));
|
||||
//添加复杂表头
|
||||
columns = getComplexColumns(columns);
|
||||
state.columns = columns.filter((o) => o.prop.indexOf('-') < 0);
|
||||
//子表表头
|
||||
getChildComplexColumns(columns);
|
||||
}
|
||||
|
||||
|
||||
//复杂表头
|
||||
function getComplexColumns(columns) {
|
||||
//这里生成复杂表头的配置
|
||||
let complexHeaderList: any[] = [];
|
||||
if (!complexHeaderList.length) return columns;
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.label = e.fullName;
|
||||
e.labelI18nCode = e.fullNameI18nCode;
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.dataIndex = e.id;
|
||||
e.prop = e.id;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < columns.length; j++) {
|
||||
const o = columns[j];
|
||||
if (o.prop == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].prop);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
const e = columns[i];
|
||||
if (!childColumns.includes(e.prop)) {
|
||||
list.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.prop)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.prop));
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//子表表头
|
||||
function getChildComplexColumns(columnList) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i];
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e);
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0];
|
||||
let vModel = e.prop.split('-')[1];
|
||||
let label = e.label.split('-')[0];
|
||||
let childLabel = e.label.replace(label + '-', '');
|
||||
if (e.fullNameI18nCode && Array.isArray(e.fullNameI18nCode) && e.fullNameI18nCode[0]) label = t(e.fullNameI18nCode[0], label);
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
yunzhupaasKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
title: label,
|
||||
dataIndex: prop,
|
||||
children: [],
|
||||
};
|
||||
e.dataIndex = vModel;
|
||||
e.title = e.labelI18nCode ? t(e.labelI18nCode, childLabel) : childLabel;
|
||||
if (!state.expandObj.hasOwnProperty(prop+`Expand`)) state.expandObj[prop+`Expand`] = false;
|
||||
if (!list.some((o) => o.prop === prop)) list.push(newItem);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 行内分组展示
|
||||
getMergeList(list);
|
||||
|
||||
state.complexColumns = list;
|
||||
state.childColumnList = list.filter((o) => o.yunzhupaasKey === 'table');
|
||||
|
||||
// 子表分组展示宽度取100
|
||||
for (let i = 0; i < state.childColumnList.length; i++) {
|
||||
const e = state.childColumnList[i];
|
||||
if (e.children?.length) e.children = e.children.map(o => ({ ...o, width: 100 }));
|
||||
}
|
||||
}
|
||||
function getMergeList(list) {
|
||||
list.forEach((item) => {
|
||||
if (item.yunzhupaasKey === 'table' && item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
child.customCell = () => ({
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
class: 'child-table-box',
|
||||
});
|
||||
} else {
|
||||
child.customCell = () => ({
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleExpand(row, field) {
|
||||
row[field] = !row[field];
|
||||
}
|
||||
// 关联表单查看详情
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function handleColumnChange(data) {
|
||||
state.columnSettingList = data;
|
||||
}
|
||||
function getTableActions(record): ActionItem[] {
|
||||
return [
|
||||
{
|
||||
label: t('common.editText','编辑') ,
|
||||
onClick: updateHandle.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: t('common.delText','删除') ,
|
||||
color: 'error',
|
||||
modelConfirm: {
|
||||
onOk: handleDelete.bind(null, record.id),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('common.detailText','详情') ,
|
||||
onClick: goDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
// 编辑
|
||||
function updateHandle(record) {
|
||||
// 不带工作流
|
||||
const data = {
|
||||
id: record.id,
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 删除
|
||||
function handleDelete(id) {
|
||||
const query={ids:[id] }
|
||||
batchDelete(query).then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
});
|
||||
}
|
||||
// 查看详情
|
||||
function goDetail(record) {
|
||||
// 不带流程
|
||||
const data = {
|
||||
id: record.id,
|
||||
};
|
||||
detailRef.value?.init(data);
|
||||
}
|
||||
// 新增
|
||||
function addHandle() {
|
||||
// 不带流程新增
|
||||
const data = {
|
||||
id: '',
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 高级查询
|
||||
function handleSuperQuery(superQueryJson) {
|
||||
searchInfo.superQueryJson = superQueryJson;
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function handleSearchReset() {
|
||||
clearSelectedRowKeys();
|
||||
if (!state.resetFromTree) updateSearchFormValue();
|
||||
if (state.resetFromTree) state.resetFromTree = false;
|
||||
}
|
||||
|
||||
function handleSearchSubmit(data) {
|
||||
clearSelectedRowKeys();
|
||||
let obj = {
|
||||
...defaultSearchInfo,
|
||||
superQueryJson: searchInfo.superQueryJson,
|
||||
...data,
|
||||
};
|
||||
Object.keys(searchInfo).map(key => {
|
||||
delete searchInfo[key];
|
||||
});
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
searchInfo[key.replaceAll('-', '_')] = value;
|
||||
}
|
||||
console.log(searchInfo);
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function updateSearchFormValue() {
|
||||
if (!state.treeActiveId) return searchFormSubmit();
|
||||
let queryJson: any = {};
|
||||
let leftTreeActiveInfo: any = {};
|
||||
const isMultiple = !state.treeRelationObj ? false : state.treeRelationObj.searchMultiple;
|
||||
//多级左侧树,需要拼父级->转为查询参数
|
||||
if (state.treeRelationObj && state.treeRelationObj.yunzhupaasKey && ['organizeSelect', 'cascader', 'areaSelect'].includes(state.treeRelationObj.yunzhupaasKey)) {
|
||||
let currValue = [];
|
||||
currValue = state.treeActiveNodePath.map(o => o[state.treeFieldNames.key]);
|
||||
queryJson = { '': isMultiple ? [currValue] : currValue };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [currValue] : currValue };
|
||||
} else {
|
||||
queryJson = { '': isMultiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
}
|
||||
state.leftTreeActiveInfo = leftTreeActiveInfo;
|
||||
if(unref(getSearchList)?.length){
|
||||
// 有搜索列表
|
||||
setFieldsValue(queryJson);
|
||||
searchFormSubmit();
|
||||
}else{
|
||||
// 无搜索列表
|
||||
handleSearchSubmit(queryJson);
|
||||
}
|
||||
}
|
||||
function initViewList(currentId = '') {
|
||||
const query = {
|
||||
menuId: route.meta.modelId,
|
||||
};
|
||||
getViewList(query).then(res => {
|
||||
const columns : any[]= state.complexColumns;
|
||||
const searchList: any[] = state.searchSchemas.map(o => ({ label: o.label, id: o.field, show: o.show, labelI18nCode: o.labelI18nCode }));
|
||||
const columnList: any[] = columns.map(o => ({ label: o.label, id: o.prop, show: true, fixed: o.fixed || 'none', labelI18nCode: o.labelI18nCode }));
|
||||
state.viewList = (res.data || []).map(o => {
|
||||
if (o.type == 0) return { ...o, searchList, columnList };
|
||||
return { ...o, searchList: o.searchList ? JSON.parse(o.searchList) : [], columnList: o.columnList ? JSON.parse(o.columnList) : [] };
|
||||
});
|
||||
if (currentId) {
|
||||
state.currentView = state.viewList.filter(o => o.id === currentId)[0] || state.viewList[0];
|
||||
} else {
|
||||
state.currentView = state.viewList.filter(o => o.status === 1)[0] || state.viewList[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleViewClick(item) {
|
||||
state.currentView = item;
|
||||
}
|
||||
|
||||
function setListValue(data: any[] = [], defaultData: any[] = [], key) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
for (let j = 0; j < defaultData.length; j++) {
|
||||
if (data[i].show && data[i].id == defaultData[j][key]) list.push(defaultData[j]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
@@ -262,7 +262,7 @@
|
||||
:style="{ width: '100%' }"
|
||||
:showSearch="false"
|
||||
:field="'supplier_id'"
|
||||
modelId="/api/bcm/Suppinfo/getList"
|
||||
modelId="/api/bcm/Supplier/getList"
|
||||
:columnOptions="optionsObj.supplier_idcolumnOptions"
|
||||
relationField="company_name"
|
||||
popupWidth="1000px"
|
||||
@@ -299,7 +299,7 @@
|
||||
import { create, update, getInfo } from './helper/api';
|
||||
import { reactive, toRefs, nextTick, ref, unref, computed, toRaw, inject } from 'vue';
|
||||
import { BasicPopup, usePopup } from '@/components/Popup';
|
||||
import { YunzhupaasRelationFormByUrl } from '@/components/yunzhupaas';
|
||||
import { YunzhupaasRelationFormByUrl } from '@/components/Yunzhupaas';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
34
src/views/mdm/corporation/helper/api.ts
Normal file
34
src/views/mdm/corporation/helper/api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Corporation/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/Corporation', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/Corporation/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Corporation/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Corporation/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/Corporation/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/Corporation/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Corporation/Actions/Export', data });
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Custinfo/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/Custinfo', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/Custinfo/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Custinfo/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Custinfo/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/Custinfo/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/Custinfo/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Custinfo/Actions/Export', data });
|
||||
}
|
||||
34
src/views/mdm/customer/helper/api.ts
Normal file
34
src/views/mdm/customer/helper/api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Customer/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/Customer', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/Customer/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Customer/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Customer/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/Customer/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/Customer/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Customer/Actions/Export', data });
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-download" v-auth="'btn_download'"
|
||||
@click="openExportModal(true, { columnList: state.exportList, selectIds: getSelectRowKeys(), showExportSelected: true })"> {{t('common.exportText','导出')}}</a-button>
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-upload" v-auth="'btn_upload'"
|
||||
@click="openImportModal(true, { url: 'bcm/Custinfo', menuId: searchInfo.menuId })"> {{t('common.importText','导入')}}</a-button>
|
||||
@click="openImportModal(true, { url: 'bcm/Customer', menuId: searchInfo.menuId })"> {{t('common.importText','导入')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
@@ -1,34 +0,0 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Lpc/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/Lpc', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/Lpc/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Lpc/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Lpc/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/Lpc/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/Lpc/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Lpc/Actions/Export', data });
|
||||
}
|
||||
192
src/views/mdm/projects/Detail.vue
Normal file
192
src/views/mdm/projects/Detail.vue
Normal file
@@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="600px"
|
||||
:minHeight="100" :showOkBtn="false">
|
||||
<template #insertFooter>
|
||||
</template>
|
||||
<!-- 表单 -->
|
||||
<a-row class="dynamic-form ">
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" ref="formRef">
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="project_code" >
|
||||
<template #label>项目编码
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.project_code"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.project_code" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="project_name" >
|
||||
<template #label>项目名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.project_name"
|
||||
placeholder="请输入" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.project_name" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="project_type_id" >
|
||||
<template #label>项目类型
|
||||
</template> <p>{{dataForm.project_type_id}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="org_id" >
|
||||
<template #label>归属组织
|
||||
</template> <p>{{dataForm.org_id}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="pid" >
|
||||
<template #label>上级项目
|
||||
</template> <p>{{dataForm.pid}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="seq_num" >
|
||||
<template #label>顺序号
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.seq_num"
|
||||
placeholder="请输入" disabled
|
||||
detailed :style='{"width":"100%"}' :step="1" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remark" >
|
||||
<template #label>备注
|
||||
</template> <p>{{dataForm.remark}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicModal>
|
||||
<!-- 有关联表单详情:开始 -->
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<!-- 有关联表单详情:结束 -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getDetailInfo } from './helper/api';
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev';
|
||||
import { reactive, toRefs, nextTick, ref, computed, unref ,toRaw} from 'vue';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
// 有关联表单详情
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { getDataChange } from '@/api/onlineDev/visualDev';
|
||||
import { getDataInterfaceDataInfoByIds } from '@/api/systemData/dataInterface';
|
||||
import ExtraRelationInfo from '@/components/yunzhupaas/RelationForm/src/ExtraRelationInfo.vue';
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
title: string;
|
||||
maskConfig: any;
|
||||
interfaceRes: any;
|
||||
locationScope: any;
|
||||
extraOptions: any;
|
||||
extraData: any;
|
||||
|
||||
}
|
||||
|
||||
defineOptions({ name: 'Detail' });
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const [registerModal, { openModal, setModalProps, closeModal }] = useModal();
|
||||
|
||||
const { t } = useI18n();
|
||||
const relationDetailRef = ref<any>(null);
|
||||
const state = reactive<State>({
|
||||
dataForm:{},
|
||||
title: t('common.detailText','详情'),
|
||||
maskConfig:{
|
||||
project_code: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
project_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
}
|
||||
,
|
||||
interfaceRes: {"project_type_id":[],"org_id":[],"project_code":[],"pid":[],"remark":[],"project_name":[],"seq_num":[]},
|
||||
locationScope:{
|
||||
}
|
||||
,
|
||||
extraOptions: {
|
||||
}
|
||||
,
|
||||
extraData: {
|
||||
}
|
||||
,
|
||||
});
|
||||
const { title, dataForm, maskConfig } = toRefs(state);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.dataForm.id = data.id;
|
||||
openModal();
|
||||
nextTick(() => {
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
closeModal();
|
||||
}
|
||||
}
|
||||
function getData(id) {
|
||||
getDetailInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
nextTick(() => {
|
||||
changeLoading(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setModalProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setFormProps({ loading });
|
||||
}
|
||||
|
||||
function getParamList(key) {
|
||||
let templateJson: any[] = state.interfaceRes[key];
|
||||
if (!templateJson || !templateJson.length || !state.dataForm) return templateJson;
|
||||
for (let i = 0; i < templateJson.length; i++) {
|
||||
if (templateJson[i].relationField && templateJson[i].sourceType == 1) {
|
||||
templateJson[i].defaultValue = state.dataForm[templateJson[i].relationField + '_id'] || '';
|
||||
}
|
||||
}
|
||||
return templateJson;
|
||||
}
|
||||
</script>
|
||||
572
src/views/mdm/projects/Form.vue
Normal file
572
src/views/mdm/projects/Form.vue
Normal file
@@ -0,0 +1,572 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
@register="registerModal"
|
||||
width="600px"
|
||||
:minHeight="100"
|
||||
:cancelText="t('common.cancelText', '取消')"
|
||||
:okText="t('common.okText', '确定')"
|
||||
@ok="handleSubmit"
|
||||
:closeFunc="onClose">
|
||||
<template #title>
|
||||
<a-space :size="10">
|
||||
<div class="text-16px font-medium">{{ title }}</div>
|
||||
</a-space>
|
||||
</template>
|
||||
<a-row class="dynamic-form">
|
||||
<a-form
|
||||
:colon="false"
|
||||
size="middle"
|
||||
layout="horizontal"
|
||||
labelAlign="right"
|
||||
:labelCol="{ style: { width: '100px' } }"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="formRef">
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="project_code">
|
||||
<template #label>项目编码 </template>
|
||||
<YunzhupaasInput
|
||||
v-model:value="dataForm.project_code"
|
||||
@change="changeData('project_code', -1)"
|
||||
placeholder="请输入"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:maskConfig="maskConfig.project_code"
|
||||
:showCount="false">
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="project_name">
|
||||
<template #label>项目名称 </template>
|
||||
<YunzhupaasInput
|
||||
v-model:value="dataForm.project_name"
|
||||
@change="changeData('project_name', -1)"
|
||||
placeholder="请输入"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:maskConfig="maskConfig.project_name"
|
||||
:showCount="false">
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="project_type_id">
|
||||
<template #label>项目类型 </template>
|
||||
<YunzhupaasTreeSelect
|
||||
v-model:value="dataForm.project_type_id"
|
||||
@change="changeData('project_type_id', -1)"
|
||||
placeholder="请选择"
|
||||
:templateJson="state.interfaceRes.project_type_id"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:showSearch="false"
|
||||
:options="optionsObj.project_type_idOptions"
|
||||
:fieldNames="optionsObj.project_type_idProps">
|
||||
</YunzhupaasTreeSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="org_id">
|
||||
<template #label>归属组织 </template>
|
||||
<YunzhupaasOrganizeSelect
|
||||
v-model:value="dataForm.org_id"
|
||||
@change="changeData('org_id', -1)"
|
||||
placeholder="请选择"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:showSearch="false"
|
||||
selectType="all">
|
||||
</YunzhupaasOrganizeSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="pid">
|
||||
<template #label>上级项目 </template>
|
||||
<YunzhupaasTreeSelect
|
||||
v-model:value="dataForm.pid"
|
||||
@change="changeData('pid', -1)"
|
||||
placeholder="请选择"
|
||||
:templateJson="state.interfaceRes.pid"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:showSearch="false"
|
||||
:options="optionsObj.pidOptions"
|
||||
:fieldNames="optionsObj.pidProps">
|
||||
</YunzhupaasTreeSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="seq_num">
|
||||
<template #label>顺序号 </template>
|
||||
<YunzhupaasInputNumber
|
||||
v-model:value="dataForm.seq_num"
|
||||
@change="changeData('seq_num', -1)"
|
||||
placeholder="请输入"
|
||||
:style="{ width: '100%' }"
|
||||
:step="1"
|
||||
:controls="false">
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item">
|
||||
<a-form-item name="remark">
|
||||
<template #label>备注 </template>
|
||||
<YunzhupaasTextarea
|
||||
v-model:value="dataForm.remark"
|
||||
@change="changeData('remark', -1)"
|
||||
placeholder="请输入"
|
||||
:allowClear="true"
|
||||
:style="{ width: '100%' }"
|
||||
:autoSize="{ minRows: 4, maxRows: 4 }"
|
||||
:showCount="false">
|
||||
</YunzhupaasTextarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { create, update, getInfo ,getProjectTreeList} from './helper/api';
|
||||
import { getTreeList} from '@/views/bsc/projecttype/helper/api';
|
||||
import { reactive, toRefs, nextTick, ref, unref, computed, toRaw, inject } from 'vue';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { yunzhupaasRelationForm } from '@/components/yunzhupaas';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import type { FormInstance } from 'ant-design-vue';
|
||||
import { thousandsFormat, getDateTimeUnit, getTimeUnit } from '@/utils/yunzhupaas';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import dayjs from 'dayjs';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
tableRows: any;
|
||||
dataRule: any;
|
||||
optionsObj: any;
|
||||
childIndex: any;
|
||||
isEdit: any;
|
||||
interfaceRes: any;
|
||||
//可选范围默认值
|
||||
ableAll: any;
|
||||
//掩码配置
|
||||
maskConfig: any;
|
||||
//定位属性
|
||||
locationScope: any;
|
||||
extraOptions: any;
|
||||
title: string;
|
||||
continueText: string;
|
||||
allList: any[];
|
||||
currIndex: number;
|
||||
isContinue: boolean;
|
||||
submitType: number;
|
||||
showContinueBtn: boolean;
|
||||
}
|
||||
|
||||
const emit = defineEmits(['reload']);
|
||||
const getLeftTreeActiveInfo: (() => any) | null = inject('getLeftTreeActiveInfo', null);
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const [registerModal, { openModal, setModalProps }] = useModal();
|
||||
const formRef = ref<FormInstance>();
|
||||
const state = reactive<State>({
|
||||
dataForm: {
|
||||
project_code: undefined,
|
||||
project_name: undefined,
|
||||
project_type_id: '',
|
||||
org_id: userInfo.organizeIdList ? userInfo.organizeIdList : '',
|
||||
pid: '',
|
||||
seq_num: undefined,
|
||||
remark: undefined,
|
||||
},
|
||||
|
||||
tableRows: {},
|
||||
|
||||
dataRule: {
|
||||
project_code: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
project_name: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
org_id: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.arrayRequiredPrefix ','请至少选择一个'),
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
optionsObj: {
|
||||
project_type_idOptions: [],
|
||||
project_type_idProps: { label: 'projectTypeName', value: 'projectTypeId', children: 'children' },
|
||||
pidOptions: [],
|
||||
pidProps: { label: 'projectName', value: 'projectId', children: 'children' },
|
||||
},
|
||||
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: { project_type_id: [], org_id: [], project_code: [], pid: [], remark: [], project_name: [], seq_num: [] },
|
||||
//可选范围默认值
|
||||
ableAll: {},
|
||||
|
||||
//掩码配置
|
||||
maskConfig: {
|
||||
project_code: {
|
||||
prefixType: 1,
|
||||
useUnrealMask: false,
|
||||
maskType: 1,
|
||||
unrealMaskLength: 1,
|
||||
prefixLimit: 0,
|
||||
suffixLimit: 0,
|
||||
filler: '*',
|
||||
prefixSpecifyChar: '',
|
||||
suffixType: 1,
|
||||
ignoreChar: '',
|
||||
suffixSpecifyChar: '',
|
||||
},
|
||||
project_name: {
|
||||
prefixType: 1,
|
||||
useUnrealMask: false,
|
||||
maskType: 1,
|
||||
unrealMaskLength: 1,
|
||||
prefixLimit: 0,
|
||||
suffixLimit: 0,
|
||||
filler: '*',
|
||||
prefixSpecifyChar: '',
|
||||
suffixType: 1,
|
||||
ignoreChar: '',
|
||||
suffixSpecifyChar: '',
|
||||
},
|
||||
},
|
||||
|
||||
//定位属性
|
||||
locationScope: {},
|
||||
|
||||
extraOptions: {},
|
||||
|
||||
title: '',
|
||||
continueText: '',
|
||||
allList: [],
|
||||
currIndex: 0,
|
||||
isContinue: false,
|
||||
submitType: 0,
|
||||
showContinueBtn: true,
|
||||
});
|
||||
const { title, continueText, showContinueBtn, dataRule, dataForm, optionsObj, ableAll, maskConfig, submitType } = toRefs(state);
|
||||
|
||||
const getPrevDisabled = computed(() => state.currIndex === 0);
|
||||
const getNextDisabled = computed(() => state.currIndex === state.allList.length - 1);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.submitType = 0;
|
||||
state.isContinue = false;
|
||||
state.title = !data.id ? t('common.add2Text', '新增') : t('common.editText', '编辑');
|
||||
state.continueText = !data.id ? t('common.continueAndAddText', '确定并新增') : t('common.continueText', '确定并继续');
|
||||
setFormProps({ continueLoading: false });
|
||||
state.dataForm.id = data.id;
|
||||
openModal();
|
||||
state.allList = data.allList;
|
||||
state.currIndex = state.allList.length && data.id ? state.allList.findIndex(item => item.id === data.id) : 0;
|
||||
nextTick(() => {
|
||||
getForm().resetFields();
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
//初始化options
|
||||
getproject_type_idOptions();
|
||||
getpidOptions();
|
||||
|
||||
// 设置默认值
|
||||
state.dataForm = {
|
||||
project_code: undefined,
|
||||
project_name: undefined,
|
||||
project_type_id: '',
|
||||
org_id: userInfo.organizeIdList ? userInfo.organizeIdList : '',
|
||||
pid: '',
|
||||
seq_num: undefined,
|
||||
remark: undefined,
|
||||
};
|
||||
if (getLeftTreeActiveInfo) state.dataForm = { ...state.dataForm, ...(getLeftTreeActiveInfo() || {}) };
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
}
|
||||
}
|
||||
function getForm() {
|
||||
const form = unref(formRef);
|
||||
if (!form) {
|
||||
throw new Error('form is null!');
|
||||
}
|
||||
return form;
|
||||
}
|
||||
function getData(id) {
|
||||
getInfo(id).then(res => {
|
||||
state.dataForm = res.data || {};
|
||||
getproject_type_idOptions();
|
||||
getpidOptions();
|
||||
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
});
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
const values = await getForm()?.validate();
|
||||
if (!values) return;
|
||||
|
||||
setFormProps({ confirmLoading: true });
|
||||
const formMethod = state.dataForm.id ? update : create;
|
||||
console.log(state.dataForm);
|
||||
|
||||
formMethod(state.dataForm)
|
||||
.then(res => {
|
||||
createMessage.success(res.msg);
|
||||
setFormProps({ confirmLoading: false });
|
||||
if (state.submitType == 1) {
|
||||
initData();
|
||||
state.isContinue = true;
|
||||
} else {
|
||||
setFormProps({ open: false });
|
||||
emit('reload');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setFormProps({ confirmLoading: false });
|
||||
});
|
||||
} catch (_) {}
|
||||
}
|
||||
function handlePrev() {
|
||||
state.currIndex--;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleNext() {
|
||||
state.currIndex++;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleGetNewInfo() {
|
||||
changeLoading(true);
|
||||
getForm().resetFields();
|
||||
const id = state.allList[state.currIndex].id;
|
||||
getData(id);
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setModalProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setModalProps({ loading });
|
||||
}
|
||||
async function onClose() {
|
||||
if (state.isContinue) emit('reload');
|
||||
return true;
|
||||
}
|
||||
|
||||
function changeData(model, index) {
|
||||
state.isEdit = false;
|
||||
state.childIndex = index;
|
||||
for (let key in state.interfaceRes) {
|
||||
if (key != model) {
|
||||
let faceReList = state.interfaceRes[key];
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
let relationField = faceReList[i].relationField;
|
||||
if (relationField) {
|
||||
let modelAll = relationField.split('-');
|
||||
let faceMode = '';
|
||||
let faceMode2 = modelAll.length == 2 ? modelAll[0].substring(0, modelAll[0].length - 4) + modelAll[1] : '';
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
if (faceMode == model || faceMode2 == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
eval(options)(true);
|
||||
changeData(key, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!state.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < state.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
state.dataForm[data][i][model] = defaultValue;
|
||||
} else if (index == i) {
|
||||
state.dataForm[data][i][model] = defaultValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.dataForm[data] = defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
//数据选项--远端数据初始化方法
|
||||
function getproject_type_idOptions(isClear = false) {
|
||||
|
||||
|
||||
const index = state.childIndex;
|
||||
let templateJsonList = JSON.parse(JSON.stringify(state.interfaceRes.project_type_id));
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField && json.sourceType == 1) {
|
||||
let relationFieldAll = json.relationField.split('-');
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
if (relationFieldAll[0].endsWith('List')) {
|
||||
val =
|
||||
state.dataForm[relationFieldAll[0]] && state.dataForm[relationFieldAll[0]].length
|
||||
? state.dataForm[relationFieldAll[0]][index][relationFieldAll[1]]
|
||||
: '';
|
||||
} else {
|
||||
val =
|
||||
state.dataForm[relationFieldAll[0] + 'List'] && state.dataForm[relationFieldAll[0] + 'List'].length
|
||||
? state.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]]
|
||||
: '';
|
||||
}
|
||||
} else {
|
||||
val = state.dataForm[relationFieldAll];
|
||||
}
|
||||
json.defaultValue = val ? val : '';
|
||||
}
|
||||
}
|
||||
// let template = {
|
||||
// paramList: templateJsonList,
|
||||
// };
|
||||
getTreeList().then(res => {
|
||||
state.optionsObj.project_type_idOptions = res.data || [];
|
||||
if (index == -1) return;
|
||||
if (isClear) {
|
||||
changeDataFormData(1, 'List', 'project_type_id', index, '');
|
||||
}
|
||||
});
|
||||
// getDataInterfaceRes('824687938385216645', template).then(res => {
|
||||
// let data = res.data;
|
||||
// state.optionsObj.project_type_idOptions = data;
|
||||
// if (index == -1) return;
|
||||
// if (isClear) {
|
||||
// changeDataFormData(1, 'List', 'project_type_id', index, '');
|
||||
// }
|
||||
// });
|
||||
}
|
||||
//数据选项--远端数据初始化方法
|
||||
function getpidOptions(isClear = false) {
|
||||
|
||||
const index = state.childIndex;
|
||||
let templateJsonList = JSON.parse(JSON.stringify(state.interfaceRes.pid));
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField && json.sourceType == 1) {
|
||||
let relationFieldAll = json.relationField.split('-');
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
if (relationFieldAll[0].endsWith('List')) {
|
||||
val =
|
||||
state.dataForm[relationFieldAll[0]] && state.dataForm[relationFieldAll[0]].length
|
||||
? state.dataForm[relationFieldAll[0]][index][relationFieldAll[1]]
|
||||
: '';
|
||||
} else {
|
||||
val =
|
||||
state.dataForm[relationFieldAll[0] + 'List'] && state.dataForm[relationFieldAll[0] + 'List'].length
|
||||
? state.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]]
|
||||
: '';
|
||||
}
|
||||
} else {
|
||||
val = state.dataForm[relationFieldAll];
|
||||
}
|
||||
json.defaultValue = val ? val : '';
|
||||
}
|
||||
}
|
||||
// let template = {
|
||||
// paramList: templateJsonList,
|
||||
// };
|
||||
getProjectTreeList().then(res => {
|
||||
state.optionsObj.pidOptions = res.data || [];
|
||||
if (index == -1) return;
|
||||
if (isClear) {
|
||||
changeDataFormData(1, 'List', 'pid', index, '');
|
||||
}
|
||||
});
|
||||
// getDataInterfaceRes('826399583931205381', template).then(res => {
|
||||
// let data = res.data;
|
||||
// state.optionsObj.pidOptions = data;
|
||||
// if (index == -1) return;
|
||||
// if (isClear) {
|
||||
// changeDataFormData(1, 'List', 'pid', index, '');
|
||||
// }
|
||||
// });
|
||||
}
|
||||
function getRelationDate(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue: any = null;
|
||||
let timeValue = Number(timeValueData);
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue;
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime();
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).valueOf();
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
function getRelationTime(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType;
|
||||
let timeDataValue: any = null;
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00';
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue;
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00';
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = dayjs().format(format);
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget + 3);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).format(format);
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
</script>
|
||||
38
src/views/mdm/projects/helper/api.ts
Normal file
38
src/views/mdm/projects/helper/api.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Projects/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/Projects', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/Projects/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Projects/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Projects/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/Projects/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/Projects/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Projects/Actions/Export', data });
|
||||
}
|
||||
// 树状列表查询
|
||||
export function getProjectTreeList() {
|
||||
return defHttp.get({ url: '/api/bcm/Projects/getTreeList' });
|
||||
}
|
||||
461
src/views/mdm/projects/helper/columnList.ts
Normal file
461
src/views/mdm/projects/helper/columnList.ts
Normal file
@@ -0,0 +1,461 @@
|
||||
const columnList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemdcc7a4",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164507492,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"project_code",
|
||||
"__vModel__":"project_code",
|
||||
"disabled":false,
|
||||
"id":"project_code",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"项目编码",
|
||||
"label":"项目编码",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem8ef579",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164513809,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"project_name",
|
||||
"__vModel__":"project_name",
|
||||
"disabled":false,
|
||||
"id":"project_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"项目名称",
|
||||
"label":"项目名称",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"multiple":false,
|
||||
"fullName":"项目类型",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"项目类型",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"props":{
|
||||
"children":"children",
|
||||
"label":"projectTypeName",
|
||||
"value":"projectTypeId"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"824687938385216645",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779166086652,
|
||||
"tagIcon":"icon-ym icon-ym-generator-tree",
|
||||
"tag":"YunzhupaasTreeSelect",
|
||||
"formId":"formItemfc12f6",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dynamic",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"项目类型",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"获取标准项目分类树结构",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"project_type_id",
|
||||
"width":null,
|
||||
"options":[],
|
||||
"__vModel__":"project_type_id",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"project_type_id",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"organizeSelect",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"ableIds":[],
|
||||
"multiple":false,
|
||||
"fullName":"归属组织",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"归属组织",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"__config__":{
|
||||
"formId":"formItem9309db",
|
||||
"yunzhupaasKey":"organizeSelect",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":[],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"归属组织",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164572941,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-company",
|
||||
"defaultCurrent":true,
|
||||
"tag":"YunzhupaasOrganizeSelect",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"org_id",
|
||||
"width":null,
|
||||
"__vModel__":"org_id",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"selectType":"all",
|
||||
"disabled":false,
|
||||
"id":"org_id",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"multiple":false,
|
||||
"fullName":"上级项目",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"上级项目",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"props":{
|
||||
"children":"children",
|
||||
"label":"projectName",
|
||||
"value":"projectId"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"826399583931205381",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164602724,
|
||||
"tagIcon":"icon-ym icon-ym-generator-tree",
|
||||
"tag":"YunzhupaasTreeSelect",
|
||||
"formId":"formItemd3f1a4",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dynamic",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"上级项目",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"获取标准项目树结构",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"pid",
|
||||
"width":null,
|
||||
"options":[],
|
||||
"__vModel__":"pid",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"pid",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"controls":false,
|
||||
"resizable":true,
|
||||
"fullName":"顺序号",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"顺序号",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItemf01693",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"顺序号",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164640574,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"seq_num",
|
||||
"width":null,
|
||||
"__vModel__":"seq_num",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"seq_num",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"textarea",
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"备注",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"autoSize":{
|
||||
"minRows":4,
|
||||
"maxRows":4
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem41e3bd",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164655791,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"remark",
|
||||
"width":null,
|
||||
"__vModel__":"remark",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"placeholder":"请输入",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default columnList
|
||||
132
src/views/mdm/projects/helper/searchList.ts
Normal file
132
src/views/mdm/projects/helper/searchList.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
const searchList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem8ef579",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164513809,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"project_name",
|
||||
"__vModel__":"project_name",
|
||||
"searchMultiple":false,
|
||||
"disabled":false,
|
||||
"id":"project_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"searchType":2,
|
||||
"maxlength":null,
|
||||
"fullName":"项目名称",
|
||||
"label":"项目名称",
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"isKeyword":false,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"organizeSelect",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"searchType":1,
|
||||
"ableIds":[],
|
||||
"multiple":false,
|
||||
"fullName":"归属组织",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"归属组织",
|
||||
"__config__":{
|
||||
"formId":"formItem9309db",
|
||||
"yunzhupaasKey":"organizeSelect",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":[],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"归属组织",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164572941,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-company",
|
||||
"defaultCurrent":true,
|
||||
"tag":"YunzhupaasOrganizeSelect",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"prop":"org_id",
|
||||
"__vModel__":"org_id",
|
||||
"searchMultiple":true,
|
||||
"isKeyword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"selectType":"all",
|
||||
"disabled":false,
|
||||
"id":"org_id",
|
||||
"placeholder":"请选择",
|
||||
"value":[],
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default searchList
|
||||
398
src/views/mdm/projects/helper/superQueryJson.ts
Normal file
398
src/views/mdm/projects/helper/superQueryJson.ts
Normal file
@@ -0,0 +1,398 @@
|
||||
const superQueryJson = [
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"项目编码",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemdcc7a4",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目编码",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164507492,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"project_code",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"project_code",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"项目名称",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem8ef579",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"项目名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164513809,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"project_name",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"project_name",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"项目类型",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"children":"children",
|
||||
"label":"projectTypeName",
|
||||
"value":"projectTypeId"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"824687938385216645",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779166086652,
|
||||
"tagIcon":"icon-ym icon-ym-generator-tree",
|
||||
"tag":"YunzhupaasTreeSelect",
|
||||
"formId":"formItemfc12f6",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dynamic",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"项目类型",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"获取标准项目分类树结构",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[],
|
||||
"__vModel__":"project_type_id",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"project_type_id",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"ableIds":[],
|
||||
"multiple":false,
|
||||
"fullName":"归属组织",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"__config__":{
|
||||
"formId":"formItem9309db",
|
||||
"yunzhupaasKey":"organizeSelect",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":[],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"归属组织",
|
||||
"trigger":"change",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164572941,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-company",
|
||||
"defaultCurrent":true,
|
||||
"tag":"YunzhupaasOrganizeSelect",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"__vModel__":"org_id",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"selectType":"all",
|
||||
"disabled":false,
|
||||
"id":"org_id",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"上级项目",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"children":"children",
|
||||
"label":"projectName",
|
||||
"value":"projectId"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"treeSelect",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"826399583931205381",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164602724,
|
||||
"tagIcon":"icon-ym icon-ym-generator-tree",
|
||||
"tag":"YunzhupaasTreeSelect",
|
||||
"formId":"formItemd3f1a4",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dynamic",
|
||||
"dictionaryType":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"上级项目",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"获取标准项目树结构",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"options":[],
|
||||
"__vModel__":"pid",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"pid",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"controls":false,
|
||||
"fullName":"顺序号",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItemf01693",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"顺序号",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164640574,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"__vModel__":"seq_num",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"seq_num",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":null,
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"autoSize":{
|
||||
"minRows":4,
|
||||
"maxRows":4
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem41e3bd",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_project",
|
||||
"renderKey":1779164655791,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"__vModel__":"remark",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"remark",
|
||||
"placeholder":"请输入",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default superQueryJson
|
||||
653
src/views/mdm/projects/index.vue
Normal file
653
src/views/mdm/projects/index.vue
Normal file
@@ -0,0 +1,653 @@
|
||||
<template>
|
||||
<div class="yunzhupaas-content-wrapper">
|
||||
<div class="yunzhupaas-content-wrapper-center">
|
||||
<div class="yunzhupaas-content-wrapper-search-box" v-if="getSearchList.length">
|
||||
<BasicForm @register="registerSearchForm" :schemas="getSearchList"
|
||||
@advanced-change="redoHeight" @submit="handleSearchSubmit" @reset="handleSearchReset"
|
||||
class="search-form">
|
||||
</BasicForm>
|
||||
</div>
|
||||
<div class="yunzhupaas-content-wrapper-content bg-white">
|
||||
<BasicTable @register="registerTable" v-bind="getTableBindValue" ref="tableRef"
|
||||
@columns-change="handleColumnChange">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" v-auth="'btn_add'"
|
||||
@click="addHandle()"> {{t('common.add2Text','新增')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
<template #title>
|
||||
<span>{{ t('common.superQuery') }}</span>
|
||||
</template>
|
||||
<filter-outlined @click="openSuperQuery(true, { columnOptions: superQueryJson })" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #toolbarAfter>
|
||||
<ViewList :menuId="route.meta.modelId" :viewList="viewList" @itemClick="handleViewClick" @reload="initViewList" />
|
||||
<ViewSetting :menuId="route.meta.modelId" :viewList="viewList" :currentView="currentView" @reload="initViewList" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-for="(item, index) in childColumnList" v-if="childColumnList.length">
|
||||
<template
|
||||
v-if="column?.id?.includes('-') && item.children && item.children[0] && column.key === item.children[0]?.dataIndex">
|
||||
<ChildTableColumn :data="record[item.prop]" :head="item.children"
|
||||
@toggleExpand="toggleExpand(record, item.prop+`Expand`)" @toDetail="toDetail"
|
||||
:expand="record[item.prop+`Expand`]" :key="index" :showOverflow="true "/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="!(record.top || column.id?.includes('-'))">
|
||||
<template v-if="column.yunzhupaasKey === 'relationForm'">
|
||||
<p class="link-text"
|
||||
@click="toDetail(column.modelId, record[column.dataIndex+`_id`], column.propsValue)">
|
||||
{{ record[column.dataIndex] }}</p>
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'inputNumber'">
|
||||
<yunzhupaas-input-number v-model:value="record[column.prop]" :precision="column.precision" :thousands="column.thousands" disabled detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'calculate'">
|
||||
<yunzhupaas-calculate
|
||||
v-model:value="record[column.prop]"
|
||||
:isStorage="column.isStorage"
|
||||
:precision="column.precision"
|
||||
:thousands="column.thousands"
|
||||
detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'sign'">
|
||||
<yunzhupaas-sign v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'signature'">
|
||||
<yunzhupaas-signature v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'rate'">
|
||||
<yunzhupaas-rate v-model:value="record[column.prop]" :count="column.count" :allowHalf="column.allowHalf" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'slider'">
|
||||
<yunzhupaas-slider v-model:value="record[column.prop]" :min="column.min" :max="column.max" :step="column.step" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadImg'">
|
||||
<yunzhupaas-upload-img v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadFile'">
|
||||
<yunzhupaas-upload-file v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'input'">
|
||||
<yunzhupaas-input
|
||||
v-model:value="record[column.prop]"
|
||||
:useMask="column.useMask"
|
||||
:maskConfig="column.maskConfig"
|
||||
:showOverflow="true"
|
||||
detailed />
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'action' && !record.top">
|
||||
<TableAction :actions="getTableActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
<Form ref="formRef" @reload="reload" />
|
||||
<Detail ref="detailRef" />
|
||||
<ExportModal @register="registerExportModal" @download="handleDownload" />
|
||||
<ImportModal @register="registerImportModal" @reload="reload" />
|
||||
<PrintSelect @register="registerPrintSelect" @change="handleShowBrowse" />
|
||||
<PrintBrowse @register="registerPrintBrowse" />
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<SuperQueryModal @register="registerSuperQueryModal" @superQuery="handleSuperQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { getList, del, exportData, batchDelete } from './helper/api';
|
||||
import { getConfigData,getViewList } from '@/api/onlineDev/visualDev';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import { getOrgByOrganizeCondition,getDepartmentSelectAsyncList } from '@/api/permission/organize';
|
||||
import { ref, reactive, onMounted, toRefs, computed, unref, nextTick, toRaw, provide } from 'vue';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useOrganizeStore } from '@/store/modules/organize';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { usePopup } from '@/components/Popup';
|
||||
import { ScrollContainer } from '@/components/Container';
|
||||
import { BasicLeftTree, TreeActionType } from '@/components/Tree';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { BasicTable, useTable, TableAction, ActionItem, TableActionType, SorterResult } from '@/components/Table';
|
||||
import { SuperQueryModal } from '@/components/CommonModal';
|
||||
import Form from './Form.vue';
|
||||
import Detail from './Detail.vue';
|
||||
// 有关联表单详情:开始
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 有关联表单详情:结束
|
||||
import ChildTableColumn from '@/views/common/dynamicModel/list/ChildTableColumn.vue';
|
||||
import { ExportModal } from '@/components/CommonModal';
|
||||
import { downloadByUrl } from '@/utils/file/download';
|
||||
import { ImportModal} from '@/components/CommonModal';
|
||||
// 打印模板多条生成PrintSelect
|
||||
import PrintSelect from '@/components/PrintDesign/printSelect/index.vue';
|
||||
import PrintBrowse from '@/components/PrintDesign/printBrowse/index.vue';
|
||||
import { useRoute,useRouter } from 'vue-router';
|
||||
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||
import { getSearchFormSchemas } from '@/components/FormGenerator/src/helper/transform';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import columnList from './helper/columnList';
|
||||
import searchList from './helper/searchList';
|
||||
import superQueryJson from './helper/superQueryJson';
|
||||
import { dyOptionsList, systemComponentsList } from '@/components/FormGenerator/src/helper/config';
|
||||
import { thousandsFormat, getParamList} from '@/utils/yunzhupaas';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
|
||||
import ViewSetting from '@/views/common/dynamicModel/list/components/ViewSetting.vue';
|
||||
import ViewList from '@/views/common/dynamicModel/list/components/ViewList.vue';
|
||||
|
||||
interface State {
|
||||
config: any;
|
||||
columnList: any[];
|
||||
printListOptions: any[];
|
||||
columnBtnsList: any[];
|
||||
customBtnsList: any[];
|
||||
treeFieldNames: any;
|
||||
leftTreeData: any[];
|
||||
leftTreeLoading: boolean;
|
||||
treeActiveId: string;
|
||||
treeActiveNodePath: any;
|
||||
columns: any[];
|
||||
complexColumns: any[];
|
||||
childColumnList: any[];
|
||||
exportList: any[];
|
||||
cacheList: any[];
|
||||
currFlow: any;
|
||||
isCustomCopy: boolean;
|
||||
candidateType: number;
|
||||
currRow: any;
|
||||
workFlowFormData: any;
|
||||
expandObj: any;
|
||||
columnSettingList: any[];
|
||||
searchSchemas: any[];
|
||||
treeRelationObj: any;
|
||||
treeQueryJson: any;
|
||||
leftTreeActiveInfo: any;
|
||||
keyword: string;
|
||||
viewList: any[];
|
||||
currentView: any;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const { hasBtnP } = usePermission();
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const organizeStore = useOrganizeStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const [registerExportModal, { openModal: openExportModal, closeModal: closeExportModal, setModalProps: setExportModalProps }] = useModal();
|
||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||
const [registerSuperQueryModal, { openModal: openSuperQuery }] = useModal();
|
||||
const formRef = ref<any>(null);
|
||||
const tableRef = ref<Nullable<TableActionType>>(null);
|
||||
const detailRef = ref<any>(null);
|
||||
const relationDetailRef = ref<any>(null);
|
||||
|
||||
const state = reactive<State>({
|
||||
config: {},
|
||||
columnList: [],
|
||||
printListOptions: [],
|
||||
columnBtnsList: [],
|
||||
customBtnsList: [],
|
||||
treeFieldNames: {
|
||||
children: 'children' ,
|
||||
title: 'fullName' ,
|
||||
key: 'id' ,
|
||||
isLeaf: 'isLeaf',
|
||||
},
|
||||
leftTreeData: [],
|
||||
leftTreeLoading: false,
|
||||
treeActiveId: '',
|
||||
treeActiveNodePath: [],
|
||||
columns: [],
|
||||
complexColumns: [], // 复杂表头
|
||||
childColumnList: [],
|
||||
exportList: [],
|
||||
cacheList: [],
|
||||
currFlow: {},
|
||||
isCustomCopy: false,
|
||||
candidateType: 1,
|
||||
currRow: {},
|
||||
workFlowFormData: {},
|
||||
expandObj: {},
|
||||
columnSettingList: [],
|
||||
searchSchemas: [],
|
||||
treeRelationObj: null,
|
||||
treeQueryJson: {},
|
||||
leftTreeActiveInfo: {},
|
||||
keyword: '',
|
||||
viewList: [],
|
||||
currentView: {},
|
||||
});
|
||||
const defaultSearchInfo = {
|
||||
menuId: route.meta.modelId as string,
|
||||
moduleId:'826396413712664325',
|
||||
superQueryJson: '',
|
||||
pageSize:1000000, //没有分页,树形,分组
|
||||
};
|
||||
const searchInfo = reactive({
|
||||
...cloneDeep(defaultSearchInfo),
|
||||
});
|
||||
const { childColumnList, searchSchemas, viewList, currentView} = toRefs(state);
|
||||
const [registerSearchForm, { updateSchema, resetFields, submit: searchFormSubmit, setFieldsValue}] = useForm({
|
||||
baseColProps: { span: 6 },
|
||||
showActionButtonGroup: true,
|
||||
showAdvancedButton: true,
|
||||
compact: true,
|
||||
});
|
||||
const [registerTable, { reload, setLoading, getFetchParams, getSelectRows, getSelectRowKeys, redoHeight,clearSelectedRowKeys }] = useTable({
|
||||
api: getList,
|
||||
immediate: false,
|
||||
clickToRowSelect: false,
|
||||
tableSetting: { setting: false },
|
||||
afterFetch: (data) => {
|
||||
const list = data.map((o) => ({
|
||||
...o,
|
||||
...state.expandObj,
|
||||
}));
|
||||
state.cacheList = cloneDeep(list);
|
||||
return list;
|
||||
},
|
||||
});
|
||||
const [registerChildTable] = useTable({
|
||||
pagination: false,
|
||||
canResize: false,
|
||||
showTableSetting: false,
|
||||
});
|
||||
|
||||
provide('getLeftTreeActiveInfo', () => state.leftTreeActiveInfo);
|
||||
|
||||
const getHasBatchBtn = computed(() => {
|
||||
let btnsList =[]
|
||||
btnsList=btnsList.filter(o => hasBtnP('btn_' + o))
|
||||
return !!btnsList.length
|
||||
});
|
||||
|
||||
|
||||
const getColumns = computed(() => {
|
||||
const columns = state.complexColumns;
|
||||
return setListValue(state.currentView?.columnList, columns, 'prop');
|
||||
});
|
||||
const getSearchList = computed(() => {
|
||||
const searchSchemas = cloneDeep(state.searchSchemas).map(o => ({ ...o, show: true }));
|
||||
return setListValue(state.currentView?.searchList, searchSchemas, 'field');
|
||||
});
|
||||
const getTableBindValue = computed(() => {
|
||||
let columns = unref(getColumns);
|
||||
const defaultSortConfig=[{"field":"seq_num","sort":"asc","id":"sort1a71b8"}];
|
||||
const sortField = defaultSortConfig.map(o => (o.sort === 'desc' ? '-' : '') + o.field);
|
||||
const data: any = {
|
||||
pagination: false, //没有分页,树形,分组
|
||||
searchInfo: unref(searchInfo),
|
||||
defSort: { sidx: sortField.join(',') },
|
||||
sortFn: (sortInfo: SorterResult | SorterResult[]) => {
|
||||
if (Array.isArray(sortInfo)) {
|
||||
const sortList = sortInfo.map(o => (o.order === 'descend' ? '-' : '') + o.field);
|
||||
return { sidx: sortList.join(',') };
|
||||
} else {
|
||||
const { field, order } = sortInfo;
|
||||
if (field && order) {
|
||||
// 排序字段
|
||||
return { sidx: (order === 'descend' ? '-' : '') + field };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
ellipsis:true ,
|
||||
columns,
|
||||
isTreeTable: true,
|
||||
bordered: true,
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
title: t('component.table.action'),
|
||||
dataIndex: 'action',
|
||||
},
|
||||
};
|
||||
return data;
|
||||
});
|
||||
|
||||
function init() {
|
||||
state.config = {};
|
||||
searchInfo.menuId = route.meta.modelId as string;
|
||||
state.columnList = columnList;
|
||||
setLoading(true);
|
||||
getSearchSchemas();
|
||||
getColumnList();
|
||||
initViewList();
|
||||
nextTick(() => {
|
||||
unref(getSearchList)?.length ? searchFormSubmit() : reload({ page: 1 });
|
||||
});
|
||||
}
|
||||
function getSearchSchemas() {
|
||||
|
||||
const schemas = getSearchFormSchemas(searchList);
|
||||
state.searchSchemas = schemas;
|
||||
schemas.forEach((cur) => {
|
||||
const config = cur.__config__;
|
||||
if (dyOptionsList.includes(config.yunzhupaasKey)) {
|
||||
if (config.dataType === 'dictionary') {
|
||||
if (!config.dictionaryType) return;
|
||||
getDictionaryDataSelector(config.dictionaryType).then((res) => {
|
||||
updateSchema([{ field: cur.field, componentProps: { options: res.data.list } }]);
|
||||
});
|
||||
}
|
||||
if (config.dataType === 'dynamic') {
|
||||
if (!config.propsUrl) return;
|
||||
const query = { paramList: getParamList(config.templateJson) };
|
||||
getDataInterfaceRes(config.propsUrl, query).then((res) => {
|
||||
const data = Array.isArray(res.data) ? res.data : [];
|
||||
updateSchema([{ field: cur.field, componentProps: { options: data } }]);
|
||||
});
|
||||
}
|
||||
}
|
||||
cur.defaultValue = cur.value;
|
||||
});
|
||||
}
|
||||
function getColumnList() {
|
||||
// 没有开启列表权限
|
||||
let columnList = state.columnList;
|
||||
state.exportList = columnList;
|
||||
let columns = columnList.map((o) => ({
|
||||
...o,
|
||||
title: o.labelI18nCode ? t(o.labelI18nCode, o.label) : o.label,
|
||||
dataIndex: o.prop,
|
||||
align: o.align,
|
||||
fixed: o.fixed == 'none' ? false : o.fixed,
|
||||
sorter: o.sortable ? { multiple: 1 } : o.sortable,
|
||||
width: o.width || 100,
|
||||
}));
|
||||
//添加复杂表头
|
||||
columns = getComplexColumns(columns);
|
||||
state.columns = columns.filter((o) => o.prop.indexOf('-') < 0);
|
||||
//子表表头
|
||||
getChildComplexColumns(columns);
|
||||
}
|
||||
|
||||
|
||||
//复杂表头
|
||||
function getComplexColumns(columns) {
|
||||
//这里生成复杂表头的配置
|
||||
let complexHeaderList: any[] = [];
|
||||
if (!complexHeaderList.length) return columns;
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.label = e.fullName;
|
||||
e.labelI18nCode = e.fullNameI18nCode;
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.dataIndex = e.id;
|
||||
e.prop = e.id;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < columns.length; j++) {
|
||||
const o = columns[j];
|
||||
if (o.prop == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].prop);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
const e = columns[i];
|
||||
if (!childColumns.includes(e.prop)) {
|
||||
list.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.prop)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.prop));
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//子表表头
|
||||
function getChildComplexColumns(columnList) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i];
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e);
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0];
|
||||
let vModel = e.prop.split('-')[1];
|
||||
let label = e.label.split('-')[0];
|
||||
let childLabel = e.label.replace(label + '-', '');
|
||||
if (e.fullNameI18nCode && Array.isArray(e.fullNameI18nCode) && e.fullNameI18nCode[0]) label = t(e.fullNameI18nCode[0], label);
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
yunzhupaasKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
title: label,
|
||||
dataIndex: prop,
|
||||
children: [],
|
||||
};
|
||||
e.dataIndex = vModel;
|
||||
e.title = e.labelI18nCode ? t(e.labelI18nCode, childLabel) : childLabel;
|
||||
if (!state.expandObj.hasOwnProperty(prop+`Expand`)) state.expandObj[prop+`Expand`] = false;
|
||||
if (!list.some((o) => o.prop === prop)) list.push(newItem);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 行内分组展示
|
||||
getMergeList(list);
|
||||
|
||||
state.complexColumns = list;
|
||||
state.childColumnList = list.filter((o) => o.yunzhupaasKey === 'table');
|
||||
|
||||
// 子表分组展示宽度取100
|
||||
for (let i = 0; i < state.childColumnList.length; i++) {
|
||||
const e = state.childColumnList[i];
|
||||
if (e.children?.length) e.children = e.children.map(o => ({ ...o, width: 100 }));
|
||||
}
|
||||
}
|
||||
function getMergeList(list) {
|
||||
list.forEach((item) => {
|
||||
if (item.yunzhupaasKey === 'table' && item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
child.customCell = () => ({
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
class: 'child-table-box',
|
||||
});
|
||||
} else {
|
||||
child.customCell = () => ({
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleExpand(row, field) {
|
||||
row[field] = !row[field];
|
||||
}
|
||||
// 关联表单查看详情
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function handleColumnChange(data) {
|
||||
state.columnSettingList = data;
|
||||
}
|
||||
function getTableActions(record): ActionItem[] {
|
||||
return [
|
||||
{
|
||||
label: t('common.editText','编辑') ,
|
||||
onClick: updateHandle.bind(null, record),
|
||||
auth: 'btn_edit', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.delText','删除') ,
|
||||
color: 'error',
|
||||
modelConfirm: {
|
||||
onOk: handleDelete.bind(null, record.id),
|
||||
},
|
||||
auth: 'btn_remove', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.detailText','详情') ,
|
||||
onClick: goDetail.bind(null, record),
|
||||
auth: 'btn_detail', //有按钮权限
|
||||
},
|
||||
];
|
||||
}
|
||||
// 编辑
|
||||
function updateHandle(record) {
|
||||
// 不带工作流
|
||||
const data = {
|
||||
id: record.id,
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 删除
|
||||
function handleDelete(id) {
|
||||
const query={ids:[id] }
|
||||
batchDelete(query).then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
});
|
||||
}
|
||||
// 查看详情
|
||||
function goDetail(record) {
|
||||
// 不带流程
|
||||
const data = {
|
||||
id: record.id,
|
||||
};
|
||||
detailRef.value?.init(data);
|
||||
}
|
||||
// 新增
|
||||
function addHandle() {
|
||||
// 不带流程新增
|
||||
const data = {
|
||||
id: '',
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 高级查询
|
||||
function handleSuperQuery(superQueryJson) {
|
||||
searchInfo.superQueryJson = superQueryJson;
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function handleSearchReset() {
|
||||
clearSelectedRowKeys();
|
||||
if (!state.resetFromTree) updateSearchFormValue();
|
||||
if (state.resetFromTree) state.resetFromTree = false;
|
||||
}
|
||||
|
||||
function handleSearchSubmit(data) {
|
||||
clearSelectedRowKeys();
|
||||
let obj = {
|
||||
...defaultSearchInfo,
|
||||
superQueryJson: searchInfo.superQueryJson,
|
||||
...data,
|
||||
};
|
||||
Object.keys(searchInfo).map(key => {
|
||||
delete searchInfo[key];
|
||||
});
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
searchInfo[key.replaceAll('-', '_')] = value;
|
||||
}
|
||||
console.log(searchInfo);
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function updateSearchFormValue() {
|
||||
if (!state.treeActiveId) return searchFormSubmit();
|
||||
let queryJson: any = {};
|
||||
let leftTreeActiveInfo: any = {};
|
||||
const isMultiple = !state.treeRelationObj ? false : state.treeRelationObj.searchMultiple;
|
||||
//多级左侧树,需要拼父级->转为查询参数
|
||||
if (state.treeRelationObj && state.treeRelationObj.yunzhupaasKey && ['organizeSelect', 'cascader', 'areaSelect'].includes(state.treeRelationObj.yunzhupaasKey)) {
|
||||
let currValue = [];
|
||||
currValue = state.treeActiveNodePath.map(o => o[state.treeFieldNames.key]);
|
||||
queryJson = { '': isMultiple ? [currValue] : currValue };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [currValue] : currValue };
|
||||
} else {
|
||||
queryJson = { '': isMultiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
leftTreeActiveInfo = { '': state.treeRelationObj.multiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
}
|
||||
state.leftTreeActiveInfo = leftTreeActiveInfo;
|
||||
if(unref(getSearchList)?.length){
|
||||
// 有搜索列表
|
||||
setFieldsValue(queryJson);
|
||||
searchFormSubmit();
|
||||
}else{
|
||||
// 无搜索列表
|
||||
handleSearchSubmit(queryJson);
|
||||
}
|
||||
}
|
||||
function initViewList(currentId = '') {
|
||||
const query = {
|
||||
menuId: route.meta.modelId,
|
||||
};
|
||||
getViewList(query).then(res => {
|
||||
const columns : any[]= state.complexColumns;
|
||||
const searchList: any[] = state.searchSchemas.map(o => ({ label: o.label, id: o.field, show: o.show, labelI18nCode: o.labelI18nCode }));
|
||||
const columnList: any[] = columns.map(o => ({ label: o.label, id: o.prop, show: true, fixed: o.fixed || 'none', labelI18nCode: o.labelI18nCode }));
|
||||
state.viewList = (res.data || []).map(o => {
|
||||
if (o.type == 0) return { ...o, searchList, columnList };
|
||||
return { ...o, searchList: o.searchList ? JSON.parse(o.searchList) : [], columnList: o.columnList ? JSON.parse(o.columnList) : [] };
|
||||
});
|
||||
if (currentId) {
|
||||
state.currentView = state.viewList.filter(o => o.id === currentId)[0] || state.viewList[0];
|
||||
} else {
|
||||
state.currentView = state.viewList.filter(o => o.status === 1)[0] || state.viewList[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleViewClick(item) {
|
||||
state.currentView = item;
|
||||
}
|
||||
|
||||
function setListValue(data: any[] = [], defaultData: any[] = [], key) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
for (let j = 0; j < defaultData.length; j++) {
|
||||
if (data[i].show && data[i].id == defaultData[j][key]) list.push(defaultData[j]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
@@ -1,34 +0,0 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Suppinfo/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/Suppinfo', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/Suppinfo/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Suppinfo/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Suppinfo/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/Suppinfo/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/Suppinfo/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Suppinfo/Actions/Export', data });
|
||||
}
|
||||
1170
src/views/mdm/supplier/Detail.vue
Normal file
1170
src/views/mdm/supplier/Detail.vue
Normal file
File diff suppressed because it is too large
Load Diff
34
src/views/mdm/supplier/helper/api.ts
Normal file
34
src/views/mdm/supplier/helper/api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Supplier/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/Supplier', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/Supplier/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Supplier/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/Supplier/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/Supplier/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/Supplier/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/Supplier/Actions/Export', data });
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-download" v-auth="'btn_download'"
|
||||
@click="openExportModal(true, { columnList: state.exportList, selectIds: getSelectRowKeys(), showExportSelected: true })"> {{t('common.exportText','导出')}}</a-button>
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-upload" v-auth="'btn_upload'"
|
||||
@click="openImportModal(true, { url: 'bcm/Suppinfo', menuId: searchInfo.menuId })"> {{t('common.importText','导入')}}</a-button>
|
||||
@click="openImportModal(true, { url: 'bcm/Supplier', menuId: searchInfo.menuId })"> {{t('common.importText','导入')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
229
src/views/mdm/worktype/Detail.vue
Normal file
229
src/views/mdm/worktype/Detail.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<BasicPopup v-bind="$attrs" @register="registerPopup" :title="title" destroyOnClose>
|
||||
<template #insertToolbar>
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form " :style="{ margin: '0 auto', width: '100%' }">
|
||||
<!-- 表单 -->
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" ref="formRef" >
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_type_code" >
|
||||
<template #label>工种编码
|
||||
</template> <p>{{dataForm.work_type_code}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_type_name" >
|
||||
<template #label>工种名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.work_type_name"
|
||||
placeholder="请输入" :maxlength="20" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.work_type_name" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_category_id" >
|
||||
<template #label>工种分类
|
||||
</template> <p>{{dataForm.work_category_id}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="skill_level" >
|
||||
<template #label>技能等级
|
||||
</template> <p>{{dataForm.skill_level}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="unit" >
|
||||
<template #label>计价单位
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.unit"
|
||||
placeholder="请输入" :maxlength="20" disabled
|
||||
detailed allowClear :style='{"width":"100%"}' :maskConfig = "maskConfig.unit" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="reference_unit_price" >
|
||||
<template #label>参考单价
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.reference_unit_price"
|
||||
placeholder="请输入" disabled
|
||||
detailed :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="price_lower_limit" >
|
||||
<template #label>单价下限
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.price_lower_limit"
|
||||
placeholder="请输入" disabled
|
||||
detailed :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="price_upper_limit" >
|
||||
<template #label>单价上限
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.price_upper_limit"
|
||||
placeholder="请输入" disabled
|
||||
detailed :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="seq_num" >
|
||||
<template #label>排序号
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.seq_num"
|
||||
placeholder="请输入" disabled
|
||||
detailed :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_description" >
|
||||
<template #label>工种描述
|
||||
</template> <p>{{dataForm.work_description}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remarks" >
|
||||
<template #label>备注
|
||||
</template> <p>{{dataForm.remarks}}</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicPopup>
|
||||
<!-- 有关联表单详情:开始 -->
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<!-- 有关联表单详情:结束 -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getDetailInfo } from './helper/api';
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev';
|
||||
import { reactive, toRefs, nextTick, ref, computed, unref ,toRaw} from 'vue';
|
||||
import { BasicPopup, usePopup } from '@/components/Popup';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
// 有关联表单详情
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { getDataChange } from '@/api/onlineDev/visualDev';
|
||||
import { getDataInterfaceDataInfoByIds } from '@/api/systemData/dataInterface';
|
||||
import ExtraRelationInfo from '@/components/yunzhupaas/RelationForm/src/ExtraRelationInfo.vue';
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
title: string;
|
||||
maskConfig: any;
|
||||
interfaceRes: any;
|
||||
locationScope: any;
|
||||
extraOptions: any;
|
||||
extraData: any;
|
||||
|
||||
}
|
||||
|
||||
defineOptions({ name: 'Detail' });
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const [registerPopup, { openPopup, setPopupProps, closePopup }] = usePopup();
|
||||
|
||||
const { t } = useI18n();
|
||||
const relationDetailRef = ref<any>(null);
|
||||
const state = reactive<State>({
|
||||
dataForm:{},
|
||||
title: t('common.detailText','详情'),
|
||||
maskConfig:{
|
||||
work_type_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
unit: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
}
|
||||
,
|
||||
interfaceRes: {"price_lower_limit":[],"reference_unit_price":[],"unit":[],"work_category_id":[],"price_upper_limit":[],"work_description":[],"skill_level":[],"work_type_code":[],"seq_num":[],"remarks":[],"work_type_name":[]},
|
||||
locationScope:{
|
||||
}
|
||||
,
|
||||
extraOptions: {
|
||||
}
|
||||
,
|
||||
extraData: {
|
||||
}
|
||||
,
|
||||
});
|
||||
const { title, dataForm, maskConfig } = toRefs(state);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.dataForm.id = data.id;
|
||||
openPopup();
|
||||
nextTick(() => {
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
closePopup();
|
||||
}
|
||||
}
|
||||
function getData(id) {
|
||||
getDetailInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
nextTick(() => {
|
||||
changeLoading(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setPopupProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setFormProps({ loading });
|
||||
}
|
||||
|
||||
function getParamList(key) {
|
||||
let templateJson: any[] = state.interfaceRes[key];
|
||||
if (!templateJson || !templateJson.length || !state.dataForm) return templateJson;
|
||||
for (let i = 0; i < templateJson.length; i++) {
|
||||
if (templateJson[i].relationField && templateJson[i].sourceType == 1) {
|
||||
templateJson[i].defaultValue = state.dataForm[templateJson[i].relationField + '_id'] || '';
|
||||
}
|
||||
}
|
||||
return templateJson;
|
||||
}
|
||||
</script>
|
||||
477
src/views/mdm/worktype/Form.vue
Normal file
477
src/views/mdm/worktype/Form.vue
Normal file
@@ -0,0 +1,477 @@
|
||||
<template>
|
||||
<BasicPopup v-bind="$attrs" @register="registerPopup" showOkBtn destroyOnClose
|
||||
:cancelText="t('common.cancelText','取消')"
|
||||
:okText="t('common.okText','确定')"
|
||||
@ok="handleSubmit" :closeFunc="onClose">
|
||||
<template #title>
|
||||
<a-space :size="10">
|
||||
<div class="text-16px font-medium">{{ title }}</div>
|
||||
<a-space-compact size="small" block v-if="dataForm.id">
|
||||
<a-tooltip :title="t('common.prevRecord')">
|
||||
<a-button size="small" :disabled="getPrevDisabled" @click="handlePrev">
|
||||
<i class="icon-ym icon-ym-caret-left text-10px"></i>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip :title="t('common.nextRecord')">
|
||||
<a-button size="small" :disabled="getNextDisabled" @click="handleNext">
|
||||
<i class="icon-ym icon-ym-caret-right text-10px"></i>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space-compact>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #insertToolbar>
|
||||
<yunzhupaasCheckboxSingle v-model:value="submitType" :label="continueText" v-if="showContinueBtn" />
|
||||
</template>
|
||||
<a-row class="p-10px dynamic-form " :style="{ margin: '0 auto', width: '100%' }">
|
||||
<a-form :colon="false" size="middle" layout= "horizontal"
|
||||
labelAlign= "right"
|
||||
:labelCol="{ style: { width: '100px' } }" :model="dataForm" :rules="dataRule" ref="formRef" >
|
||||
<a-row :gutter="15">
|
||||
<!-- 具体表单 -->
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_type_code" >
|
||||
<template #label>工种编码
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.work_type_code" @change="changeData('work_type_code',-1)"
|
||||
placeholder="系统自动生成" readonly :style='{"width":"100%"}' >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_type_name" >
|
||||
<template #label>工种名称
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.work_type_name" @change="changeData('work_type_name',-1)"
|
||||
placeholder="请输入" :maxlength="20" :allowClear='true' :style='{"width":"100%"}' :maskConfig = "maskConfig.work_type_name" :showCount = "false" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_category_id" >
|
||||
<template #label>工种分类
|
||||
</template> <YunzhupaasSelect v-model:value="dataForm.work_category_id" @change="changeData('work_category_id',-1)"
|
||||
placeholder="请选择" :templateJson="state.interfaceRes.work_category_id" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.work_category_idOptions" :fieldNames="optionsObj.work_category_idProps"
|
||||
>
|
||||
</YunzhupaasSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="skill_level" >
|
||||
<template #label>技能等级
|
||||
</template> <YunzhupaasSelect v-model:value="dataForm.skill_level" @change="changeData('skill_level',-1)"
|
||||
placeholder="请选择" :templateJson="state.interfaceRes.skill_level" :allowClear='true' :style='{"width":"100%"}' :showSearch='false' :options="optionsObj.skill_levelOptions" :fieldNames="optionsObj.skill_levelProps"
|
||||
>
|
||||
</YunzhupaasSelect>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="unit" >
|
||||
<template #label>计价单位
|
||||
</template> <YunzhupaasInput v-model:value="dataForm.unit" @change="changeData('unit',-1)"
|
||||
placeholder="请输入" :maxlength="20" :allowClear='true' :style='{"width":"100%"}' :maskConfig = "maskConfig.unit" :showCount = "false" >
|
||||
</YunzhupaasInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="reference_unit_price" >
|
||||
<template #label>参考单价
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.reference_unit_price" @change="changeData('reference_unit_price',-1)"
|
||||
placeholder="请输入" :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="price_lower_limit" >
|
||||
<template #label>单价下限
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.price_lower_limit" @change="changeData('price_lower_limit',-1)"
|
||||
placeholder="请输入" :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="price_upper_limit" >
|
||||
<template #label>单价上限
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.price_upper_limit" @change="changeData('price_upper_limit',-1)"
|
||||
placeholder="请输入" :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="seq_num" >
|
||||
<template #label>排序号
|
||||
</template> <YunzhupaasInputNumber v-model:value="dataForm.seq_num" @change="changeData('seq_num',-1)"
|
||||
placeholder="请输入" :style='{"width":"100%"}' :step="1" :precision="2" :controls="false" >
|
||||
</YunzhupaasInputNumber>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="work_description" >
|
||||
<template #label>工种描述
|
||||
</template> <YunzhupaasTextarea v-model:value="dataForm.work_description" @change="changeData('work_description',-1)"
|
||||
placeholder="请输入" :maxlength="255" :allowClear='true' :style='{"width":"100%"}' :autoSize='{"minRows":2,"maxRows":2}' :showCount = "false" >
|
||||
</YunzhupaasTextarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" class="ant-col-item" >
|
||||
<a-form-item
|
||||
name="remarks" >
|
||||
<template #label>备注
|
||||
</template> <YunzhupaasTextarea v-model:value="dataForm.remarks" @change="changeData('remarks',-1)"
|
||||
placeholder="请输入" :maxlength="255" :allowClear='true' :style='{"width":"100%"}' :autoSize='{"minRows":2,"maxRows":2}' :showCount = "false" >
|
||||
</YunzhupaasTextarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- 表单结束 -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-row>
|
||||
</BasicPopup>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { create, update, getInfo } from './helper/api';
|
||||
import { reactive, toRefs, nextTick, ref, unref, computed,toRaw, inject } from 'vue';
|
||||
import { BasicPopup, usePopup } from '@/components/Popup';
|
||||
import { yunzhupaasRelationForm } from '@/components/yunzhupaas';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import type { FormInstance } from 'ant-design-vue';
|
||||
import { thousandsFormat , getDateTimeUnit, getTimeUnit} from '@/utils/yunzhupaas';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import dayjs from 'dayjs';
|
||||
// 表单权限
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { buildUUID } from '@/utils/uuid';
|
||||
import { CaretRightOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
|
||||
interface State {
|
||||
dataForm: any;
|
||||
tableRows: any;
|
||||
dataRule: any;
|
||||
optionsObj: any;
|
||||
childIndex: any;
|
||||
isEdit: any;
|
||||
interfaceRes: any;
|
||||
//可选范围默认值
|
||||
ableAll: any;
|
||||
//掩码配置
|
||||
maskConfig:any;
|
||||
//定位属性
|
||||
locationScope:any;
|
||||
extraOptions: any;
|
||||
title: string;
|
||||
continueText: string; allList: any[];
|
||||
currIndex: number;
|
||||
isContinue: boolean;
|
||||
submitType: number;
|
||||
showContinueBtn: boolean;
|
||||
}
|
||||
|
||||
const emit = defineEmits(['reload']);
|
||||
const getLeftTreeActiveInfo: (() => any) | null = inject('getLeftTreeActiveInfo', null);
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const [registerPopup, { openPopup, setPopupProps }] = usePopup();
|
||||
const formRef = ref<FormInstance>();
|
||||
const state = reactive<State>({
|
||||
dataForm: {
|
||||
work_type_code:undefined,
|
||||
work_type_name:'',
|
||||
work_category_id:'',
|
||||
skill_level:'',
|
||||
unit:undefined,
|
||||
reference_unit_price:undefined,
|
||||
price_lower_limit:undefined,
|
||||
price_upper_limit:undefined,
|
||||
seq_num:undefined,
|
||||
work_description:undefined,
|
||||
remarks:undefined,
|
||||
},
|
||||
|
||||
tableRows:{
|
||||
},
|
||||
|
||||
dataRule: {
|
||||
work_type_name: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.textRequiredSuffix','不能为空'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
work_category_id: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.arrayRequiredPrefix ','请至少选择一个'),
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
skill_level: [
|
||||
{
|
||||
required: true,
|
||||
message: t('sys.validate.arrayRequiredPrefix ','请至少选择一个'),
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
optionsObj:{
|
||||
work_category_idOptions:[],
|
||||
work_category_idProps:{"label":"fullName","value":"id" },
|
||||
skill_levelOptions:[],
|
||||
skill_levelProps:{"label":"fullName","value":"id" },
|
||||
},
|
||||
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {"price_lower_limit":[],"reference_unit_price":[],"unit":[],"work_category_id":[],"price_upper_limit":[],"work_description":[],"skill_level":[],"work_type_code":[],"seq_num":[],"remarks":[],"work_type_name":[]},
|
||||
//可选范围默认值
|
||||
ableAll:{
|
||||
},
|
||||
|
||||
//掩码配置
|
||||
maskConfig:{
|
||||
work_type_name: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
unit: {"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""} ,
|
||||
},
|
||||
|
||||
//定位属性
|
||||
locationScope:{
|
||||
},
|
||||
|
||||
extraOptions:{
|
||||
},
|
||||
|
||||
title: "",
|
||||
continueText: "", allList: [],
|
||||
currIndex: 0,
|
||||
isContinue: false,
|
||||
submitType: 0,
|
||||
showContinueBtn: true ,
|
||||
});
|
||||
const { title, continueText, showContinueBtn, dataRule, dataForm, optionsObj, ableAll, maskConfig,submitType } = toRefs(state);
|
||||
|
||||
const getPrevDisabled = computed(() => state.currIndex === 0);
|
||||
const getNextDisabled = computed(() => state.currIndex === state.allList.length - 1);
|
||||
// 表单权限
|
||||
const { hasFormP } = usePermission();
|
||||
|
||||
defineExpose({ init });
|
||||
|
||||
function init(data) {
|
||||
state.submitType = 0;
|
||||
state.isContinue = false;
|
||||
state.title = !data.id ? t('common.add2Text','新增') : t('common.editText','编辑');
|
||||
state.continueText = !data.id ? t('common.continueAndAddText','确定并新增') : t('common.continueText','确定并继续'); setFormProps({ continueLoading: false });
|
||||
state.dataForm.id = data.id;
|
||||
openPopup();
|
||||
state.allList = data.allList;
|
||||
state.currIndex = state.allList.length && data.id ? state.allList.findIndex((item) => item.id === data.id) : 0;
|
||||
nextTick(() => {
|
||||
getForm().resetFields();
|
||||
setTimeout(initData, 0);
|
||||
});
|
||||
}
|
||||
function initData() {
|
||||
changeLoading(true);
|
||||
if (state.dataForm.id) {
|
||||
getData(state.dataForm.id);
|
||||
} else {
|
||||
//初始化options
|
||||
getwork_category_idOptions();
|
||||
getskill_levelOptions();
|
||||
|
||||
// 设置默认值
|
||||
state.dataForm={
|
||||
work_type_code:undefined,
|
||||
work_type_name:'',
|
||||
work_category_id:'',
|
||||
skill_level:'',
|
||||
unit:undefined,
|
||||
reference_unit_price:undefined,
|
||||
price_lower_limit:undefined,
|
||||
price_upper_limit:undefined,
|
||||
seq_num:undefined,
|
||||
work_description:undefined,
|
||||
remarks:undefined,
|
||||
};
|
||||
if (getLeftTreeActiveInfo) state.dataForm = {...state.dataForm, ...(getLeftTreeActiveInfo() || {}) };
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
}
|
||||
}
|
||||
function getForm() {
|
||||
const form = unref(formRef);
|
||||
if (!form) {
|
||||
throw new Error('form is null!');
|
||||
}
|
||||
return form;
|
||||
}
|
||||
function getData(id) {
|
||||
getInfo(id).then((res) => {
|
||||
state.dataForm = res.data || {};
|
||||
getwork_category_idOptions();
|
||||
getskill_levelOptions();
|
||||
|
||||
state.childIndex = -1;
|
||||
changeLoading(false);
|
||||
});
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
const values = await getForm()?.validate();
|
||||
if (!values) return;
|
||||
|
||||
|
||||
setFormProps({ confirmLoading: true });
|
||||
const formMethod = state.dataForm.id ? update : create;
|
||||
formMethod(state.dataForm)
|
||||
.then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
setFormProps({ confirmLoading: false });
|
||||
if (state.submitType == 1) {
|
||||
initData();
|
||||
state.isContinue = true;
|
||||
} else {
|
||||
setFormProps({ open: false });
|
||||
emit('reload');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setFormProps({ confirmLoading: false });
|
||||
});
|
||||
} catch (_) {}
|
||||
}
|
||||
function handlePrev() {
|
||||
state.currIndex--;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleNext() {
|
||||
state.currIndex++;
|
||||
handleGetNewInfo();
|
||||
}
|
||||
function handleGetNewInfo() {
|
||||
changeLoading(true);
|
||||
getForm().resetFields();
|
||||
const id = state.allList[state.currIndex].id;
|
||||
getData(id);
|
||||
}
|
||||
function setFormProps(data) {
|
||||
setPopupProps(data);
|
||||
}
|
||||
function changeLoading(loading) {
|
||||
setPopupProps({ loading });
|
||||
}
|
||||
async function onClose() {
|
||||
if (state.isContinue) emit('reload');
|
||||
return true;
|
||||
}
|
||||
|
||||
function changeData(model, index) {
|
||||
state.isEdit = false
|
||||
state.childIndex = index
|
||||
for (let key in state.interfaceRes) {
|
||||
if (key != model) {
|
||||
let faceReList = state.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
let relationField = faceReList[i].relationField;
|
||||
if(relationField){
|
||||
let modelAll = relationField.split('-');
|
||||
let faceMode = '';
|
||||
let faceMode2 = modelAll.length == 2?modelAll[0].substring(0, modelAll[0].length-4) +modelAll[1]:""
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
if (faceMode == model || faceMode2 == model ) {
|
||||
let options = 'get' + key + 'Options';
|
||||
eval(options)(true);
|
||||
changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function changeDataFormData(type, data, model,index,defaultValue) {
|
||||
if(!state.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < state.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
state.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
state.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
}
|
||||
//数据选项--数据字典初始化方法
|
||||
function getwork_category_idOptions() {
|
||||
getDictionaryDataSelector('workCategory').then(res => {
|
||||
state.optionsObj.work_category_idOptions = res.data.list
|
||||
})
|
||||
}
|
||||
//数据选项--数据字典初始化方法
|
||||
function getskill_levelOptions() {
|
||||
getDictionaryDataSelector('skillLevel').then(res => {
|
||||
state.optionsObj.skill_levelOptions = res.data.list
|
||||
})
|
||||
}
|
||||
function getRelationDate(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue: any = null;
|
||||
let timeValue = Number(timeValueData);
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue;
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime();
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).valueOf();
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
function getRelationTime(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType;
|
||||
let timeDataValue: any = null;
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00';
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue;
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00';
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue;
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = dayjs().format(format);
|
||||
} else if (timeType == 4 || timeType == 5) {
|
||||
const type = getTimeUnit(timeTarget + 3);
|
||||
const method = timeType == 4 ? 'subtract' : 'add';
|
||||
timeDataValue = dayjs()[method](timeValue, type).format(format);
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
}
|
||||
</script>
|
||||
34
src/views/mdm/worktype/helper/api.ts
Normal file
34
src/views/mdm/worktype/helper/api.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
|
||||
// 获取列表
|
||||
export function getList(data) {
|
||||
return defHttp.post({ url: '/api/bcm/WorkType/getList', data });
|
||||
}
|
||||
// 新建
|
||||
export function create(data) {
|
||||
return defHttp.post({ url:'/api/bcm/WorkType', data });
|
||||
}
|
||||
// 修改
|
||||
export function update(data) {
|
||||
return defHttp.put({ url: '/api/bcm/WorkType/'+ data.id, data });
|
||||
}
|
||||
// 详情(无转换数据)
|
||||
export function getInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/WorkType/' + id });
|
||||
}
|
||||
// 获取(转换数据)
|
||||
export function getDetailInfo(id) {
|
||||
return defHttp.get({ url: '/api/bcm/WorkType/detail/' + id });
|
||||
}
|
||||
// 删除
|
||||
export function del(id) {
|
||||
return defHttp.delete({ url: '/api/bcm/WorkType/' + id });
|
||||
}
|
||||
// 批量删除数据
|
||||
export function batchDelete(data) {
|
||||
return defHttp.delete({ url: '/api/bcm/WorkType/batchRemove', data });
|
||||
}
|
||||
// 导出
|
||||
export function exportData(data) {
|
||||
return defHttp.post({ url: '/api/bcm/WorkType/Actions/Export', data });
|
||||
}
|
||||
601
src/views/mdm/worktype/helper/columnList.ts
Normal file
601
src/views/mdm/worktype/helper/columnList.ts
Normal file
@@ -0,0 +1,601 @@
|
||||
const columnList = [
|
||||
{
|
||||
"yunzhupaasKey":"billRule",
|
||||
"resizable":true,
|
||||
"fullName":"工种编码",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"工种编码",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"__config__":{
|
||||
"formId":"formItemec5a15",
|
||||
"yunzhupaasKey":"billRule",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"rule":"workTypeCode",
|
||||
"className":[],
|
||||
"label":"工种编码",
|
||||
"trigger":"change",
|
||||
"ruleConfig":{
|
||||
"startNumber":"",
|
||||
"dateFormat":"YYYY",
|
||||
"randomDigit":16,
|
||||
"prefixList":[],
|
||||
"randomType":1,
|
||||
"suffixList":[],
|
||||
"type":1,
|
||||
"digit":null
|
||||
},
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777345780019,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-documents",
|
||||
"ruleType":1,
|
||||
"ruleName":"工种编码",
|
||||
"tag":"YunzhupaasInput",
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":true,
|
||||
"prop":"work_type_code",
|
||||
"width":null,
|
||||
"__vModel__":"work_type_code",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"id":"work_type_code",
|
||||
"placeholder":"系统自动生成",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem120e88",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"defaultValue":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"工种名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777345895532,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"unique":false,
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"work_type_name",
|
||||
"__vModel__":"work_type_name",
|
||||
"disabled":false,
|
||||
"id":"work_type_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":20,
|
||||
"fullName":"工种名称",
|
||||
"label":"工种名称",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"select",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"multiple":false,
|
||||
"fullName":"工种分类",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"工种分类",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777346352365,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItema4f72a",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dictionary",
|
||||
"dictionaryType":"workCategory",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"工种分类",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"prop":"work_category_id",
|
||||
"width":null,
|
||||
"options":[],
|
||||
"__vModel__":"work_category_id",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"work_category_id",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"select",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"multiple":false,
|
||||
"fullName":"技能等级",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"技能等级",
|
||||
"sortable":false,
|
||||
"align":"left",
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777347095610,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItem03ef8d",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dictionary",
|
||||
"dictionaryType":"skillLevel",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"技能等级",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"prop":"skill_level",
|
||||
"width":null,
|
||||
"options":[],
|
||||
"__vModel__":"skill_level",
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"skill_level",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemec96d9",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"计价单位",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777347663137,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"unit",
|
||||
"__vModel__":"unit",
|
||||
"disabled":false,
|
||||
"id":"unit",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"resizable":true,
|
||||
"maxlength":20,
|
||||
"fullName":"计价单位",
|
||||
"label":"计价单位",
|
||||
"sortable":false,
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"width":null,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"controls":false,
|
||||
"precision":2,
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"isAmountChinese":false,
|
||||
"__config__":{
|
||||
"formId":"formItem21ecc7",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"参考单价",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777347687893,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"prop":"reference_unit_price",
|
||||
"__vModel__":"reference_unit_price",
|
||||
"disabled":false,
|
||||
"id":"reference_unit_price",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"resizable":true,
|
||||
"max":null,
|
||||
"fullName":"参考单价",
|
||||
"label":"参考单价",
|
||||
"sortable":false,
|
||||
"thousands":false,
|
||||
"addonAfter":"",
|
||||
"width":null,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"controls":false,
|
||||
"precision":2,
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"isAmountChinese":false,
|
||||
"__config__":{
|
||||
"formId":"formItemb89c51",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"单价下限",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1778463666421,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"prop":"price_lower_limit",
|
||||
"__vModel__":"price_lower_limit",
|
||||
"disabled":false,
|
||||
"id":"price_lower_limit",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"resizable":true,
|
||||
"max":null,
|
||||
"fullName":"单价下限",
|
||||
"label":"单价下限",
|
||||
"sortable":false,
|
||||
"thousands":false,
|
||||
"addonAfter":"",
|
||||
"width":null,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"controls":false,
|
||||
"precision":2,
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"isAmountChinese":false,
|
||||
"__config__":{
|
||||
"formId":"formItemb6f93e",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"单价上限",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1778463673987,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"prop":"price_upper_limit",
|
||||
"__vModel__":"price_upper_limit",
|
||||
"disabled":false,
|
||||
"id":"price_upper_limit",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"resizable":true,
|
||||
"max":null,
|
||||
"fullName":"单价上限",
|
||||
"label":"单价上限",
|
||||
"sortable":false,
|
||||
"thousands":false,
|
||||
"addonAfter":"",
|
||||
"width":null,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"controls":false,
|
||||
"precision":2,
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"align":"left",
|
||||
"isAmountChinese":false,
|
||||
"__config__":{
|
||||
"formId":"formItem294dfe",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"排序号",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1778463713454,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"prop":"seq_num",
|
||||
"__vModel__":"seq_num",
|
||||
"disabled":false,
|
||||
"id":"seq_num",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"resizable":true,
|
||||
"max":null,
|
||||
"fullName":"排序号",
|
||||
"label":"排序号",
|
||||
"sortable":false,
|
||||
"thousands":false,
|
||||
"addonAfter":"",
|
||||
"width":null,
|
||||
"fixed":"none",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"labelI18nCode":""
|
||||
}
|
||||
]
|
||||
export default columnList
|
||||
141
src/views/mdm/worktype/helper/searchList.ts
Normal file
141
src/views/mdm/worktype/helper/searchList.ts
Normal file
@@ -0,0 +1,141 @@
|
||||
const searchList = [
|
||||
{
|
||||
"yunzhupaasKey":"input",
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem120e88",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"defaultValue":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"工种名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777345895532,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"unique":false,
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":false,
|
||||
"prop":"work_type_name",
|
||||
"__vModel__":"work_type_name",
|
||||
"searchMultiple":false,
|
||||
"disabled":false,
|
||||
"id":"work_type_name",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
},
|
||||
"clearable":true,
|
||||
"searchType":2,
|
||||
"maxlength":20,
|
||||
"fullName":"工种名称",
|
||||
"label":"工种名称",
|
||||
"addonAfter":"",
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"isKeyword":false,
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"prefixIcon":"",
|
||||
"labelI18nCode":""
|
||||
},
|
||||
{
|
||||
"yunzhupaasKey":"select",
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"searchType":1,
|
||||
"multiple":false,
|
||||
"fullName":"工种分类",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"label":"工种分类",
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777346352365,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItema4f72a",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dictionary",
|
||||
"dictionaryType":"workCategory",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"工种分类",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"prop":"work_category_id",
|
||||
"options":[],
|
||||
"__vModel__":"work_category_id",
|
||||
"searchMultiple":true,
|
||||
"isKeyword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"work_category_id",
|
||||
"placeholder":"请选择",
|
||||
"labelI18nCode":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default searchList
|
||||
620
src/views/mdm/worktype/helper/superQueryJson.ts
Normal file
620
src/views/mdm/worktype/helper/superQueryJson.ts
Normal file
@@ -0,0 +1,620 @@
|
||||
const superQueryJson = [
|
||||
{
|
||||
"__config__":{
|
||||
"formId":"formItemec5a15",
|
||||
"yunzhupaasKey":"billRule",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"rule":"workTypeCode",
|
||||
"className":[],
|
||||
"label":"工种编码",
|
||||
"trigger":"change",
|
||||
"ruleConfig":{
|
||||
"startNumber":"",
|
||||
"dateFormat":"YYYY",
|
||||
"randomDigit":16,
|
||||
"prefixList":[],
|
||||
"randomType":1,
|
||||
"suffixList":[],
|
||||
"type":1,
|
||||
"digit":null
|
||||
},
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777345780019,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-documents",
|
||||
"ruleType":1,
|
||||
"ruleName":"工种编码",
|
||||
"tag":"YunzhupaasInput",
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":true,
|
||||
"__vModel__":"work_type_code",
|
||||
"fullName":"工种编码",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"id":"work_type_code",
|
||||
"placeholder":"系统自动生成"
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":20,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"工种名称",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem120e88",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"defaultValue":"",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"工种名称",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777345895532,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"unique":false,
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"work_type_name",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"work_type_name",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"工种分类",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777346352365,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItema4f72a",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dictionary",
|
||||
"dictionaryType":"workCategory",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"工种分类",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"options":[],
|
||||
"__vModel__":"work_category_id",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"work_category_id",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"filterable":false,
|
||||
"clearable":true,
|
||||
"multiple":false,
|
||||
"fullName":"技能等级",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"props":{
|
||||
"label":"fullName",
|
||||
"value":"id"
|
||||
},
|
||||
"__config__":{
|
||||
"yunzhupaasKey":"select",
|
||||
"defaultValue":"",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"propsUrl":"",
|
||||
"templateJson":[],
|
||||
"showLabel":true,
|
||||
"required":true,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777347095610,
|
||||
"tagIcon":"icon-ym icon-ym-generator-select",
|
||||
"tag":"YunzhupaasSelect",
|
||||
"formId":"formItem03ef8d",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"dataType":"dictionary",
|
||||
"dictionaryType":"skillLevel",
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"label":"技能等级",
|
||||
"trigger":"change",
|
||||
"layout":"colFormItem",
|
||||
"useCache":true,
|
||||
"propsName":"",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"options":[],
|
||||
"__vModel__":"skill_level",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"skill_level",
|
||||
"placeholder":"请选择",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":20,
|
||||
"useScan":false,
|
||||
"suffixIcon":"",
|
||||
"fullName":"计价单位",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"addonAfter":"",
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItemec96d9",
|
||||
"yunzhupaasKey":"input",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"计价单位",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777347663137,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-input",
|
||||
"tag":"YunzhupaasInput",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"readonly":false,
|
||||
"maskConfig":{
|
||||
"prefixType":1,
|
||||
"useUnrealMask":false,
|
||||
"maskType":1,
|
||||
"unrealMaskLength":1,
|
||||
"prefixLimit":0,
|
||||
"suffixLimit":0,
|
||||
"filler":"*",
|
||||
"prefixSpecifyChar":"",
|
||||
"suffixType":1,
|
||||
"ignoreChar":"",
|
||||
"suffixSpecifyChar":""
|
||||
},
|
||||
"__vModel__":"unit",
|
||||
"useMask":false,
|
||||
"showPassword":false,
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"unit",
|
||||
"placeholder":"请输入",
|
||||
"prefixIcon":"",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"controls":false,
|
||||
"max":null,
|
||||
"precision":2,
|
||||
"fullName":"参考单价",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItem21ecc7",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"参考单价",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777347687893,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"__vModel__":"reference_unit_price",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"reference_unit_price",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"controls":false,
|
||||
"max":null,
|
||||
"precision":2,
|
||||
"fullName":"单价下限",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItemb89c51",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"单价下限",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1778463666421,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"__vModel__":"price_lower_limit",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"price_lower_limit",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"controls":false,
|
||||
"max":null,
|
||||
"precision":2,
|
||||
"fullName":"单价上限",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItemb6f93e",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"单价上限",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1778463673987,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"__vModel__":"price_upper_limit",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"price_upper_limit",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"controls":false,
|
||||
"max":null,
|
||||
"precision":2,
|
||||
"fullName":"排序号",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"thousands":false,
|
||||
"isAmountChinese":false,
|
||||
"addonAfter":"",
|
||||
"__config__":{
|
||||
"formId":"formItem294dfe",
|
||||
"yunzhupaasKey":"inputNumber",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"defaultValue":null,
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"排序号",
|
||||
"trigger":[
|
||||
"blur",
|
||||
"change"
|
||||
],
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1778463713454,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-number",
|
||||
"tag":"YunzhupaasInputNumber",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":12
|
||||
},
|
||||
"min":0,
|
||||
"__vModel__":"seq_num",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"step":1,
|
||||
"disabled":false,
|
||||
"id":"seq_num",
|
||||
"placeholder":"请输入",
|
||||
"addonBefore":"",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":255,
|
||||
"fullName":"工种描述",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"autoSize":{
|
||||
"minRows":2,
|
||||
"maxRows":2
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItema2c991",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"工种描述",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1777347940332,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"__vModel__":"work_description",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"work_description",
|
||||
"placeholder":"请输入",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"clearable":true,
|
||||
"maxlength":255,
|
||||
"fullName":"备注",
|
||||
"fullNameI18nCode":[
|
||||
""
|
||||
],
|
||||
"autoSize":{
|
||||
"minRows":2,
|
||||
"maxRows":2
|
||||
},
|
||||
"showCount":false,
|
||||
"__config__":{
|
||||
"formId":"formItem055641",
|
||||
"yunzhupaasKey":"textarea",
|
||||
"visibility":[
|
||||
"pc",
|
||||
"app"
|
||||
],
|
||||
"noShow":false,
|
||||
"tipLabel":"",
|
||||
"tableFixed":"none",
|
||||
"dragDisabled":false,
|
||||
"className":[],
|
||||
"label":"备注",
|
||||
"trigger":"blur",
|
||||
"showLabel":true,
|
||||
"required":false,
|
||||
"tableName":"mdm_work_type",
|
||||
"renderKey":1778463723841,
|
||||
"layout":"colFormItem",
|
||||
"tagIcon":"icon-ym icon-ym-generator-textarea",
|
||||
"tag":"YunzhupaasTextarea",
|
||||
"regList":[],
|
||||
"tableAlign":"left",
|
||||
"span":24
|
||||
},
|
||||
"readonly":false,
|
||||
"__vModel__":"remarks",
|
||||
"style":{
|
||||
"width":"100%"
|
||||
},
|
||||
"disabled":false,
|
||||
"id":"remarks",
|
||||
"placeholder":"请输入",
|
||||
"on":{
|
||||
"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}",
|
||||
"blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default superQueryJson
|
||||
675
src/views/mdm/worktype/index.vue
Normal file
675
src/views/mdm/worktype/index.vue
Normal file
@@ -0,0 +1,675 @@
|
||||
<template>
|
||||
<div class="yunzhupaas-content-wrapper">
|
||||
<div class="yunzhupaas-content-wrapper-center">
|
||||
<div class="yunzhupaas-content-wrapper-search-box" v-if="getSearchList.length">
|
||||
<BasicForm @register="registerSearchForm" :schemas="getSearchList"
|
||||
@advanced-change="redoHeight" @submit="handleSearchSubmit" @reset="handleSearchReset"
|
||||
class="search-form">
|
||||
</BasicForm>
|
||||
</div>
|
||||
<div class="yunzhupaas-content-wrapper-content bg-white">
|
||||
<BasicTable @register="registerTable" v-bind="getTableBindValue" ref="tableRef"
|
||||
@columns-change="handleColumnChange">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" v-auth="'btn_add'"
|
||||
@click="addHandle()"> {{t('common.add2Text','新增')}}</a-button>
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-download" v-auth="'btn_download'"
|
||||
@click="openExportModal(true, { columnList: state.exportList, selectIds: getSelectRowKeys(), showExportSelected: true })"> {{t('common.exportText','导出')}}</a-button>
|
||||
<a-button type="link" preIcon="icon-ym icon-ym-btn-upload" v-auth="'btn_upload'"
|
||||
@click="openImportModal(true, { url: '2/WorkType', menuId: searchInfo.menuId })"> {{t('common.importText','导入')}}</a-button>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-tooltip placement="top">
|
||||
<template #title>
|
||||
<span>{{ t('common.superQuery') }}</span>
|
||||
</template>
|
||||
<filter-outlined @click="openSuperQuery(true, { columnOptions: superQueryJson })" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #toolbarAfter>
|
||||
<ViewList :menuId="route.meta.modelId" :viewList="viewList" @itemClick="handleViewClick" @reload="initViewList" />
|
||||
<ViewSetting :menuId="route.meta.modelId" :viewList="viewList" :currentView="currentView" @reload="initViewList" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-for="(item, index) in childColumnList" v-if="childColumnList.length">
|
||||
<template
|
||||
v-if="column?.id?.includes('-') && item.children && item.children[0] && column.key === item.children[0]?.dataIndex">
|
||||
<ChildTableColumn :data="record[item.prop]" :head="item.children"
|
||||
@toggleExpand="toggleExpand(record, item.prop+`Expand`)" @toDetail="toDetail"
|
||||
:expand="record[item.prop+`Expand`]" :key="index" :showOverflow="true "/>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="!(record.top || column.id?.includes('-'))">
|
||||
<template v-if="column.yunzhupaasKey === 'relationForm'">
|
||||
<p class="link-text"
|
||||
@click="toDetail(column.modelId, record[column.dataIndex+`_id`], column.propsValue)">
|
||||
{{ record[column.dataIndex] }}</p>
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'inputNumber'">
|
||||
<yunzhupaas-input-number v-model:value="record[column.prop]" :precision="column.precision" :thousands="column.thousands" disabled detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'calculate'">
|
||||
<yunzhupaas-calculate
|
||||
v-model:value="record[column.prop]"
|
||||
:isStorage="column.isStorage"
|
||||
:precision="column.precision"
|
||||
:thousands="column.thousands"
|
||||
detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'sign'">
|
||||
<yunzhupaas-sign v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'signature'">
|
||||
<yunzhupaas-signature v-model:value="record[column.prop]" detailed />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'rate'">
|
||||
<yunzhupaas-rate v-model:value="record[column.prop]" :count="column.count" :allowHalf="column.allowHalf" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'slider'">
|
||||
<yunzhupaas-slider v-model:value="record[column.prop]" :min="column.min" :max="column.max" :step="column.step" disabled />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadImg'">
|
||||
<yunzhupaas-upload-img v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'uploadFile'">
|
||||
<yunzhupaas-upload-file v-model:value="record[column.prop]" disabled detailed simple v-if="record[column.prop]?.length" />
|
||||
</template>
|
||||
<template v-if="column.yunzhupaasKey === 'input'">
|
||||
<yunzhupaas-input
|
||||
v-model:value="record[column.prop]"
|
||||
:useMask="column.useMask"
|
||||
:maskConfig="column.maskConfig"
|
||||
:showOverflow="true"
|
||||
detailed />
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'action' && !record.top">
|
||||
<TableAction :actions="getTableActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
<Form ref="formRef" @reload="reload" />
|
||||
<Detail ref="detailRef" />
|
||||
<ExportModal @register="registerExportModal" @download="handleDownload" />
|
||||
<ImportModal @register="registerImportModal" @reload="reload" />
|
||||
<PrintSelect @register="registerPrintSelect" @change="handleShowBrowse" />
|
||||
<PrintBrowse @register="registerPrintBrowse" />
|
||||
<RelationDetail ref="relationDetailRef" />
|
||||
<SuperQueryModal @register="registerSuperQueryModal" @superQuery="handleSuperQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { getList, del, exportData, batchDelete } from './helper/api';
|
||||
import { getConfigData,getViewList } from '@/api/onlineDev/visualDev';
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
|
||||
import { getOrgByOrganizeCondition,getDepartmentSelectAsyncList } from '@/api/permission/organize';
|
||||
import { ref, reactive, onMounted, toRefs, computed, unref, nextTick, toRaw, provide } from 'vue';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useI18n } from '@/hooks/web/useI18n';
|
||||
import { useOrganizeStore } from '@/store/modules/organize';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { usePopup } from '@/components/Popup';
|
||||
import { ScrollContainer } from '@/components/Container';
|
||||
import { BasicLeftTree, TreeActionType } from '@/components/Tree';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { BasicTable, useTable, TableAction, ActionItem, TableActionType, SorterResult } from '@/components/Table';
|
||||
import { SuperQueryModal } from '@/components/CommonModal';
|
||||
import Form from './Form.vue';
|
||||
import Detail from './Detail.vue';
|
||||
// 有关联表单详情:开始
|
||||
import RelationDetail from '@/views/common/dynamicModel/list/detail/index.vue';
|
||||
// 有关联表单详情:结束
|
||||
import ChildTableColumn from '@/views/common/dynamicModel/list/ChildTableColumn.vue';
|
||||
import { ExportModal } from '@/components/CommonModal';
|
||||
import { downloadByUrl } from '@/utils/file/download';
|
||||
import { ImportModal} from '@/components/CommonModal';
|
||||
// 打印模板多条生成PrintSelect
|
||||
import PrintSelect from '@/components/PrintDesign/printSelect/index.vue';
|
||||
import PrintBrowse from '@/components/PrintDesign/printBrowse/index.vue';
|
||||
import { useRoute,useRouter } from 'vue-router';
|
||||
import { FilterOutlined } from '@ant-design/icons-vue';
|
||||
import { getSearchFormSchemas } from '@/components/FormGenerator/src/helper/transform';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import columnList from './helper/columnList';
|
||||
import searchList from './helper/searchList';
|
||||
import superQueryJson from './helper/superQueryJson';
|
||||
import { dyOptionsList, systemComponentsList } from '@/components/FormGenerator/src/helper/config';
|
||||
import { thousandsFormat, getParamList} from '@/utils/yunzhupaas';
|
||||
import { usePermission } from '@/hooks/web/usePermission';
|
||||
|
||||
import ViewSetting from '@/views/common/dynamicModel/list/components/ViewSetting.vue';
|
||||
import ViewList from '@/views/common/dynamicModel/list/components/ViewList.vue';
|
||||
|
||||
interface State {
|
||||
config: any;
|
||||
columnList: any[];
|
||||
printListOptions: any[];
|
||||
columnBtnsList: any[];
|
||||
customBtnsList: any[];
|
||||
treeFieldNames: any;
|
||||
leftTreeData: any[];
|
||||
leftTreeLoading: boolean;
|
||||
treeActiveId: string;
|
||||
treeActiveNodePath: any;
|
||||
columns: any[];
|
||||
complexColumns: any[];
|
||||
childColumnList: any[];
|
||||
exportList: any[];
|
||||
cacheList: any[];
|
||||
currFlow: any;
|
||||
isCustomCopy: boolean;
|
||||
candidateType: number;
|
||||
currRow: any;
|
||||
workFlowFormData: any;
|
||||
expandObj: any;
|
||||
columnSettingList: any[];
|
||||
searchSchemas: any[];
|
||||
treeRelationObj: any;
|
||||
treeQueryJson: any;
|
||||
leftTreeActiveInfo: any;
|
||||
keyword: string;
|
||||
viewList: any[];
|
||||
currentView: any;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const { hasBtnP } = usePermission();
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const organizeStore = useOrganizeStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const [registerExportModal, { openModal: openExportModal, closeModal: closeExportModal, setModalProps: setExportModalProps }] = useModal();
|
||||
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||
const [registerSuperQueryModal, { openModal: openSuperQuery }] = useModal();
|
||||
const formRef = ref<any>(null);
|
||||
const tableRef = ref<Nullable<TableActionType>>(null);
|
||||
const detailRef = ref<any>(null);
|
||||
const relationDetailRef = ref<any>(null);
|
||||
|
||||
const state = reactive<State>({
|
||||
config: {},
|
||||
columnList: [],
|
||||
printListOptions: [],
|
||||
columnBtnsList: [],
|
||||
customBtnsList: [],
|
||||
treeFieldNames: {
|
||||
children: 'children' ,
|
||||
title: 'fullName' ,
|
||||
key: 'enCode' ,
|
||||
isLeaf: 'isLeaf',
|
||||
},
|
||||
leftTreeData: [],
|
||||
leftTreeLoading: false,
|
||||
treeActiveId: '',
|
||||
treeActiveNodePath: [],
|
||||
columns: [],
|
||||
complexColumns: [], // 复杂表头
|
||||
childColumnList: [],
|
||||
exportList: [],
|
||||
cacheList: [],
|
||||
currFlow: {},
|
||||
isCustomCopy: false,
|
||||
candidateType: 1,
|
||||
currRow: {},
|
||||
workFlowFormData: {},
|
||||
expandObj: {},
|
||||
columnSettingList: [],
|
||||
searchSchemas: [],
|
||||
treeRelationObj: null,
|
||||
treeQueryJson: {},
|
||||
leftTreeActiveInfo: {},
|
||||
keyword: '',
|
||||
viewList: [],
|
||||
currentView: {},
|
||||
});
|
||||
const defaultSearchInfo = {
|
||||
menuId: route.meta.modelId as string,
|
||||
moduleId:'823446652726543365',
|
||||
superQueryJson: '',
|
||||
dataType:0,
|
||||
};
|
||||
const searchInfo = reactive({
|
||||
...cloneDeep(defaultSearchInfo),
|
||||
});
|
||||
const { childColumnList, searchSchemas, viewList, currentView} = toRefs(state);
|
||||
const [registerSearchForm, { updateSchema, resetFields, submit: searchFormSubmit, setFieldsValue}] = useForm({
|
||||
baseColProps: { span: 6 },
|
||||
showActionButtonGroup: true,
|
||||
showAdvancedButton: true,
|
||||
compact: true,
|
||||
});
|
||||
const [registerTable, { reload, setLoading, getFetchParams, getSelectRows, getSelectRowKeys, redoHeight,clearSelectedRowKeys }] = useTable({
|
||||
api: getList,
|
||||
immediate: false,
|
||||
clickToRowSelect: false,
|
||||
tableSetting: { setting: false },
|
||||
afterFetch: (data) => {
|
||||
const list = data.map((o) => ({
|
||||
...o,
|
||||
...state.expandObj,
|
||||
}));
|
||||
state.cacheList = cloneDeep(list);
|
||||
return list;
|
||||
},
|
||||
});
|
||||
const [registerChildTable] = useTable({
|
||||
pagination: false,
|
||||
canResize: false,
|
||||
showTableSetting: false,
|
||||
});
|
||||
|
||||
provide('getLeftTreeActiveInfo', () => state.leftTreeActiveInfo);
|
||||
|
||||
const getHasBatchBtn = computed(() => {
|
||||
let btnsList =[]
|
||||
btnsList.push('download')
|
||||
btnsList=btnsList.filter(o => hasBtnP('btn_' + o))
|
||||
return !!btnsList.length
|
||||
});
|
||||
|
||||
|
||||
const getColumns = computed(() => {
|
||||
const columns = state.complexColumns;
|
||||
return setListValue(state.currentView?.columnList, columns, 'prop');
|
||||
});
|
||||
const getSearchList = computed(() => {
|
||||
const searchSchemas = cloneDeep(state.searchSchemas).map(o => ({ ...o, show: true }));
|
||||
return setListValue(state.currentView?.searchList, searchSchemas, 'field');
|
||||
});
|
||||
const getTableBindValue = computed(() => {
|
||||
let columns = unref(getColumns);
|
||||
const defaultSortConfig=[{"field":"seq_num","sort":"asc","id":"sortce80fc"}];
|
||||
const sortField = defaultSortConfig.map(o => (o.sort === 'desc' ? '-' : '') + o.field);
|
||||
const data: any = {
|
||||
pagination: { pageSize: 20 }, //有分页
|
||||
searchInfo: unref(searchInfo),
|
||||
defSort: { sidx: sortField.join(',') },
|
||||
sortFn: (sortInfo: SorterResult | SorterResult[]) => {
|
||||
if (Array.isArray(sortInfo)) {
|
||||
const sortList = sortInfo.map(o => (o.order === 'descend' ? '-' : '') + o.field);
|
||||
return { sidx: sortList.join(',') };
|
||||
} else {
|
||||
const { field, order } = sortInfo;
|
||||
if (field && order) {
|
||||
// 排序字段
|
||||
return { sidx: (order === 'descend' ? '-' : '') + field };
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
ellipsis:true ,
|
||||
columns,
|
||||
bordered: true,
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
title: t('component.table.action'),
|
||||
dataIndex: 'action',
|
||||
},
|
||||
};
|
||||
if (unref(getHasBatchBtn)) {
|
||||
const rowSelection: any = { type: 'checkbox' };
|
||||
data.rowSelection = rowSelection;
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
function init() {
|
||||
state.config = {};
|
||||
searchInfo.menuId = route.meta.modelId as string;
|
||||
state.columnList = columnList;
|
||||
setLoading(true);
|
||||
getSearchSchemas();
|
||||
getColumnList();
|
||||
initViewList();
|
||||
nextTick(() => {
|
||||
unref(getSearchList)?.length ? searchFormSubmit() : reload({ page: 1 });
|
||||
});
|
||||
}
|
||||
function getSearchSchemas() {
|
||||
|
||||
const schemas = getSearchFormSchemas(searchList);
|
||||
state.searchSchemas = schemas;
|
||||
schemas.forEach((cur) => {
|
||||
const config = cur.__config__;
|
||||
if (dyOptionsList.includes(config.yunzhupaasKey)) {
|
||||
if (config.dataType === 'dictionary') {
|
||||
if (!config.dictionaryType) return;
|
||||
getDictionaryDataSelector(config.dictionaryType).then((res) => {
|
||||
updateSchema([{ field: cur.field, componentProps: { options: res.data.list } }]);
|
||||
});
|
||||
}
|
||||
if (config.dataType === 'dynamic') {
|
||||
if (!config.propsUrl) return;
|
||||
const query = { paramList: getParamList(config.templateJson) };
|
||||
getDataInterfaceRes(config.propsUrl, query).then((res) => {
|
||||
const data = Array.isArray(res.data) ? res.data : [];
|
||||
updateSchema([{ field: cur.field, componentProps: { options: data } }]);
|
||||
});
|
||||
}
|
||||
}
|
||||
cur.defaultValue = cur.value;
|
||||
});
|
||||
}
|
||||
function getColumnList() {
|
||||
// 没有开启列表权限
|
||||
let columnList = state.columnList;
|
||||
state.exportList = columnList;
|
||||
let columns = columnList.map((o) => ({
|
||||
...o,
|
||||
title: o.labelI18nCode ? t(o.labelI18nCode, o.label) : o.label,
|
||||
dataIndex: o.prop,
|
||||
align: o.align,
|
||||
fixed: o.fixed == 'none' ? false : o.fixed,
|
||||
sorter: o.sortable ? { multiple: 1 } : o.sortable,
|
||||
width: o.width || 100,
|
||||
}));
|
||||
//添加复杂表头
|
||||
columns = getComplexColumns(columns);
|
||||
state.columns = columns.filter((o) => o.prop.indexOf('-') < 0);
|
||||
//子表表头
|
||||
getChildComplexColumns(columns);
|
||||
}
|
||||
|
||||
|
||||
//复杂表头
|
||||
function getComplexColumns(columns) {
|
||||
//这里生成复杂表头的配置
|
||||
let complexHeaderList: any[] = [];
|
||||
if (!complexHeaderList.length) return columns;
|
||||
let childColumns: any[] = [];
|
||||
let firstChildColumns: string[] = [];
|
||||
for (let i = 0; i < complexHeaderList.length; i++) {
|
||||
const e = complexHeaderList[i];
|
||||
e.label = e.fullName;
|
||||
e.labelI18nCode = e.fullNameI18nCode;
|
||||
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
|
||||
e.align = e.align;
|
||||
e.dataIndex = e.id;
|
||||
e.prop = e.id;
|
||||
e.children = [];
|
||||
e.yunzhupaasKey = 'complexHeader';
|
||||
if (e.childColumns?.length) {
|
||||
childColumns.push(...e.childColumns);
|
||||
for (let k = 0; k < e.childColumns.length; k++) {
|
||||
const item = e.childColumns[k];
|
||||
for (let j = 0; j < columns.length; j++) {
|
||||
const o = columns[j];
|
||||
if (o.prop == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.children.length) firstChildColumns.push(e.children[0].prop);
|
||||
}
|
||||
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
const e = columns[i];
|
||||
if (!childColumns.includes(e.prop)) {
|
||||
list.push(e);
|
||||
} else {
|
||||
if (firstChildColumns.includes(e.prop)) {
|
||||
const item = complexHeaderList.find(o => o.childColumns.includes(e.prop));
|
||||
list.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//子表表头
|
||||
function getChildComplexColumns(columnList) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i];
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e);
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0];
|
||||
let vModel = e.prop.split('-')[1];
|
||||
let label = e.label.split('-')[0];
|
||||
let childLabel = e.label.replace(label + '-', '');
|
||||
if (e.fullNameI18nCode && Array.isArray(e.fullNameI18nCode) && e.fullNameI18nCode[0]) label = t(e.fullNameI18nCode[0], label);
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
yunzhupaasKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
title: label,
|
||||
dataIndex: prop,
|
||||
children: [],
|
||||
};
|
||||
e.dataIndex = vModel;
|
||||
e.title = e.labelI18nCode ? t(e.labelI18nCode, childLabel) : childLabel;
|
||||
if (!state.expandObj.hasOwnProperty(prop+`Expand`)) state.expandObj[prop+`Expand`] = false;
|
||||
if (!list.some((o) => o.prop === prop)) list.push(newItem);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 行内分组展示
|
||||
getMergeList(list);
|
||||
|
||||
state.complexColumns = list;
|
||||
state.childColumnList = list.filter((o) => o.yunzhupaasKey === 'table');
|
||||
|
||||
// 子表分组展示宽度取100
|
||||
for (let i = 0; i < state.childColumnList.length; i++) {
|
||||
const e = state.childColumnList[i];
|
||||
if (e.children?.length) e.children = e.children.map(o => ({ ...o, width: 100 }));
|
||||
}
|
||||
}
|
||||
function getMergeList(list) {
|
||||
list.forEach((item) => {
|
||||
if (item.yunzhupaasKey === 'table' && item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
child.customCell = () => ({
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
class: 'child-table-box',
|
||||
});
|
||||
} else {
|
||||
child.customCell = () => ({
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleExpand(row, field) {
|
||||
row[field] = !row[field];
|
||||
}
|
||||
// 关联表单查看详情
|
||||
function toDetail(modelId, id, propsValue) {
|
||||
if (!id) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
const formConf = JSON.parse(res.data.formData);
|
||||
formConf.popupType = 'general';
|
||||
formConf.hasPrintBtn = false;
|
||||
formConf.customBtns = [];
|
||||
const data = { id, formConf, modelId, propsValue};
|
||||
relationDetailRef.value?.init(data);
|
||||
});
|
||||
}
|
||||
function handleColumnChange(data) {
|
||||
state.columnSettingList = data;
|
||||
}
|
||||
function getTableActions(record): ActionItem[] {
|
||||
return [
|
||||
{
|
||||
label: t('common.editText','编辑') ,
|
||||
onClick: updateHandle.bind(null, record),
|
||||
auth: 'btn_edit', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.delText','删除') ,
|
||||
color: 'error',
|
||||
modelConfirm: {
|
||||
onOk: handleDelete.bind(null, record.id),
|
||||
},
|
||||
auth: 'btn_remove', //有按钮权限
|
||||
},
|
||||
{
|
||||
label: t('common.detailText','详情') ,
|
||||
onClick: goDetail.bind(null, record),
|
||||
auth: 'btn_detail', //有按钮权限
|
||||
},
|
||||
];
|
||||
}
|
||||
// 编辑
|
||||
function updateHandle(record) {
|
||||
// 不带工作流
|
||||
const data = {
|
||||
id: record.id,
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 删除
|
||||
function handleDelete(id) {
|
||||
const query={ids:[id] }
|
||||
batchDelete(query).then((res) => {
|
||||
createMessage.success(res.msg);
|
||||
clearSelectedRowKeys();
|
||||
reload();
|
||||
});
|
||||
}
|
||||
// 查看详情
|
||||
function goDetail(record) {
|
||||
// 不带流程
|
||||
const data = {
|
||||
id: record.id,
|
||||
};
|
||||
detailRef.value?.init(data);
|
||||
}
|
||||
// 新增
|
||||
function addHandle() {
|
||||
// 不带流程新增
|
||||
const data = {
|
||||
id: '',
|
||||
menuId: searchInfo.menuId,
|
||||
allList: state.cacheList,
|
||||
};
|
||||
formRef.value?.init(data);
|
||||
}
|
||||
// 导出
|
||||
function handleDownload(data) {
|
||||
let query = { ...getFetchParams(), ...data };
|
||||
exportData(query)
|
||||
.then((res) => {
|
||||
setExportModalProps({ confirmLoading: false });
|
||||
if (!res.data.url) return;
|
||||
downloadByUrl({ url: res.data.url });
|
||||
closeExportModal();
|
||||
})
|
||||
.catch(() => {
|
||||
setExportModalProps({ confirmLoading: false });
|
||||
});
|
||||
}
|
||||
// 高级查询
|
||||
function handleSuperQuery(superQueryJson) {
|
||||
searchInfo.superQueryJson = superQueryJson;
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function handleSearchReset() {
|
||||
clearSelectedRowKeys();
|
||||
if (!state.resetFromTree) updateSearchFormValue();
|
||||
if (state.resetFromTree) state.resetFromTree = false;
|
||||
}
|
||||
|
||||
function handleSearchSubmit(data) {
|
||||
clearSelectedRowKeys();
|
||||
let obj = {
|
||||
...defaultSearchInfo,
|
||||
superQueryJson: searchInfo.superQueryJson,
|
||||
...data,
|
||||
};
|
||||
Object.keys(searchInfo).map(key => {
|
||||
delete searchInfo[key];
|
||||
});
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
searchInfo[key.replaceAll('-', '_')] = value;
|
||||
}
|
||||
console.log(searchInfo);
|
||||
reload({ page: 1 });
|
||||
}
|
||||
|
||||
function updateSearchFormValue() {
|
||||
if (!state.treeActiveId) return searchFormSubmit();
|
||||
let queryJson: any = {};
|
||||
let leftTreeActiveInfo: any = {};
|
||||
const isMultiple = !state.treeRelationObj ? false : state.treeRelationObj.searchMultiple;
|
||||
//多级左侧树,需要拼父级->转为查询参数
|
||||
if (state.treeRelationObj && state.treeRelationObj.yunzhupaasKey && ['organizeSelect', 'cascader', 'areaSelect'].includes(state.treeRelationObj.yunzhupaasKey)) {
|
||||
let currValue = [];
|
||||
currValue = state.treeActiveNodePath.map(o => o[state.treeFieldNames.key]);
|
||||
queryJson = { 'asset_type': isMultiple ? [currValue] : currValue };
|
||||
leftTreeActiveInfo = { 'asset_type': state.treeRelationObj.multiple ? [currValue] : currValue };
|
||||
} else {
|
||||
queryJson = { 'asset_type': isMultiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
leftTreeActiveInfo = { 'asset_type': state.treeRelationObj.multiple ? [state.treeActiveId] : state.treeActiveId };
|
||||
}
|
||||
state.leftTreeActiveInfo = leftTreeActiveInfo;
|
||||
if(unref(getSearchList)?.length){
|
||||
// 有搜索列表
|
||||
setFieldsValue(queryJson);
|
||||
searchFormSubmit();
|
||||
}else{
|
||||
// 无搜索列表
|
||||
handleSearchSubmit(queryJson);
|
||||
}
|
||||
}
|
||||
function initViewList(currentId = '') {
|
||||
const query = {
|
||||
menuId: route.meta.modelId,
|
||||
};
|
||||
getViewList(query).then(res => {
|
||||
const columns : any[]= state.complexColumns;
|
||||
const searchList: any[] = state.searchSchemas.map(o => ({ label: o.label, id: o.field, show: o.show, labelI18nCode: o.labelI18nCode }));
|
||||
const columnList: any[] = columns.map(o => ({ label: o.label, id: o.prop, show: true, fixed: o.fixed || 'none', labelI18nCode: o.labelI18nCode }));
|
||||
state.viewList = (res.data || []).map(o => {
|
||||
if (o.type == 0) return { ...o, searchList, columnList };
|
||||
return { ...o, searchList: o.searchList ? JSON.parse(o.searchList) : [], columnList: o.columnList ? JSON.parse(o.columnList) : [] };
|
||||
});
|
||||
if (currentId) {
|
||||
state.currentView = state.viewList.filter(o => o.id === currentId)[0] || state.viewList[0];
|
||||
} else {
|
||||
state.currentView = state.viewList.filter(o => o.status === 1)[0] || state.viewList[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleViewClick(item) {
|
||||
state.currentView = item;
|
||||
}
|
||||
|
||||
function setListValue(data: any[] = [], defaultData: any[] = [], key) {
|
||||
let list: any[] = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
for (let j = 0; j < defaultData.length; j++) {
|
||||
if (data[i].show && data[i].id == defaultData[j][key]) list.push(defaultData[j]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
@@ -20,6 +20,7 @@
|
||||
<a-step title="命名规范" />
|
||||
</a-steps>
|
||||
<a-space class="options" :size="10">
|
||||
<a-button @click="tuofeng()">驼峰命名</a-button>
|
||||
<a-button type="primary" @click="handleSubmit()" :disabled="loading" :loading="btnLoading">{{ t('common.saveText') }}</a-button>
|
||||
<a-button @click="closeModal()">{{ t('common.closeText') }}</a-button>
|
||||
</a-space>
|
||||
@@ -124,6 +125,22 @@
|
||||
scroll: { y: unref(getScrollY) },
|
||||
};
|
||||
});
|
||||
/**
|
||||
* 下划线命名转驼峰命名
|
||||
* @param str 下划线命名字符串(如 mdm_work_type、work_type_id)
|
||||
* @param isBigHump 是否大驼峰(首字母大写),默认 false 为小驼峰
|
||||
* @returns 驼峰命名字符串
|
||||
*/
|
||||
function toHump(str: string, isBigHump = false): string {
|
||||
return str.replace(/_(\w)/g, (_, letter) => letter.toUpperCase())
|
||||
.replace(/^\w/, (firstLetter) => {
|
||||
return isBigHump ? firstLetter.toUpperCase() : firstLetter.toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
// 示例:
|
||||
// toHump('mdm_work_type') → "mdmWorkType"(小驼峰)
|
||||
// toHump('work_type_id', true) → "WorkTypeId"(大驼峰)
|
||||
const getChildTableBindValues = computed(() => {
|
||||
return {
|
||||
columns: childColumns,
|
||||
@@ -151,6 +168,30 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
// 点击触发驼峰命名(有值用原值,无值自动驼峰)
|
||||
function tuofeng() {
|
||||
state.list = state.list.map(tableItem => {
|
||||
// 处理表:有值用原值,无值转驼峰
|
||||
const tableAlias = tableItem.aliasName?.trim() || toHump(tableItem.table);
|
||||
|
||||
// 处理字段
|
||||
const newFields = tableItem.fields.map(fieldItem => {
|
||||
const fieldAlias = fieldItem.aliasName?.trim() || toHump(fieldItem.field);
|
||||
return {
|
||||
...fieldItem,
|
||||
aliasName: fieldAlias
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
...tableItem,
|
||||
aliasName: tableAlias,
|
||||
fields: newFields
|
||||
};
|
||||
});
|
||||
createMessage.success('已自动生成驼峰命名(空值才填充)');
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
state.btnLoading = true;
|
||||
changeLoading(true);
|
||||
|
||||
Reference in New Issue
Block a user