|
|
|
|
@ -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);
|
|
|
|
|
|