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