获取编号完善
parent
7a03aa1e2e
commit
218d004759
|
|
@ -27,7 +27,7 @@ export interface AccountParams {
|
||||||
export interface InputCodeParams {
|
export interface InputCodeParams {
|
||||||
lng?: string;
|
lng?: string;
|
||||||
lat?: string;
|
lat?: string;
|
||||||
prefix?: string;
|
prefix?: any;
|
||||||
sec_prefix?: string;
|
sec_prefix?: string;
|
||||||
}
|
}
|
||||||
export interface SaveFormsParams {
|
export interface SaveFormsParams {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ componentMap.set("VideoUpload",VideoUpload);
|
||||||
componentMap.set("FileUpload",FileUpload);
|
componentMap.set("FileUpload",FileUpload);
|
||||||
componentMap.set("Location",Location);
|
componentMap.set("Location",Location);
|
||||||
componentMap.set("AddressDetails",AddressDetails);
|
componentMap.set("AddressDetails",AddressDetails);
|
||||||
|
componentMap.set("InputCode",Input);
|
||||||
componentMap.set('Select', Select);
|
componentMap.set('Select', Select);
|
||||||
componentMap.set('ApiSelect', ApiSelect);
|
componentMap.set('ApiSelect', ApiSelect);
|
||||||
componentMap.set('ApiTree', ApiTree);
|
componentMap.set('ApiTree', ApiTree);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
</div>
|
</div>
|
||||||
</Upload>
|
</Upload>
|
||||||
<Modal :open="previewOpen" title="预览" :footer="null" @cancel="handleCancel" centered draggable
|
<Modal :open="previewOpen" title="预览" :footer="null" @cancel="handleCancel" centered draggable
|
||||||
:bodyStyle="{ maxHeight: '98vh', overflowY: 'auto' }">
|
:bodyStyle="{ maxHeight: '90vh', overflowY: 'auto' }">
|
||||||
<img alt="" style="width: 100%" :src="globalImagePreviewUrl" />
|
<img alt="" style="width: 100%" :src="globalImagePreviewUrl" />
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
</Upload>
|
</Upload>
|
||||||
|
|
||||||
<Modal :open="previewOpen" title="预览" :footer="null" @cancel="handleCancel" centered draggable
|
<Modal :open="previewOpen" title="预览" :footer="null" @cancel="handleCancel" centered draggable
|
||||||
:bodyStyle="{ maxHeight: '99vh', overflowY: 'auto' }">
|
:bodyStyle="{ maxHeight: '90vh', overflowY: 'auto' }">
|
||||||
<!-- <img alt="" style="width: 100%" :src="previewImage" /> -->
|
<!-- <img alt="" style="width: 100%" :src="previewImage" /> -->
|
||||||
<video :src="previewImage" class="video-player" controls muted autoplay></video>
|
<video :src="previewImage" class="video-player" controls muted autoplay></video>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,16 @@
|
||||||
@click="codeClickFunction('beforeSetData', beforeSetData )"
|
@click="codeClickFunction('beforeSetData', beforeSetData )"
|
||||||
@change="codeClickFunction('changeDataEvent', changeDataEvent)"
|
@change="codeClickFunction('changeDataEvent', changeDataEvent)"
|
||||||
>
|
>
|
||||||
|
<template #InputCodeSlot="{ model, field }">
|
||||||
|
<a-input-search
|
||||||
|
v-model:value="model[field]"
|
||||||
|
placeholder="填报完下方内容后,点击可生成编号"
|
||||||
|
>
|
||||||
|
<template #enterButton>
|
||||||
|
<a-button type="primary" @click="getCode(field)">获取编号</a-button>
|
||||||
|
</template>
|
||||||
|
</a-input-search>
|
||||||
|
</template>
|
||||||
<template #CardGroup>
|
<template #CardGroup>
|
||||||
<CardGourp
|
<CardGourp
|
||||||
v-if="cardGroupData.length > 0"
|
v-if="cardGroupData.length > 0"
|
||||||
|
|
@ -605,6 +615,12 @@
|
||||||
});
|
});
|
||||||
console.log('addQuery', addQuery);
|
console.log('addQuery', addQuery);
|
||||||
}
|
}
|
||||||
|
formColumns.value.forEach(item =>{
|
||||||
|
if(item.component == 'InputCode'){
|
||||||
|
item.slot = "InputCodeSlot"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log('formColumns.value',formColumns.value)
|
||||||
});
|
});
|
||||||
|
|
||||||
async function tabsChange(e) {
|
async function tabsChange(e) {
|
||||||
|
|
@ -671,8 +687,44 @@
|
||||||
showActionButtonGroup: false,
|
showActionButtonGroup: false,
|
||||||
actionColOptions: {
|
actionColOptions: {
|
||||||
span: 24,
|
span: 24,
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
//获取编号
|
||||||
|
async function getCode(field) {
|
||||||
|
if(isDetail.value){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let datas = getFieldsValue()
|
||||||
|
let lngLat, jtxz, code
|
||||||
|
formColumns.value.forEach(item =>{
|
||||||
|
if(item.componentProps.fieldName == 'SpecificNature' || item.label == '具体性质'){
|
||||||
|
if(datas[item.field]){
|
||||||
|
jtxz = datas[item.field]
|
||||||
|
}else{
|
||||||
|
createMessage.warning('请选择' + item.label);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}else if(item.component == 'AddressDetails'){
|
||||||
|
if(datas[item.field]){
|
||||||
|
let address = datas[item.field]
|
||||||
|
lngLat = JSON.parse(address)[0].center
|
||||||
|
}else{
|
||||||
|
createMessage.warning('请输入详细位置');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let codetype = route.query.code
|
||||||
|
let obj = {
|
||||||
|
lng: lngLat[0],
|
||||||
|
lat: lngLat[1],
|
||||||
|
prefix: codetype,
|
||||||
|
sec_prefix: jtxz
|
||||||
|
}
|
||||||
|
let codeId = await getSequenceGen(obj);
|
||||||
|
datas[field] = codeId
|
||||||
|
setFieldsValue(datas)
|
||||||
|
}
|
||||||
//表单填写数据
|
//表单填写数据
|
||||||
async function ModalSureClick() {
|
async function ModalSureClick() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -733,37 +785,6 @@
|
||||||
query = { ...query, ...subTableDataStore.getGroupData };
|
query = { ...query, ...subTableDataStore.getGroupData };
|
||||||
console.log('query222', query);
|
console.log('query222', query);
|
||||||
|
|
||||||
let lngLat, jtxz, jtxz1, code, inputCode, address, address1
|
|
||||||
formColumns.value.forEach(item =>{
|
|
||||||
if(item.componentProps.fieldName == 'SpecificNature' || item.label == '具体性质'){
|
|
||||||
jtxz = query[item.field]
|
|
||||||
if (unref(isUpdate)){
|
|
||||||
jtxz1 = oldRecord.value[item.field]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(item.component == 'AddressDetails'){
|
|
||||||
address = query[item.field]
|
|
||||||
lngLat = JSON.parse(address)[0].center
|
|
||||||
if (unref(isUpdate)){
|
|
||||||
address1 = oldRecord.value[item.field]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(item.component == 'InputCode'){
|
|
||||||
inputCode = item.field
|
|
||||||
}
|
|
||||||
})
|
|
||||||
let codetype = route.query.code
|
|
||||||
let obj = {
|
|
||||||
lng: lngLat[0],
|
|
||||||
lat: lngLat[1],
|
|
||||||
prefix: codetype,
|
|
||||||
sec_prefix: jtxz
|
|
||||||
}
|
|
||||||
if(address != address1 || jtxz != jtxz1){
|
|
||||||
let codeId = await getSequenceGen(obj);
|
|
||||||
query[inputCode] = codeId
|
|
||||||
}
|
|
||||||
|
|
||||||
params.data = JSON.stringify(query);
|
params.data = JSON.stringify(query);
|
||||||
|
|
||||||
console.log('params222', params);
|
console.log('params222', params);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue