获取编号完善
parent
7a03aa1e2e
commit
218d004759
|
|
@ -27,7 +27,7 @@ export interface AccountParams {
|
|||
export interface InputCodeParams {
|
||||
lng?: string;
|
||||
lat?: string;
|
||||
prefix?: string;
|
||||
prefix?: any;
|
||||
sec_prefix?: string;
|
||||
}
|
||||
export interface SaveFormsParams {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ componentMap.set("VideoUpload",VideoUpload);
|
|||
componentMap.set("FileUpload",FileUpload);
|
||||
componentMap.set("Location",Location);
|
||||
componentMap.set("AddressDetails",AddressDetails);
|
||||
componentMap.set("InputCode",Input);
|
||||
componentMap.set('Select', Select);
|
||||
componentMap.set('ApiSelect', ApiSelect);
|
||||
componentMap.set('ApiTree', ApiTree);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
</Upload>
|
||||
<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" />
|
||||
</Modal>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</Upload>
|
||||
|
||||
<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" /> -->
|
||||
<video :src="previewImage" class="video-player" controls muted autoplay></video>
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -70,6 +70,16 @@
|
|||
@click="codeClickFunction('beforeSetData', beforeSetData )"
|
||||
@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>
|
||||
<CardGourp
|
||||
v-if="cardGroupData.length > 0"
|
||||
|
|
@ -605,6 +615,12 @@
|
|||
});
|
||||
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) {
|
||||
|
|
@ -671,8 +687,44 @@
|
|||
showActionButtonGroup: false,
|
||||
actionColOptions: {
|
||||
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() {
|
||||
try {
|
||||
|
|
@ -733,37 +785,6 @@
|
|||
query = { ...query, ...subTableDataStore.getGroupData };
|
||||
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);
|
||||
|
||||
console.log('params222', params);
|
||||
|
|
|
|||
Loading…
Reference in New Issue