Commit c6dffefc authored by Step_by_step's avatar Step_by_step

feat: 客户信息变更(未完)

parent 6cba9f87
......@@ -13,7 +13,8 @@
"build:infoChange": "VITE_TARGET=infoChange vite build --mode test",
"build:relatedProject": "VITE_TARGET=relatedProject vite build --mode test",
"build:repayPlanCheck": "VITE_TARGET=repayPlanCheck vite build --mode test",
"build:contractSign": "VITE_TARGET=contractSign vite build --mode test"
"build:contractSign": "VITE_TARGET=contractSign vite build --mode test",
"build:projectList": "VITE_TARGET=projectList vite build --mode test"
},
"dependencies": {
"@hips/plugin-vue-jssdk": "^1.1.2",
......
import { get, put, post, File, deleteReq } from '@/utils/http'
import { post } from '@/utils/http'
const baseURL = import.meta.env.DEV ? '/api' : import.meta.env.VITE_HTTP_BASE_URL
const baseURL = import.meta.env.VITE_HTTP_BASE_URL
const api = {
// getMakingList (data) { // 查询合同制作列表
// return get(
// `${baseURL}/hlct/v1/0/contracts/toMake`,
// {...data}
// )
// },
// 客户信息变更申请按钮
changeApprove(data = {}) {
return post(`${baseURL}/app/api/app/master/change/request/approve`, { ...data, userId: window.localStorage.getItem('userId') })
},
// 选择项目
contractNumber() {
return post(`${baseURL}/app/api/app/contract/number`, { userId: window.localStorage.getItem('userId') })
},
// 首页
changeQuery() {
return post(`${baseURL}/app/api/app/master/change/query`, { userId: window.localStorage.getItem('userId') })
},
};
export default api;
<template>
<SwipeCell class="swipe" :disabled="true">
<div class="box" @click="$emit('click')">
<SwipeCell class="swipe box" :disabled="true">
<div @click="$emit('click')">
<p>
<span>申请编号:</span>
<span>{{ info.id }}</span>
......
const state = {};
import { ref } from 'vue'
import { defineStore } from 'pinia'
export default {
namespaced: true,
state,
};
export const useInfoChange = defineStore('infoChangeStore', () => {
const data = ref({})
return { data }
})
......@@ -3,147 +3,364 @@
<NavBar title="客户信息变更" left-arrow @click-left="goBack" />
<div class="content">
<section class="form-area">
<section class="form-area" v-if="!isOpenConfig">
<Tabs v-model:active="active" title-active-color="#0277bc" color="#0277bc">
<Tab title="地址信息">
<AuForm v-model="addressFormConfig" :key="addressForm" />
<Field v-model="message" rows="2" autosize label="备注说明" type="textarea" maxlength="200"
placeholder="最多可编写200字" show-word-limit />
<AuForm v-model="addressFormConfig" />
<Field v-model="refV01" rows="2" autosize label="备注说明" type="textarea" maxlength="200"
placeholder="最多可编写200字" show-word-limit :readonly="readonly" />
</Tab>
<Tab title="联系人信息">
<AuForm v-model="contactPersonConfig" :key="contactPerson" />
<Field v-model="message" rows="2" autosize label="备注说明" type="textarea" maxlength="200"
placeholder="最多可编写200字" show-word-limit />
<AuForm v-model="contactPersonConfig" />
<Field v-model="remark" rows="2" autosize label="备注说明" type="textarea" maxlength="200"
placeholder="最多可编写200字" show-word-limit :readonly="readonly" />
</Tab>
</Tabs>
</section>
<section v-show="isOpenConfig">
<AuForm v-model="middleConfig" />
</section>
<section class="sub">
<Button type="primary" block>申请</Button>
<Button type="primary" v-if="!readonly" block @click="buttonClick">{{ isOpenConfig ? "下一步" : "申请" }}</Button>
</section>
</div>
</div>
</div>
</template>
<script setup>
import { goBack } from "@/utils/globalFun"
import { NavBar, Button, Field, Tab, Tabs } from "vant";
import { NavBar, Button, Field, Tab, Tabs, Toast } from "vant";
import AuForm from '@/components/AuForm.vue';
import AuFormClass from "@/components/useAuForm";
import { areaList } from '@vant/area-data';
import api from "../api";
import { useRoute } from "vue-router";
import { useInfoChange } from '../store/index'
import { phoneReg } from "@/utils/Reg"
import { onMounted } from "vue";
const infoChangeStore = useInfoChange()
console.log("目前维护的数据", infoChangeStore.data);
const route = useRoute()
const readonly = $ref(false)
const isOpenConfig = $ref(true);
const getMode = () => {
console.log(route.query);
if (route.query.isReturn === "false") {
isOpenConfig = false
readonly = true
} else if (route.query.isReturn === "true") {
isOpenConfig = false
readonly = false
} else {
isOpenConfig = true
}
}
getMode()
const active = $ref(0)
const message = $ref('')
const refV01 = $ref('')
const remark = $ref('')
const addressForm = $ref();
const addressFormConfig = $ref(new AuFormClass([
{
title: '地址类型',
propName: 'paymentReqDate',
propName: 'addressType',
type: 'cell',
value: '',
isRequired: true,
select: []
select: [
{
text: "通讯地址",
value: "SERVICE_ADDRESS"
},
{
text: "身份证地址",
value: "ID_ADDRESS"
},
{
text: "家庭地址",
value: "HOUSE_ADDRESS"
},
{
text: "单位地址",
value: "WORK_ADDRESS"
},
{
text: "其他",
value: "OTHERS"
},
]
},
{
title: '省/市/区',
propName: 'paymentReqDat3e',
propName: 'area',
type: 'cell',
value: '',
isRequired: true,
select: []
select: areaList
},
{
title: '详细地址',
propName: 'paymentReqDat3e',
propName: 'address',
type: 'input',
value: '',
isRequired: true
isRequired: false
},
{
title: '邮编',
propName: 'paymentReqDat3e',
propName: 'zipcode',
type: 'input',
value: '',
isRequired: true
isRequired: false
},
{
title: '电话',
propName: 'paymentReqDat3e',
propName: 'phone',
type: 'input',
value: '',
isRequired: true
isRequired: false,
},
{
title: '手机',
propName: 'paymentRe3qDat3e',
propName: 'cellPhone',
type: 'input',
value: '',
isRequired: true,
isRequired: false,
reg: phoneReg
}
]))
const contactPerson = $ref();
], { disabled: readonly }))
const contactPersonConfig = $ref(new AuFormClass([
{
title: '联系人类型',
propName: 'paymentReqDate',
propName: 'contactType',
type: 'cell',
value: '',
isRequired: true,
select: []
select: [
{
text: "主联系人",
value: "RENT_CONTACT"
},
{
text: "次联系人",
value: "SECONDARY_CONTACT"
}
]
},
{
title: '联系人姓名',
propName: 'paymentReqDat3e',
propName: 'contactPerson',
type: 'input',
value: '',
isRequired: true,
},
{
title: '职务',
propName: 'paymentReqDat3e',
propName: 'position',
type: 'cell',
value: '',
isRequired: true,
select: []
select: [
{
text: "高级领导",
value: "1"
},
{
text: "中级领导",
value: "2"
},
{
text: "一般员工",
value: "3"
},
{
text: "无",
value: "9"
},
]
},
{
title: '证件类型',
propName: 'paymentReqDat3e',
propName: 'idType',
type: 'cell',
value: '',
isRequired: true,
select: [
{
text: "户口薄",
value: "RESIDENCE_BOOKLET"
},
{
text: "港澳居民来往内地通行证",
value: "GA_TRAVEL_PERMIT"
},
{
text: "台湾同胞来往内地通行证",
value: "TW_TRAVEL_PERMIT"
},
{
text: "外国人居留证",
value: "RES_PERMIT_FOREIGNERS"
},
{
text: "警官证",
value: "POLICE_ID_CARD"
},
{
text: "香港身份证",
value: "HK_ID_CARD"
},
{
text: "澳门身份证",
value: "AM_ID_CARD"
},
{
text: "台湾身份证",
value: "TW_ID_CARD"
},
{
text: "居民身份证及其他以公号码为标识的件",
value: "ID_CARD"
},
{
text: "军人身份证件",
value: "SOLDIER_ID_CARD"
},
{
text: "统一社会信用代码",
value: "SOCIAL_CREDIT_CODE"
}
]
},
{
title: '证件号码',
propName: 'idCardNo',
type: 'input',
value: '',
isRequired: true,
select: []
},
{
title: '电话',
propName: 'paymentReqDat3e',
propName: 'phone',
type: 'input',
value: '',
isRequired: true
isRequired: true,
reg: phoneReg
},
{
title: '邮箱',
propName: 'paymentReqDat3e',
propName: 'email',
type: 'input',
value: '',
isRequired: true
isRequired: false
},
{
title: '传真',
propName: 'paymentReqDat3e',
propName: 'fax',
type: 'input',
value: '',
isRequired: true
isRequired: false
},
{
title: '家庭住址',
propName: 'paymentRe3qDat3e',
propName: 'familyAddress',
type: 'input',
value: '',
isRequired: true,
isRequired: false,
}
], { disabled: readonly }))
const middleConfig = $ref(new AuFormClass([
{
title: '项目编号',
propName: 'itemProjectNumber',
type: 'cell',
value: '',
isRequired: true,
select: []
},
{
title: '客户名称',
propName: 'bpName',
type: 'input',
value: '',
isRequired: true,
disabled: true
},
]))
const bpObj = $ref({})
const fillForm = () => {
addressFormConfig.fillValues(infoChangeStore.data)
contactPersonConfig.fillValues(infoChangeStore.data)
contactPersonConfig.fillValues(infoChangeStore.data)
}
onMounted(() => {
fillForm()
})
const queryPrj = async () => {
let res = await api.contractNumber()
if (res.success && res.rows.length) {
middleConfig.setFormValue("itemProjectNumber", "select", res.rows.map(item => {
return {
text: item.itemProjectNumber,
value: item.itemProjectNumber,
bpId: item.bpId,
bpName: item.bpName,
bpClass: item.bpClass,
contractId: item.contractId,
bpStatus: item.bpStatus
}
}))
let select = middleConfig.getFormValue("itemProjectNumber", true)?.select;
middleConfig.watchForm("itemProjectNumber", (n, o) => {
let obj = select.find(item => item.value === n)
if (obj.value) {
console.log(obj);
bpObj.bpClass = obj.bpClass
bpObj.bpId = obj.bpId
bpObj.bpStatus = obj.bpStatus
middleConfig.setFormValue("bpName", "value", obj.bpName)
}
})
}
}
queryPrj()
const submit = async () => {
let obj1 = middleConfig.getValues()
let obj2 = addressFormConfig.getValues()
let obj3 = contactPersonConfig.getValues()
let provinceId = obj2.area
let cityId = obj2.area
let districtId = obj2.area
let params = { hlsBpMasterAddress: { ...obj2, refV01, provinceId, cityId, districtId }, hlsBpMasterContactInfo: { ...obj3, remark }, ...bpObj }
// 地址差个手机
let res = await api.changeApprove(params)
}
const buttonClick = () => {
if (isOpenConfig && middleConfig.validate()) {
isOpenConfig = false
} else if (!isOpenConfig && !readonly && addressFormConfig.validate() && contactPersonConfig.validate()) {
submit()
} else {
Toast.fail('请将数据填写完整')
}
}
</script>
<style lang="less" scoped>
......
......@@ -5,12 +5,12 @@
<section class="list">
<PullRefresh v-model="refreshing" @refresh="onRefresh" class="scroll">
<List :finished="finished" finished-text="没有更多了" @load="loadApproval">
<ChangeListItem v-for="item in infos" :info="item" @click="jump" />
<ChangeListItem v-for="item in infos" :info="item" @click="jump(item)" />
</List>
</PullRefresh>
</section>
<Plus @click="jump" />
<Plus @click="jump({})" />
</div>
</template>
......@@ -21,29 +21,56 @@ import ChangeListItem from '../components/ChangeListItem.vue'
import Plus from '@/components/Plus.vue'
import api from "../api";
import { useRouter } from "vue-router";
import { useInfoChange } from '../store/index'
const infos = $ref([
{
id: 'BG001001001',
applyDate: '2022-8-18',
status: '拒绝'
}
])
const infoChangeStore = useInfoChange()
const refreshing = $ref(true);
const refreshing = $ref(false);
const finished = $ref(true);
const infos = $ref([])
let queryList = async () => {
refreshing = true
let res = await api.changeQuery({})
if (res.success && res.total > 0) {
res.rows.forEach(item => {
infos.push({
id: item.changeReqNumber,
applyDate: item.creationDate,
status: item.reqStatusN,
...item
})
})
}
refreshing = false
}
queryList()
const onRefresh = () => {
// 下拉重置参数,重新加载
infos = []
queryList()
};
const loadApproval = () => {
queryList()
}
const router = useRouter();
const jump = () => {
router.push({ name: 'infoChange-views-changeForm' })
const jump = (item) => {
infoChangeStore.data = item
// 申请中/审批通过时申请页面为只读
// 审批退回时可再次维护并重新提交
if (item.reqStatus && item.reqStatus === 'RETURN') {
router.push({ path: '/infochange/views/changeform', query: { isReturn: true } })
} else if (item.reqStatus && item.reqStatus !== 'RETURN') {
router.push({ path: '/infochange/views/changeform', query: { isReturn: false } })
} else {
router.push({ path: '/infochange/views/changeform', query: {} })
}
}
</script>
......
......@@ -28,7 +28,6 @@ import { useIntention } from '../store/index'
import { unref } from "vue";
import api from "../api";
import { areaList } from '@vant/area-data';
console.log(areaList);
const formStore = useIntention()
let location = useLocation()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment