Merge branch 'main' of http://47.109.71.130:3000/attiya/ebike-ui
This commit is contained in:
commit
f414712b37
@ -357,6 +357,14 @@
|
||||
"navigationBarTitleText": "审核用户报障"
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
"root": "pages/warehouse/vehicledispatch",
|
||||
"pages": [{
|
||||
"path": "vehicledispatch",
|
||||
"style": {
|
||||
"navigationBarTitleText": "车辆调度"
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
@ -45,7 +45,8 @@
|
||||
|
||||
const data = ref({
|
||||
site: "",
|
||||
reason: ""
|
||||
reason: "",
|
||||
zoneName:""
|
||||
});
|
||||
let oUser = null;
|
||||
|
||||
@ -77,11 +78,15 @@
|
||||
location: {
|
||||
lat,
|
||||
lng
|
||||
},
|
||||
ad_info:{
|
||||
district
|
||||
}
|
||||
} = res;
|
||||
data.value = {
|
||||
...data.value,
|
||||
site: address,
|
||||
zoneName: district,
|
||||
lat,
|
||||
lng
|
||||
};
|
||||
@ -104,7 +109,8 @@
|
||||
site,
|
||||
reason,
|
||||
lat,
|
||||
lng
|
||||
lng,
|
||||
zoneName
|
||||
} = data.value;
|
||||
if(!reason){
|
||||
showModelMessage("请填写原因!");
|
||||
@ -125,7 +131,8 @@
|
||||
applyNickname: nickname,
|
||||
applyPhone: mobile,
|
||||
applyReason: reason,
|
||||
dealState: '0'
|
||||
dealState: '0',
|
||||
zoneName
|
||||
}
|
||||
uni.showLoading({
|
||||
title:"提交中"
|
||||
|
||||
@ -192,11 +192,11 @@
|
||||
const statusBarHeight = systemInfo.statusBarHeight;
|
||||
// 计算去掉状态栏后的可用区域高度
|
||||
usableHeight.value = screenHeight - statusBarHeight - 170;
|
||||
let userZone = uni.getStorageSync('userZone');
|
||||
userZone.forEach(res => {
|
||||
let userOperation = uni.getStorageSync('userOperation');
|
||||
userOperation.forEach(res => {
|
||||
let quyuemap = {
|
||||
"text": res.name,
|
||||
"value": res.id
|
||||
"text": res.regionName,
|
||||
"value": res.regionId
|
||||
};
|
||||
regindata.value.push(quyuemap);
|
||||
});
|
||||
@ -240,7 +240,7 @@
|
||||
const params = {
|
||||
"bikeCode": customFormData.value.deviceValues, //车辆编号
|
||||
"status": statusZT.value, //入库时间 例:2025-03-21
|
||||
"regionId":customFormData.reginvalue
|
||||
"reginId":customFormData.value.reginvalue
|
||||
}
|
||||
api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
<view class="popup-content" :class="{ 'popup-height': typepopup === 'left' || typepopup === 'right' }">
|
||||
<view class="padding plcrk">
|
||||
<uni-forms ref="customForm" :rules="customRules" :modelValue="customFormData">
|
||||
<uni-section title="站点" type="line">
|
||||
<uni-section v-if="statusZT==2" title="站点" type="line">
|
||||
<uni-forms-item required name="reginvalue">
|
||||
<uni-data-select v-model="customFormData.reginvalue" :localdata="regindata"
|
||||
@change="changeZT"></uni-data-select>
|
||||
@ -189,19 +189,20 @@
|
||||
// getUserRegionInfo();
|
||||
let userDefultOperation = uni.getStorageSync('userDefultOperation');
|
||||
//获取站点信息
|
||||
api.callOperateApi("ebikeRegion/getRegion?regionId="+userDefultOperation.regionId,{} ,"get").then(res=>{
|
||||
if(res.code==200){
|
||||
res.data.forEach(res => {
|
||||
let quyuemap = {
|
||||
"text": res.regionName,
|
||||
"value": res.regionId
|
||||
};
|
||||
regindata.value.push(quyuemap);
|
||||
});
|
||||
}
|
||||
})
|
||||
api.callOperateApi("ebikeRegion/getRegion?regionId=" + userDefultOperation.regionId, {}, "get").then(
|
||||
res => {
|
||||
if (res.code == 200) {
|
||||
res.data.forEach(res => {
|
||||
let quyuemap = {
|
||||
"text": res.regionName,
|
||||
"value": res.regionId
|
||||
};
|
||||
regindata.value.push(quyuemap);
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
const getUserRegionInfo = () => {
|
||||
@ -243,37 +244,78 @@
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const submit = (ref) => {
|
||||
customForm.value.validate().then(res => {
|
||||
const params = {
|
||||
"bikeCode": customFormData.value.deviceValues, //车辆编号
|
||||
"status": statusZT.value, //入库时间 例:2025-03-21
|
||||
}
|
||||
api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
popup.value.close("center")
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
searchInfo();
|
||||
} else {
|
||||
|
||||
uni.showToast({
|
||||
title: '操作失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
|
||||
if (statusZT.value == 0) { // 下架
|
||||
handleLeaveWarehouse();
|
||||
} else { // 投放
|
||||
|
||||
uni.navigateTo({
|
||||
url:"/pages/warehouse/vehicledispatch/vehicledispatch?orderId=272553556257517568"
|
||||
})
|
||||
// handleLaunch();
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err', err);
|
||||
});
|
||||
}
|
||||
|
||||
// 处理下架逻辑
|
||||
const handleLeaveWarehouse = () => {
|
||||
const params = {
|
||||
"bikeCode": customFormData.value.deviceValues, // 车辆编号
|
||||
"status": statusZT.value,
|
||||
"reginId": ""
|
||||
}
|
||||
api.callEbikeInfo("vehicleLeaveWarehouse", params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
popup.value.close("center");
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
searchInfo();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '操作失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 处理投放逻辑
|
||||
const handleLaunch = () => {
|
||||
// 在这里编写投放的具体逻辑
|
||||
console.log('投放逻辑执行');
|
||||
const params={
|
||||
"bikeCodes": customFormData.value.deviceValues, // 车辆编号
|
||||
"status": statusZT.value,
|
||||
"siteId": customFormData.value.reginvalue,
|
||||
"DispatchType":"仓库车调度"
|
||||
}
|
||||
// 例如,调用API处理投放
|
||||
api.callEbikeInfo("createWorkOrderDispatch",params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
popup.value.close("center");
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '操作失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const onPullDownRefresh = () => {
|
||||
console.log('onPullDownRefresh')
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
<template>
|
||||
|
||||
<view class="container">
|
||||
<view class="cu-btn bg-blue" @click="getInfoList">
|
||||
调度
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue';
|
||||
import * as api from '@/utils/api.js';
|
||||
import {onLoad} from '@dcloudio/uni-app';
|
||||
|
||||
const orderId=ref("");
|
||||
onLoad((options)=>{
|
||||
debugger;
|
||||
orderId.value=options.orderId;;
|
||||
})
|
||||
const getInfoList =()=>{
|
||||
debugger;
|
||||
api.callEbikeInfo("getDispatchVehicleByOrderId?orderId="+orderId.value, {}, "get").then(
|
||||
res => {
|
||||
if (res.code == 200) {
|
||||
debugger;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dispatch-container {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.dispatch-button {
|
||||
padding: 10px 20px;
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.dispatch-button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
|
||||
.loading {
|
||||
margin-top: 10px;
|
||||
font-size: 18px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.data-display {
|
||||
margin-top: 20px;
|
||||
background-color: #f4f4f4;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.error-message {
|
||||
margin-top: 10px;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
@ -71,8 +71,8 @@ const pages = [
|
||||
path: '/SysManage',
|
||||
name: '系统管理',
|
||||
children: [{
|
||||
path: '/UserTree',
|
||||
name: '用户管理',
|
||||
path: '/OrgManage',
|
||||
name: '品牌商管理',
|
||||
isMenu: true
|
||||
}
|
||||
]
|
||||
|
||||
@ -12,5 +12,6 @@ const config = {
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '5']
|
||||
}
|
||||
,imgPath:"https://attiya.fun/ebike-file/cdn-bucket/operate/"
|
||||
}
|
||||
export default config;
|
||||
|
||||
@ -49,14 +49,13 @@
|
||||
{{ record.dealState == '0' ? '未处理' : record.dealState == '1' ? '处理中' : record.dealState == '2' ? '已处理' : '' }}
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a @click="handleDeal(record)">处理</a>
|
||||
<a-space v-if="record.dealState == '0'">
|
||||
<a @click="handleDeal(record)">处理</a>
|
||||
</a-space>
|
||||
<a-space v-if="record.dealState == '1'">
|
||||
<a @click="handleDeal(record)">完成处理</a>
|
||||
</a-space>
|
||||
<a-divider type="vertical" />
|
||||
<!-- <a-divider type="vertical" /> -->
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -66,6 +65,7 @@
|
||||
v-model:open="open"
|
||||
:title="openTitle"
|
||||
@ok="handleOkModal"
|
||||
@cancel="handleCancelModal"
|
||||
width="800px"
|
||||
:maskClosable="false"
|
||||
>
|
||||
@ -78,6 +78,7 @@
|
||||
import { message } from 'ant-design-vue'
|
||||
import config from '@/utils/config.js'
|
||||
import { dataFormat } from '@/utils/tools'
|
||||
import { getCache } from '@/utils/authority';
|
||||
import BackSiteForm from '@/views/form/backsite/BackSiteForm.vue'
|
||||
const activeKey = ref('');
|
||||
|
||||
@ -92,6 +93,7 @@
|
||||
const data = ref([])
|
||||
// 查询相关
|
||||
const queryform = ref({
|
||||
regionId: '',
|
||||
state: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
@ -118,7 +120,7 @@
|
||||
// 表格列配置
|
||||
const columns = ref([
|
||||
{
|
||||
title: '编号',
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
@ -207,6 +209,9 @@
|
||||
queryparams.endTime = dataFormat(queryparams.backTime[1], 'yyyy-MM-dd HH:mm:ss');
|
||||
}
|
||||
delete queryparams.backTime;
|
||||
//获取默认区域
|
||||
const userdefultoperation = getCache('ebike-userdefultoperation');
|
||||
queryparams.regionId = userdefultoperation.regionId;
|
||||
const res = await callOrder("/ebikeUserBacksite/page", queryparams);
|
||||
spinning.value = false;
|
||||
if (res.code != 200) {
|
||||
@ -248,7 +253,7 @@
|
||||
open.value = true;
|
||||
nextTick(() => {
|
||||
if (formModel.value) {
|
||||
formModel.value.openForm({ backsiteid: record['id'] });
|
||||
formModel.value.openForm({ ...record });
|
||||
} else {
|
||||
console.log('formModel is not ready yet');
|
||||
}
|
||||
@ -259,8 +264,17 @@
|
||||
* 处理停车点申请modal确定
|
||||
*/
|
||||
const handleOkModal = () => {
|
||||
formModel.value.formSave((data => {
|
||||
formModel.value.formSave(bres => {
|
||||
open.value = false;
|
||||
}));
|
||||
if(bres){
|
||||
getData()
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
const handleCancelModal = () => {
|
||||
formModel.value.resetAll(bres => {
|
||||
if(bres) open.value = false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -51,11 +51,13 @@
|
||||
</a-button> -->
|
||||
<!-- 登录 -->
|
||||
<div class="topAvatar">
|
||||
<a>
|
||||
当前区域:{{ userdfrname }} <DownOutlined />
|
||||
</a>
|
||||
<a-divider type="vertical" />
|
||||
<UserOutlined style="margin: 0px 5px;" />
|
||||
<template v-if="userdfrname != ''">
|
||||
<a>
|
||||
当前区域:{{ userdfrname }} <DownOutlined />
|
||||
</a>
|
||||
<a-divider type="vertical" />
|
||||
<UserOutlined style="margin: 0px 5px;" />
|
||||
</template>
|
||||
<a-dropdown>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
@ -137,7 +139,9 @@ onMounted(() => {
|
||||
|
||||
//获取默认区域
|
||||
const userdefultoperation = getCache('ebike-userdefultoperation');
|
||||
userdfrname.value = userdefultoperation.regionName ? userdefultoperation.regionName : '';
|
||||
if(userdefultoperation){
|
||||
userdfrname.value = userdefultoperation.regionName ? userdefultoperation.regionName : '';
|
||||
}
|
||||
|
||||
const menus = getMenus()
|
||||
items.value = menus
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '编号',
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
|
||||
@ -145,7 +145,7 @@
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '编号',
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
|
||||
@ -164,7 +164,7 @@ let pagination = reactive({
|
||||
// 表格列配置
|
||||
const columns = ref([
|
||||
{
|
||||
title: '编号',
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '编号',
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
|
||||
158
ebike-operate/src/views/SysManage/OrgManage/index.vue
Normal file
158
ebike-operate/src/views/SysManage/OrgManage/index.vue
Normal file
@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<!-- 数据操作 -->
|
||||
<a-space style="margin-bottom: 10px">
|
||||
<a-button style="background-color: #5cc750" type="primary" class="ele-btn-icon" @click="handleAdd">
|
||||
<template #icon>
|
||||
<plus-outlined />
|
||||
</template>
|
||||
<span>新增</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
<a-table :pagination="pagination"
|
||||
@change="handleTableChange"
|
||||
bordered
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action' && record['orgId'] != '258106438092689000'">
|
||||
<a @click="handleDeal(record)">编辑</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<!-- 编辑品牌商信息 -->
|
||||
<a-modal
|
||||
v-model:open="open"
|
||||
:title="openTitle"
|
||||
@ok="handleOkModal"
|
||||
@cancel="handleCancelModal"
|
||||
width="800px"
|
||||
:maskClosable="false"
|
||||
>
|
||||
<OrgForm ref="formModel"></OrgForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { message } from 'ant-design-vue'
|
||||
import { callUser } from '@/apis/call.js'
|
||||
import config from '@/utils/config.js'
|
||||
import OrgForm from '@/views/form/orgmanage/orgform.vue'
|
||||
|
||||
const open = ref(false);
|
||||
const openTitle = ref('品牌商信息');
|
||||
const formModel = ref(null);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
dataIndex: 'index'
|
||||
},
|
||||
{
|
||||
title: '品牌商名称',
|
||||
dataIndex: 'orgName',
|
||||
key: 'orgName',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 200,
|
||||
align: 'center'
|
||||
}
|
||||
];
|
||||
// 表格行数据
|
||||
const dataSource = ref([])
|
||||
const data = ref([])
|
||||
// 查询相关
|
||||
const queryform = ref({
|
||||
pageParam: {
|
||||
pageNum: config.pageParam.pageNum,
|
||||
pageSize: config.pageParam.pageSize
|
||||
}
|
||||
})
|
||||
|
||||
//对于每页数据的管理
|
||||
let pagination = reactive({
|
||||
total: dataSource.value.length,
|
||||
current: queryform.value.pageParam.pageNum,
|
||||
pageSize: queryform.value.pageParam.pageSize,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: config.pageParam.pageSizeOptions,
|
||||
showQuickJumper: true
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
})
|
||||
|
||||
// 对每页数据显示的交互
|
||||
let handleTableChange = (pagina) => {
|
||||
pagination.current = pagina.current
|
||||
pagination.pageSize = pagina.pageSize
|
||||
queryform.value.pageParam.pageNum = pagina.current
|
||||
queryform.value.pageParam.pageSize = pagina.pageSize
|
||||
getData();
|
||||
}
|
||||
|
||||
const getData = async () => {
|
||||
callUser("/organizations/page?pageNum=" + queryform.value.pageParam.pageNum + "&pageSize=" + queryform.value.pageParam.pageSize, {},"get").then((res) => {
|
||||
if (res.code != 200) {
|
||||
message.error(res.message)
|
||||
dataSource.value = []
|
||||
data.value = []
|
||||
pagination.total = 0
|
||||
return
|
||||
}
|
||||
data.value = res.data.records
|
||||
data.value = data.value.map((item, index) => {
|
||||
index++
|
||||
return { ...item, index }
|
||||
})
|
||||
dataSource.value = data.value
|
||||
pagination.total = res.data.totalRow
|
||||
});
|
||||
}
|
||||
|
||||
const handleAdd = async () => {
|
||||
open.value = true;
|
||||
nextTick(() => {
|
||||
if (formModel.value) {
|
||||
formModel.value.openForm({});
|
||||
} else {
|
||||
console.log('formModel is not ready yet');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const handleDeal = async (record) => {
|
||||
open.value = true;
|
||||
nextTick(() => {
|
||||
if (formModel.value) {
|
||||
formModel.value.openForm({ ...record });
|
||||
} else {
|
||||
console.log('formModel is not ready yet');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理停车点申请modal确定
|
||||
*/
|
||||
const handleOkModal = () => {
|
||||
formModel.value.formSave(bres => {
|
||||
open.value = false;
|
||||
if(bres){
|
||||
getData()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const handleCancelModal = () => {
|
||||
formModel.value.resetAll(bres => {
|
||||
if(bres) open.value = false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -77,8 +77,6 @@
|
||||
:options="options"
|
||||
@map_inited="onMapInited"
|
||||
>
|
||||
<tlbs-multi-polygon v-if="polygonGeometries.length > 0" ref="polygonRef" :geometries="polygonGeometries" />
|
||||
<tlbs-multi-circle v-if="circleGeometries.length > 0" ref="circleRef" :geometries="circleGeometries" />
|
||||
</tlbs-map>
|
||||
</div>
|
||||
</a-col>
|
||||
@ -106,9 +104,9 @@
|
||||
label="备注"
|
||||
:label-col="{ span: 3 }"
|
||||
:wrapper-col="{ span: 21 }"
|
||||
name="dealNotes"
|
||||
name="dealNote"
|
||||
>
|
||||
<a-textarea v-model:value="form.dealNotes" placeholder="请输入备注"/>
|
||||
<a-textarea v-model:value="form.dealNote" placeholder="请输入备注"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -119,7 +117,9 @@
|
||||
import { ref } from 'vue'
|
||||
import { callOrder, callOperate } from '@/apis/call.js'
|
||||
import { message } from 'ant-design-vue'
|
||||
import config from '@/utils/config.js'
|
||||
import config from '@/utils/config.js'
|
||||
import { dataFormat } from '@/utils/tools'
|
||||
import { getCache } from '@/utils/authority';
|
||||
|
||||
const formRef = ref();
|
||||
const formData = () => ({
|
||||
@ -132,12 +132,13 @@
|
||||
applyPhone: "",
|
||||
applyTime: "",
|
||||
applyReason: "",
|
||||
regionId: "267781609627852800",
|
||||
regionId: "",
|
||||
regionName: "",
|
||||
dealId: "",
|
||||
dealState: "",
|
||||
dealUser: "",
|
||||
dealTime: "",
|
||||
dealNotes: ""
|
||||
dealNote: ""
|
||||
});
|
||||
const form = ref(formData());
|
||||
|
||||
@ -161,37 +162,53 @@
|
||||
};
|
||||
|
||||
const openForm = (params = {}) => {
|
||||
Object.assign(form.value, formData());
|
||||
formRef.value.resetFields();
|
||||
if (params['backsiteid']) {
|
||||
form.value.id = params['backsiteid']
|
||||
callOrder("/ebikeUserBacksite/getInfo?id="+ params['backsiteid'], {}, "get").then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data) {
|
||||
form.value = {
|
||||
id: res.data.id,
|
||||
applySource: res.data.applySource,
|
||||
applyPosition: res.data.applyPosition,
|
||||
applyLng: res.data.applyLng,
|
||||
applyLat: res.data.applyLat,
|
||||
applyNickname: res.data.applyNickname,
|
||||
applyPhone: res.data.applyPhone,
|
||||
applyTime: res.data.applyTime,
|
||||
applyReason: res.data.applyReason,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
message.error(res.message);
|
||||
}
|
||||
});
|
||||
// Object.assign(form.value, formData());
|
||||
// formRef.value.resetFields();
|
||||
form.value = {
|
||||
...formData(),
|
||||
...params,
|
||||
}
|
||||
|
||||
if(form.value.regionId != ""){
|
||||
callOperate("/ebikeRegion/getRegionInfo/" + form.value.regionId, {}, "get").then((res) => {
|
||||
form.value.dealState = params['dealState'] == '0'? '' : params['dealState']
|
||||
loadMarker();
|
||||
// if (params['id']) {
|
||||
// form.value.id = params['id']
|
||||
// callOrder("/ebikeUserBacksite/getInfo?id="+ params['id'], {}, "get").then(res => {
|
||||
// if (res.code == 200) {
|
||||
// if (res.data) {
|
||||
// form.value = {
|
||||
// ...form.value,
|
||||
// id: res.data.id,
|
||||
// applySource: res.data.applySource,
|
||||
// applyPosition: res.data.applyPosition,
|
||||
// applyLng: res.data.applyLng,
|
||||
// applyLat: res.data.applyLat,
|
||||
// applyNickname: res.data.applyNickname,
|
||||
// applyPhone: res.data.applyPhone,
|
||||
// applyTime: res.data.applyTime,
|
||||
// applyReason: res.data.applyReason,
|
||||
// };
|
||||
// loadMarker();
|
||||
// }
|
||||
// } else {
|
||||
// message.error(res.message);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// if (params['dealId']) {
|
||||
// form.value.dealId = params['dealId']
|
||||
// form.value.dealNote = params['dealNote']
|
||||
// form.value.dealState = params['dealState'] == '0'? '' : params['dealState']
|
||||
// form.value.dealTime = params['dealTime']
|
||||
// form.value.dealUser = params['dealUser']
|
||||
// }
|
||||
if(params['regionId'] != ""){
|
||||
form.value.regionId = params['regionId']
|
||||
callOperate("/ebikeRegion/getRegionInfo/" + params['regionId'], {}, "get").then((res) => {
|
||||
if (res.code != 200) {
|
||||
message.error(res.message)
|
||||
return
|
||||
}
|
||||
form.value.regionName = res.data.regionName;
|
||||
dataRegion.value = res.data;
|
||||
loadMap();
|
||||
});
|
||||
@ -200,11 +217,10 @@
|
||||
|
||||
const polygonRef = ref(null);
|
||||
const circleRef = ref(null);
|
||||
const polygonGeometries = ref([]);
|
||||
const circleGeometries = ref([]);
|
||||
const markerRef = ref(null);
|
||||
let timer = null;
|
||||
const loadMap = () => {
|
||||
if (mapRef.value && typeof(TMap) !== 'undefined') {
|
||||
if (mapRef.value && mapRef.value.map && typeof(TMap) !== 'undefined') {
|
||||
clearTimeout(timer);
|
||||
if (dataRegion.value) {
|
||||
const { regionId ,points, shapeType, radius } = dataRegion.value;
|
||||
@ -214,35 +230,63 @@
|
||||
}
|
||||
if (points) {
|
||||
if(shapeType == 1){
|
||||
// 设置圆形
|
||||
circleGeometries.value = [];
|
||||
circleGeometries.value.push({
|
||||
id: shapeId, // 圆形图形数据的标志信息
|
||||
styleId: 'circle', // 样式id
|
||||
radius: radius, // 圆形的半径
|
||||
center: new TMap.LatLng(points[0].latitude, points[0].longitude),
|
||||
properties: {
|
||||
// 圆形的属性数据
|
||||
title: 'circle',
|
||||
},
|
||||
// 初始化圆形
|
||||
if (circleRef.value) {
|
||||
circleRef.value.setMap(null); // 清除之前的圆形
|
||||
}
|
||||
circleRef.value = new TMap.MultiCircle({
|
||||
id: 'circle-layer', // 图层id
|
||||
geometries: [
|
||||
{
|
||||
id: shapeId, // 圆形图形数据的标志信息
|
||||
styleId: 'circle', // 样式id
|
||||
center: new TMap.LatLng(points[0].latitude, points[0].longitude), // 圆形的位置信息
|
||||
radius: radius, // 圆形的半径
|
||||
properties: {
|
||||
// 圆形的属性数据
|
||||
title: 'circle',
|
||||
},
|
||||
}
|
||||
]
|
||||
});
|
||||
circleRef.value.setMap(mapRef.value.map);
|
||||
// //设置视野范围
|
||||
// const mycircle = circleRef.value.getGeometryById(shapeId);
|
||||
// const boundary = TMap.geometry.computeBoundingRectangle(mycircle.paths);
|
||||
// mapRef.value.map.fitBounds(boundary,{
|
||||
// padding: 100, // 设置地图边界的内边距
|
||||
// });
|
||||
}
|
||||
else if(shapeType == 2){
|
||||
const paths = [];
|
||||
points.forEach((point) => {
|
||||
paths.push(new TMap.LatLng(point.latitude, point.longitude));
|
||||
});
|
||||
// 设置多边形
|
||||
polygonGeometries.value = [];
|
||||
polygonGeometries.value.push({
|
||||
id: shapeId, // 多边形图形数据的标志信息
|
||||
styleId: 'polygon', // 样式id
|
||||
paths, // 多边形的位置信息
|
||||
properties: {
|
||||
// 初始化多边形
|
||||
if (polygonRef.value) {
|
||||
polygonRef.value.setMap(null); // 清除之前的多边形
|
||||
}
|
||||
polygonRef.value = new TMap.MultiPolygon({
|
||||
id: 'polygon-layer', // 图层id
|
||||
geometries: [
|
||||
{
|
||||
id: shapeId, // 多边形图形数据的标志信息
|
||||
styleId: 'polygon', // 样式id
|
||||
paths, // 多边形的位置信息
|
||||
properties: {
|
||||
// 多边形的属性数据
|
||||
title: 'polygon',
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
polygonRef.value.setMap(mapRef.value.map);
|
||||
// //设置视野范围
|
||||
// const mypolygon = polygonRef.value.getGeometryById(shapeId);
|
||||
// const boundary = TMap.geometry.computeBoundingRectangle(mypolygon.paths);
|
||||
// mapRef.value.map.fitBounds(boundary,{
|
||||
// padding: 100, // 设置地图边界的内边距
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -250,33 +294,101 @@
|
||||
else
|
||||
{
|
||||
timer = setTimeout(() => {
|
||||
loadMap(dataRegion);
|
||||
loadMap();
|
||||
}, 1000)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let timer1 = null;
|
||||
const loadMarker = () => {
|
||||
if (mapRef.value && mapRef.value.map && typeof(TMap)!== 'undefined') {
|
||||
clearTimeout(timer1);
|
||||
if (form.value.applyLng && form.value.applyLat) {
|
||||
// 初始化点标记
|
||||
if (markerRef.value) {
|
||||
markerRef.value.setMap(null); // 清除之前的多边形
|
||||
}
|
||||
markerRef.value = new TMap.MultiMarker({
|
||||
id: 'marker-layer', // 图层id
|
||||
styles: {
|
||||
"marker": new TMap.MarkerStyle({
|
||||
"width": 25,
|
||||
"height": 35,
|
||||
"anchor": { x: 16, y: 32 },
|
||||
"src": config.imgPath + 'assets/map/point.png'
|
||||
})
|
||||
},
|
||||
geometries: [
|
||||
// 点标记数据数组
|
||||
{
|
||||
// 标记位置(纬度,经度,高度)
|
||||
position: new TMap.LatLng(form.value.applyLat, form.value.applyLng),
|
||||
id: 'marker' + form.value.id,
|
||||
styleId: 'marker',
|
||||
properties: {
|
||||
// 标记的属性数据
|
||||
title: '反馈位置',
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
markerRef.value.setMap(mapRef.value.map);
|
||||
//设置视野范围
|
||||
var ne = new TMap.LatLng(form.value.applyLat, form.value.applyLng);//东北角坐标
|
||||
var sw = new TMap.LatLng(form.value.applyLat, form.value.applyLng);//西南角坐标
|
||||
var latLngBounds = new TMap.LatLngBounds(sw, ne);
|
||||
mapRef.value.map.fitBounds(latLngBounds,{
|
||||
padding: 50, // 设置地图边界的内边距
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
timer1 = setTimeout(() => {
|
||||
loadMarker();
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
const formSave = (callBack) => {
|
||||
// formRef.value.validate().then(() => {
|
||||
// callOperate("/ebikeRegion/saveOperation", form.value).then(res => {
|
||||
// if (res.code != 200) {
|
||||
// message.error(res.message);
|
||||
// if (callBack) {
|
||||
// callBack(false, res);
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
// if (callBack) {
|
||||
// callBack(true, res);
|
||||
// }
|
||||
// formRef.value.resetFields()
|
||||
// })
|
||||
// }).catch(error => {
|
||||
// if (callBack) {
|
||||
// callBack(false, error);
|
||||
// }
|
||||
// });
|
||||
formRef.value.validate().then(() => {
|
||||
const userinfo = getCache('ebike-userinfo');
|
||||
const params = {
|
||||
id: form.value.dealId,
|
||||
dealUser: userinfo.username,
|
||||
dealTime: dataFormat(new Date(),'yyyy-MM-dd HH:mm:ss'),
|
||||
dealNote: form.value.dealNote,
|
||||
dealState: form.value.dealState,
|
||||
}
|
||||
callOrder("/ebikeUserBacksite/updateDeal", params).then(res => {
|
||||
if (res.code != 200) {
|
||||
message.error(res.message);
|
||||
if (callBack) {
|
||||
callBack(false, res);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (callBack) {
|
||||
callBack(true, res);
|
||||
}
|
||||
resetAll();
|
||||
})
|
||||
}).catch(error => {
|
||||
if (callBack) {
|
||||
callBack(false, error);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
defineExpose({ openForm, formSave });
|
||||
const resetAll = (callBack) => {
|
||||
Object.assign(form.value, formData());
|
||||
formRef.value.resetFields();
|
||||
if (callBack) {
|
||||
callBack(true, form.value);
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ openForm, formSave, resetAll });
|
||||
</script>
|
||||
|
||||
@ -17,7 +17,10 @@
|
||||
name="zoneId"
|
||||
:rules="[{ required: true, message: '请选择行政区划' }]"
|
||||
>
|
||||
<a-input
|
||||
<a-select v-model:value="form.zoneId" placeholder="请选择行政区划" style="width: 85%;">
|
||||
<a-select-option v-for="(item) in zoneList" :key="item.id" :value="item.zoneId">{{ item.zoneName }}</a-select-option>
|
||||
</a-select>
|
||||
<!-- <a-input
|
||||
style="display: none;"
|
||||
v-model:value="form.zoneId"
|
||||
/>
|
||||
@ -28,7 +31,7 @@
|
||||
change-on-select
|
||||
placeholder="请选择行政区划"
|
||||
@change="changeZone"
|
||||
/>
|
||||
/> -->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -111,6 +114,7 @@ import { ref, defineProps, onMounted } from 'vue'
|
||||
import operateRegionMap from '../../Urban/OperateRegion/operateRegionMap.vue'
|
||||
import { callOperate } from '@/apis/call.js'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { getCache } from '@/utils/authority';
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
@ -128,12 +132,13 @@ const openORMapTitle = ref("");
|
||||
|
||||
const zoneOptions = ref([])
|
||||
|
||||
const zoneList = ref([])
|
||||
|
||||
const form = ref({
|
||||
regionId: "",
|
||||
regionName: "",
|
||||
simpleName: "",
|
||||
zoneId: "",
|
||||
zoneId: undefined,
|
||||
points: [],
|
||||
shapeType: 2,
|
||||
radius: 0
|
||||
@ -141,15 +146,26 @@ const form = ref({
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
callOperate("/ebikeOperateSystem/ebikeAdministrationZone", {}, "get").then(res => {
|
||||
if (res.code == 200) {
|
||||
let opt = []
|
||||
res.data.map(item => {
|
||||
opt.push({ label: item['name'], value: item['id'], isLeaf: item['isLeaf'] })
|
||||
})
|
||||
zoneOptions.value = opt;
|
||||
const userinfo = getCache('ebike-userinfo');
|
||||
callOperate("/ebikeOrgZone/list?orgId=" + userinfo.orgId, {}, "get").then((res) => {
|
||||
if (res.code!= 200) {
|
||||
message.error(res.message)
|
||||
return
|
||||
}
|
||||
})
|
||||
if (res.data) {
|
||||
zoneList.value = res.data
|
||||
}
|
||||
})
|
||||
|
||||
// callOperate("/ebikeOperateSystem/ebikeAdministrationZone", {}, "get").then(res => {
|
||||
// if (res.code == 200) {
|
||||
// let opt = []
|
||||
// res.data.map(item => {
|
||||
// opt.push({ label: item['name'], value: item['id'], isLeaf: item['isLeaf'] })
|
||||
// })
|
||||
// zoneOptions.value = opt;
|
||||
// }
|
||||
// })
|
||||
})
|
||||
|
||||
const loadZoneData = (data) => {
|
||||
|
||||
305
ebike-operate/src/views/form/orgmanage/orgform.vue
Normal file
305
ebike-operate/src/views/form/orgmanage/orgform.vue
Normal file
@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<a-form
|
||||
:model="form"
|
||||
ref="formRef"
|
||||
label-align="left"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
label="品牌商名称"
|
||||
:label-col="{ span: 3 }"
|
||||
:wrapper-col="{ span: 21 }"
|
||||
name="orgName"
|
||||
required
|
||||
:rules="[{ required: true, message: '请输入品牌商名称' }]"
|
||||
>
|
||||
<a-input v-model:value="form.orgName" placeholder="请输入品牌商名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
label="品牌商编码"
|
||||
:label-col="{ span: 3 }"
|
||||
:wrapper-col="{ span: 21 }"
|
||||
name="orgName"
|
||||
required
|
||||
:rules="[{ required: true, message: '请输入品牌商编码' }]"
|
||||
>
|
||||
<a-input v-model:value="form.orgCode" placeholder="请输入品牌商编码" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-card size="small">
|
||||
<template #title>
|
||||
<span>已授权区域</span>
|
||||
<a-cascader
|
||||
:options="zoneOptions"
|
||||
:load-data="loadZoneData"
|
||||
placeholder="请选择行政区划"
|
||||
@change="addOrgZone"
|
||||
>
|
||||
<a-button type="primary" size="small" style="margin-left: 15px;">
|
||||
授权
|
||||
</a-button>
|
||||
</a-cascader>
|
||||
</template>
|
||||
<!-- 表格 -->
|
||||
<a-table
|
||||
:pagination="false"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<a @click="removeOrgZone(record)">移除</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { callUser, callOperate } from '@/apis/call.js'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { dataFormat } from '@/utils/tools'
|
||||
import { getCache } from '@/utils/authority';
|
||||
|
||||
const formRef = ref();
|
||||
const formData = () => ({
|
||||
orgId: "",
|
||||
orgName: "",
|
||||
createdTime: ""
|
||||
});
|
||||
const form = ref(formData());
|
||||
|
||||
// 表格行数据
|
||||
const dataSource = ref([])
|
||||
const data = ref([])
|
||||
// 表格列配置
|
||||
const columns = ref([
|
||||
{
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
dataIndex: 'index'
|
||||
},
|
||||
{
|
||||
key: 'zoneName',
|
||||
title: '区域名称',
|
||||
dataIndex: 'zoneName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
key: 'assignedTime',
|
||||
title: '授权时间',
|
||||
align: 'center',
|
||||
dataIndex: 'assignedTime'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 320,
|
||||
align: 'center'
|
||||
}
|
||||
])
|
||||
|
||||
const zoneOptions = ref([])
|
||||
|
||||
const openForm = (params = {}) => {
|
||||
form.value = {
|
||||
...formData()
|
||||
}
|
||||
if (params['orgId']) {
|
||||
callUser("/organizations/getInfo/"+ params['orgId'], {}, "get").then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data) {
|
||||
form.value = {
|
||||
...res.data
|
||||
};
|
||||
}
|
||||
} else {
|
||||
message.error(res.message);
|
||||
}
|
||||
});
|
||||
getOrgZoneList(params['orgId']);
|
||||
}
|
||||
loadFristZoneData();
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载区域数据
|
||||
*/
|
||||
const loadFristZoneData = () => {
|
||||
zoneOptions.value = [];
|
||||
callOperate("/ebikeOperateSystem/ebikeAdministrationZone", {}, "get").then(res => {
|
||||
if (res.code == 200) {
|
||||
let opt = []
|
||||
res.data.map(item => {
|
||||
opt.push({ label: item['name'], value: item['id'], isLeaf: item['isLeaf'] })
|
||||
})
|
||||
zoneOptions.value = opt;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const loadZoneData = (data) => {
|
||||
if (data) {
|
||||
let pindex = 0;
|
||||
let parentId = data[0].value;
|
||||
if (data.length > 0) {
|
||||
pindex = data.length - 1;
|
||||
parentId = data[pindex].value;
|
||||
}
|
||||
callOperate("/ebikeOperateSystem/ebikeAdministrationZone?parent_id=" + parentId, {}, "get").then(res => {
|
||||
if (res.code == 200) {
|
||||
let opt = []
|
||||
res.data.map(item => {
|
||||
opt.push({ label: item['name'], value: item['id'], isLeaf: item['isLeaf'] })
|
||||
})
|
||||
setZoneData(zoneOptions.value,'value', parentId,'children',opt);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const setZoneData = (arr,keyname,keyvalue,name,value) => {
|
||||
arr.map(item => {
|
||||
if (item[keyname] == keyvalue) {
|
||||
item[name] = value;
|
||||
}
|
||||
if (item['children']) {
|
||||
setZoneData(item['children'],keyname,keyvalue,name,value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getOrgZoneList = (orgId) => {
|
||||
callOperate("/ebikeOrgZone/list?orgId=" + orgId, {}, "get").then((res) => {
|
||||
if (res.code!= 200) {
|
||||
message.error(res.message)
|
||||
return
|
||||
}
|
||||
if (res.data) {
|
||||
data.value = res.data
|
||||
data.value = data.value.map((item, index) => {
|
||||
index++
|
||||
return { ...item, index }
|
||||
})
|
||||
dataSource.value = data.value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const removeOrgZone = (record) => {
|
||||
callOperate("/ebikeOrgZone/remove?id=" + record.id, { }, "post").then((res) => {
|
||||
if (res.code!= 200) {
|
||||
message.error(res.message)
|
||||
return
|
||||
}
|
||||
getOrgZoneList(form.value.orgId);
|
||||
})
|
||||
}
|
||||
|
||||
const addOrgZone = (data) => {
|
||||
let zoneId = "";
|
||||
if (data.length > 0) {
|
||||
zoneId = data[data.length - 1];
|
||||
} else {
|
||||
zoneId = "";
|
||||
}
|
||||
if (!zoneId) {
|
||||
message.error('请选择行政区划')
|
||||
}
|
||||
const userinfo = getCache('ebike-userinfo');
|
||||
const params = {
|
||||
orgId: form.value.orgId,
|
||||
zoneId: zoneId,
|
||||
staffId: userinfo.username,
|
||||
assignedTime: dataFormat(new Date(),'yyyy-MM-dd HH:mm:ss')
|
||||
}
|
||||
callOperate("/ebikeOrgZone/save", params, "post").then((res) => {
|
||||
if (res.code!= 200) {
|
||||
message.error(res.message)
|
||||
return
|
||||
}
|
||||
getOrgZoneList(form.value.orgId);
|
||||
loadFristZoneData();
|
||||
})
|
||||
}
|
||||
|
||||
const formSave = (callBack) => {
|
||||
formRef.value.validate().then(() => {
|
||||
let params = {
|
||||
orgId: "",
|
||||
orgName: "",
|
||||
orgCode: "",
|
||||
createdTime: dataFormat(new Date(),'yyyy-MM-dd HH:mm:ss'),
|
||||
}
|
||||
if (form.value.orgId) {
|
||||
params = {
|
||||
...form.value
|
||||
}
|
||||
callUser("/organizations/update", params).then(res => {
|
||||
if (res.code != 200) {
|
||||
message.error(res.message);
|
||||
if (callBack) {
|
||||
callBack(false, res);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (callBack) {
|
||||
callBack(true, res);
|
||||
}
|
||||
resetAll();
|
||||
}).catch(error => {
|
||||
if (callBack) {
|
||||
callBack(false, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
callUser("/organizations/save", params).then(res => {
|
||||
if (res.code!= 200) {
|
||||
message.error(res.message);
|
||||
if (callBack) {
|
||||
callBack(false, res);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (callBack) {
|
||||
callBack(true, res);
|
||||
}
|
||||
resetAll();
|
||||
}).catch(error => {
|
||||
if (callBack) {
|
||||
callBack(false, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const resetAll = (callBack) => {
|
||||
Object.assign(form.value, formData());
|
||||
data.value = [];
|
||||
dataSource.value = [];
|
||||
formRef.value.resetFields();
|
||||
if (callBack) {
|
||||
callBack(true, form.value);
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ openForm, formSave, resetAll });
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user