diff --git a/src/views/administrativeContracts/edit.vue b/src/views/administrativeContracts/edit.vue index a7b11b0..366962f 100644 --- a/src/views/administrativeContracts/edit.vue +++ b/src/views/administrativeContracts/edit.vue @@ -185,7 +185,7 @@ const delFileFn = (index: number) => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/bid_bidding_decision/edit.vue b/src/views/bid_bidding_decision/edit.vue index c671dce..d54436f 100644 --- a/src/views/bid_bidding_decision/edit.vue +++ b/src/views/bid_bidding_decision/edit.vue @@ -185,7 +185,7 @@ const popupTitle = computed(() => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/bid_buy_bidding_document/edit.vue b/src/views/bid_buy_bidding_document/edit.vue index 7eceb30..1162514 100644 --- a/src/views/bid_buy_bidding_document/edit.vue +++ b/src/views/bid_buy_bidding_document/edit.vue @@ -214,7 +214,7 @@ const formRules = reactive({ const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/bid_document_examination/edit.vue b/src/views/bid_document_examination/edit.vue index e84b61f..8f0ad6a 100644 --- a/src/views/bid_document_examination/edit.vue +++ b/src/views/bid_document_examination/edit.vue @@ -442,7 +442,7 @@ const formRules = reactive({ const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/contract/edit.vue b/src/views/contract/edit.vue index cf44669..8e188d4 100644 --- a/src/views/contract/edit.vue +++ b/src/views/contract/edit.vue @@ -251,7 +251,7 @@ const amountinput = (e) => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/contract_negotiation/edit.vue b/src/views/contract_negotiation/edit.vue index e960176..5432ca8 100644 --- a/src/views/contract_negotiation/edit.vue +++ b/src/views/contract_negotiation/edit.vue @@ -188,7 +188,7 @@ const formRules = reactive({ const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/custom/edit.vue b/src/views/custom/edit.vue index 1ded019..03f0d09 100644 --- a/src/views/custom/edit.vue +++ b/src/views/custom/edit.vue @@ -2,6 +2,15 @@
+
+ + + + + + + +
客户基本资料
@@ -217,7 +226,10 @@ const emit = defineEmits(['success', 'close']) const formRef = shallowRef() const popupRef = shallowRef>() const mode = ref('add') - +const list1 = reactive([]) +const list2 = reactive([]) +import { deptAll } from '@/api/org/department' +import { getAll } from '@/api/org/organization' const datas = reactive({ provinceOptions: [], cityOptions: [], @@ -233,31 +245,70 @@ const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => { // if (!value) { // return callback(new Error('电话号码不能为空')) // } - setTimeout(() => { - if (phoneReg.test(value)) { - callback() - } else { - callback(new Error('电话号码格式不正确')) - } + // setTimeout(() => { + // if (phoneReg.test(value)) { + // callback() + // } else { + // callback(new Error('电话号码格式不正确')) + // } - }, 100) + // }, 100) + + if (value && phoneReg.test(value)) { + return callback(new Error('电话号码格式不正确')) + } else { + callback() + } } const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => { const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/ // if (!value) { // return callback(new Error('邮箱不能为空')) // } - setTimeout(() => { - if (mailReg.test(value)) { - callback() - } else { - callback(new Error('请输入正确的邮箱格式')) - } - }, 100) + // setTimeout(() => { + // if (mailReg.test(value)) { + // callback() + // } else { + // callback(new Error('请输入正确的邮箱格式')) + // } + // }, 100) + if (value && mailReg.test(value)) { + return callback(new Error('请输入正确的邮箱格式')) + } else { + callback() + } }; +//获取所有组织 +const getlist = () => { + getAll().then((res) => { + Object.assign(list1, res) + if (res.length > 0 && !formData.org_id) { + formData.org_id = res[0].id + deptAll({ 'org_id': res[0].id }).then((res) => { + if (res.length > 0) { + Object.assign(list2, res) + formData.dept_id = res[0].id + } + + }) + } + }) +} +//获取部门 +const deptrmt = (e) => { + getlist1(e) +} +//获取所有部门 +const getlist1 = (id: any) => { + deptAll({ 'org_id': id }).then((res) => { + Object.assign(list2, res) + }) +} // 表单数据 const formData = reactive({ id: '', + dept_id: '', + org_id: '', name: '', custom_type: '', parent_company: 5565665, @@ -310,7 +361,10 @@ const setFormData = async (data: Record) => { } } - formData.other_contacts = JSON.parse(formData.other_contacts) + if (formData.dept_id) { + getlist1(formData.dept_id) + } + formData.other_contacts = JSON.parse(data.other_contacts) console.log(formData, '2222222222') @@ -340,6 +394,7 @@ const handleSubmit = async () => { const open = (type = 'add') => { mode.value = type popupRef.value?.open() + getlist() } // 关闭回调 diff --git a/src/views/custom_service/edit.vue b/src/views/custom_service/edit.vue index 993badd..793185c 100644 --- a/src/views/custom_service/edit.vue +++ b/src/views/custom_service/edit.vue @@ -2,6 +2,16 @@
+
+ + + + + + + +
+ @@ -120,6 +130,10 @@ import { timeFormat } from '@/utils/util' import type { PropType } from 'vue' import useUserStore from "@/stores/modules/user"; import configs from "@/config" +const list1 = reactive([]) +const list2 = reactive([]) +import { deptAll } from '@/api/org/department' +import { getAll } from '@/api/org/organization' import reviewprocess from '@/components/reviewprocess/index.vue' import costDialog from '@/components/budget/index.vue' import peojectDialog from '@/components/project/index.vue' @@ -177,10 +191,37 @@ const mode = ref('add') const popupTitle = computed(() => { return mode.value == 'edit' ? '编辑客户售后' : '新增客户售后' }) +//获取所有组织 +const getlist = () => { + getAll().then((res) => { + Object.assign(list1, res) + if (res.length > 0 && !formData.org_id) { + formData.org_id = res[0].id + deptAll({ 'org_id': res[0].id }).then((res) => { + if (res.length > 0) { + Object.assign(list2, res) + formData.dept_id = res[0].id + } + }) + } + }) +} +//获取部门 +const deptrmt = (e) => { + getlist1(e) +} +//获取所有部门 +const getlist1 = (id: any) => { + deptAll({ 'org_id': id }).then((res) => { + Object.assign(list2, res) + }) +} // 表单数据 const formData = reactive({ id: '', + dept_id: '', + org_id: '', project_id: '', custom_id: '', approve_id: '', @@ -218,6 +259,9 @@ const setFormData = async (data: Record) => { }); Object.assign(formDataannex, arry1) } + if (formData.dept_id) { + getlist1(formData.dept_id) + } for (const key in formData) { if (data[key] != null && data[key] != undefined) { //@ts-ignore @@ -255,6 +299,7 @@ const handleSubmit = async () => { const open = (type = 'add') => { mode.value = type popupRef.value?.open() + getlist() } // 关闭回调 diff --git a/src/views/financialManagement/Administrative/AdministrativePayments/edit.vue b/src/views/financialManagement/Administrative/AdministrativePayments/edit.vue index e149420..e838418 100644 --- a/src/views/financialManagement/Administrative/AdministrativePayments/edit.vue +++ b/src/views/financialManagement/Administrative/AdministrativePayments/edit.vue @@ -223,7 +223,7 @@ const customEvent1 = (e: any) => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/financialManagement/Administrative/AdministrativeTickets/edit.vue b/src/views/financialManagement/Administrative/AdministrativeTickets/edit.vue index 7304e8f..0538167 100644 --- a/src/views/financialManagement/Administrative/AdministrativeTickets/edit.vue +++ b/src/views/financialManagement/Administrative/AdministrativeTickets/edit.vue @@ -217,7 +217,7 @@ const customEvent1 = (e: any) => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/financialManagement/Management/editadjust.vue b/src/views/financialManagement/Management/editadjust.vue index e6e986e..648d05e 100644 --- a/src/views/financialManagement/Management/editadjust.vue +++ b/src/views/financialManagement/Management/editadjust.vue @@ -403,7 +403,7 @@ const getDetail = async (row: Record) => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/financialManagement/Management/editcost.vue b/src/views/financialManagement/Management/editcost.vue index 5b85926..d4e67fb 100644 --- a/src/views/financialManagement/Management/editcost.vue +++ b/src/views/financialManagement/Management/editcost.vue @@ -408,7 +408,7 @@ const getDetail = async (row: Record) => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/financialManagement/reimbursement/edit.vue b/src/views/financialManagement/reimbursement/edit.vue index 54975ca..967293c 100644 --- a/src/views/financialManagement/reimbursement/edit.vue +++ b/src/views/financialManagement/reimbursement/edit.vue @@ -363,7 +363,7 @@ const subjectmu = (a: any, b: number) => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/organization/organization/edit.vue b/src/views/organization/organization/edit.vue index 215725a..61056e4 100644 --- a/src/views/organization/organization/edit.vue +++ b/src/views/organization/organization/edit.vue @@ -29,7 +29,7 @@ const popupTitle = computed(() => { return mode.value == 'edit' ? '编辑组织' : '新增组织' }) const formData = reactive({ - + id: "", name: '', master: '', status: 0 diff --git a/src/views/procurement_contract/edit.vue b/src/views/procurement_contract/edit.vue index 1ab8a6a..075a49f 100644 --- a/src/views/procurement_contract/edit.vue +++ b/src/views/procurement_contract/edit.vue @@ -298,7 +298,7 @@ const popupTitle = computed(() => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/project_attendance_record/detail.vue b/src/views/project_attendance_record/detail.vue new file mode 100644 index 0000000..35e19a5 --- /dev/null +++ b/src/views/project_attendance_record/detail.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/src/views/project_attendance_record/edit.vue b/src/views/project_attendance_record/edit.vue new file mode 100644 index 0000000..b9c67fa --- /dev/null +++ b/src/views/project_attendance_record/edit.vue @@ -0,0 +1,266 @@ + + + diff --git a/src/views/project_attendance_record/index.vue b/src/views/project_attendance_record/index.vue new file mode 100644 index 0000000..b3d6d32 --- /dev/null +++ b/src/views/project_attendance_record/index.vue @@ -0,0 +1,177 @@ + + + + diff --git a/src/views/project_manager_appointment/edit.vue b/src/views/project_manager_appointment/edit.vue index e270a7d..a5b8c3c 100644 --- a/src/views/project_manager_appointment/edit.vue +++ b/src/views/project_manager_appointment/edit.vue @@ -300,7 +300,7 @@ const formRules = reactive({ const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/project_personnel/index.vue b/src/views/project_personnel/index.vue index f151429..8eac0a1 100644 --- a/src/views/project_personnel/index.vue +++ b/src/views/project_personnel/index.vue @@ -8,9 +8,10 @@ - - - + + + + 查询 重置 @@ -89,7 +90,7 @@ const showDtail = ref(false) const queryParams = reactive({ mobile: '', name: '', - + work_type: '', }) diff --git a/src/views/project_plan/edit.vue b/src/views/project_plan/edit.vue index ecf455b..d77a2cc 100644 --- a/src/views/project_plan/edit.vue +++ b/src/views/project_plan/edit.vue @@ -229,7 +229,7 @@ const formRules = reactive({ const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/project_salary/detail.vue b/src/views/project_salary/detail.vue new file mode 100644 index 0000000..35e19a5 --- /dev/null +++ b/src/views/project_salary/detail.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/src/views/project_salary/edit.vue b/src/views/project_salary/edit.vue new file mode 100644 index 0000000..b9c67fa --- /dev/null +++ b/src/views/project_salary/edit.vue @@ -0,0 +1,266 @@ + + + diff --git a/src/views/project_salary/index.vue b/src/views/project_salary/index.vue new file mode 100644 index 0000000..b3d6d32 --- /dev/null +++ b/src/views/project_salary/index.vue @@ -0,0 +1,177 @@ + + + + diff --git a/src/views/purchaseContracts/edit.vue b/src/views/purchaseContracts/edit.vue index 1bc6a81..d00b91e 100644 --- a/src/views/purchaseContracts/edit.vue +++ b/src/views/purchaseContracts/edit.vue @@ -303,7 +303,7 @@ const popupTitle = computed(() => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/quotation/edit.vue b/src/views/quotation/edit.vue index ffac392..3104f3d 100644 --- a/src/views/quotation/edit.vue +++ b/src/views/quotation/edit.vue @@ -2,7 +2,15 @@
+
+ + + + + + +
@@ -167,6 +175,10 @@ import { apiQuotationAdd, apiQuotationEdit, apiQuotationDetail } from '@/api/quo import { timeFormat } from '@/utils/util' import customDialog1 from '@/components/product/index.vue' import reviewprocess from '@/components/reviewprocess/index.vue' +const list1 = reactive([]) +const list2 = reactive([]) +import { deptAll } from '@/api/org/department' +import { getAll } from '@/api/org/organization' import type { PropType } from 'vue' defineProps({ dictData: { @@ -210,10 +222,37 @@ const delFileFn = (index: number) => { const popupTitle = computed(() => { return mode.value == 'edit' ? '编辑报价单' : '新增报价单' }) +//获取所有组织 +const getlist = () => { + getAll().then((res) => { + Object.assign(list1, res) + if (res.length > 0 && !formData.org_id) { + formData.org_id = res[0].id + deptAll({ 'org_id': res[0].id }).then((res) => { + if (res.length > 0) { + Object.assign(list2, res) + formData.dept_id = res[0].id + } + }) + } + }) +} +//获取部门 +const deptrmt = (e) => { + getlist1(e) +} +//获取所有部门 +const getlist1 = (id: any) => { + deptAll({ 'org_id': id }).then((res) => { + Object.assign(list2, res) + }) +} // 表单数据 const formData = reactive({ id: '', + dept_id: '', + org_id: '', customer_id: '', quotation_date: '', contacts: '', @@ -269,6 +308,9 @@ const setFormData = async (data: Record) => { }); Object.assign(formDataannex, arry1) } + if (formData.dept_id) { + getlist1(formData.dept_id) + } customer_name.value = data.custom.name for (const key in formData) { if (data[key] != null && data[key] != undefined) { @@ -329,6 +371,7 @@ const handleSubmit = async () => { const open = (type = 'add') => { mode.value = type popupRef.value?.open() + getlist() } // 关闭回调 diff --git a/src/views/subcontract/edit.vue b/src/views/subcontract/edit.vue index dd26efe..03152dd 100644 --- a/src/views/subcontract/edit.vue +++ b/src/views/subcontract/edit.vue @@ -206,7 +206,7 @@ const popupTitle = computed(() => { const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) { diff --git a/src/views/subcontracting_contract/edit.vue b/src/views/subcontracting_contract/edit.vue index 4e7c84f..52f0c69 100644 --- a/src/views/subcontracting_contract/edit.vue +++ b/src/views/subcontracting_contract/edit.vue @@ -350,7 +350,7 @@ const formRules = reactive({ const getlist = () => { getAll().then((res) => { Object.assign(list1, res) - if (res.length > 0) { + if (res.length > 0 && !formData.org_id) { formData.org_id = res[0].id deptAll({ 'org_id': res[0].id }).then((res) => { if (res.length > 0) {