提交申请增加动态省市区
This commit is contained in:
parent
0e42dbf6c1
commit
0300adf7d0
|
|
@ -248,18 +248,16 @@
|
|||
import ShowImg from './comoonents/showImg.vue'
|
||||
import {reactive, ref} from 'vue'
|
||||
import EquipCard from 'components/equipCard.vue'
|
||||
import {getDetail,getHotList,equipCollect,apiSubmitLease} from "@/http/api/equip"
|
||||
import {getDetail,getHotList,equipCollect,apiSubmitLease,apiGetAddressList} from "@/http/api/equip"
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import Navmenu from '@/components/Navmenu/index.vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import equipDetailTable from '@/components/equipDetailTable.vue'
|
||||
import {ElMessage} from "element-plus";
|
||||
import address from "@/assets/temporaryAddress.json"
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const addressData = reactive(address)
|
||||
|
||||
const pageParams = route.params
|
||||
//设备简略基本信息
|
||||
|
|
@ -399,7 +397,7 @@ const ruleForm = ref({
|
|||
entryTime: '',//进场时间
|
||||
duration: '',//工期时长
|
||||
machinist: 0,//是否需要机手
|
||||
invoiceType: 0,//发票类型
|
||||
invoiceType: '',//发票类型
|
||||
projectDescription: ''//项目说明
|
||||
})
|
||||
const rules = reactive({
|
||||
|
|
@ -462,30 +460,44 @@ const that = {
|
|||
openPdf
|
||||
}
|
||||
|
||||
|
||||
const addressCascader = {
|
||||
lazy:true,
|
||||
label:'name',
|
||||
value:'id',
|
||||
lazyLoad(node,resolve){
|
||||
const { level } = node
|
||||
setTimeout(() => {
|
||||
let nodes = []
|
||||
if(level == 0){
|
||||
nodes = addressData.province
|
||||
}else if(level == 1){
|
||||
nodes = addressData.city
|
||||
}else if(level == 2){
|
||||
nodes = addressData.county.map((item) => ({
|
||||
...item,
|
||||
leaf:true
|
||||
}))
|
||||
}
|
||||
|
||||
resolve(nodes)
|
||||
},1000)
|
||||
lazyLoad: async (node,resolve) =>{
|
||||
const { level,data } = node
|
||||
let nodes = []
|
||||
if(level == 0){
|
||||
const arr = await getAddressData()
|
||||
nodes = arr
|
||||
}else if(level == 1){
|
||||
const arr = await getAddressData(data.code)
|
||||
nodes = arr
|
||||
}else if(level == 2){
|
||||
const arr = await getAddressData(data.code)
|
||||
nodes = arr.map((item) => ({
|
||||
...item,
|
||||
leaf:true
|
||||
}))
|
||||
}
|
||||
resolve(nodes)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取地址列表
|
||||
const getAddressData = async (code = '') => {
|
||||
let params = {}
|
||||
if(code){
|
||||
params = { code }
|
||||
}
|
||||
|
||||
const res = await apiGetAddressList(params)
|
||||
|
||||
return res.data || []
|
||||
}
|
||||
|
||||
const handelDetailListClick = (fnName, arg) => {
|
||||
if (fnName) {
|
||||
that[fnName](arg)
|
||||
|
|
@ -529,7 +541,7 @@ const submit = async() => {
|
|||
realStartTime: ruleForm.value.entryTime,
|
||||
duration: ruleForm.value.duration,
|
||||
isMachinist: ruleForm.value.machinist,
|
||||
invoiceType: -1,
|
||||
invoiceType: ruleForm.value.invoiceType,
|
||||
description: ruleForm.value.projectDescription
|
||||
}
|
||||
|
||||
|
|
@ -554,6 +566,7 @@ init()
|
|||
<style scoped lang="scss">
|
||||
:deep(.dialoglease){
|
||||
margin: 10px auto 0 !important;
|
||||
min-width: 855px !important;
|
||||
}
|
||||
|
||||
:deep(.el-form-item){
|
||||
|
|
|
|||
Loading…
Reference in New Issue