代码跟新
This commit is contained in:
parent
0a5a42552a
commit
81425ea2be
0
src/views/cost_budget_adjust/detail.vue
Normal file
0
src/views/cost_budget_adjust/detail.vue
Normal file
481
src/views/cost_budget_adjust/edit.vue
Normal file
481
src/views/cost_budget_adjust/edit.vue
Normal file
@ -0,0 +1,481 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="90%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-card class="mb-2">
|
||||
<!-- <div class="tit">客户基本资料</div> -->
|
||||
<div class="tit">
|
||||
<el-steps :active="active" finish-status="success">
|
||||
<el-step title="会计" />
|
||||
<el-step title="财务负责人" />
|
||||
<el-step title="总经理" />
|
||||
</el-steps>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="年份" prop="years">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.years" clearable type="year" value-format="YYYY" placeholder="选择年份">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制单时间" prop="document_preparation_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.document_preparation_time" clearable type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择制单时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总合计" prop="date">
|
||||
<el-input v-model="totalmoeny" readonly placeholder="请输入总合计"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" :key="index" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
|
||||
|
||||
<el-card class="mb-2">
|
||||
<div class="tit">预算明细</div>
|
||||
<el-table :data="tableData" :summary-method="getSummaries" show-summary>
|
||||
<el-table-column label="序号" width="105px">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)" size="small">+</el-button>
|
||||
<el-button @click="handleDelete(row)" size="small">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="一级科目" prop="name1">
|
||||
<template #default="{ row, column, $index }">
|
||||
<el-input v-model="row.name1" @click="subjectmu(row, column, $index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="二级科目" prop="name2">
|
||||
<template #default="{ row }"> <el-input v-model="row.name2" /> </template></el-table-column>
|
||||
<el-table-column label="1月" prop="month1">
|
||||
<template #default="{ row }"> <el-input v-model="row.month1" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="2月" prop="month2">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month2" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="3月" prop="month3">
|
||||
<template #default="{ row }"> <el-input v-model="row.month3" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="4月" prop="month4">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month4" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="5月" prop="month5">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month5" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="6月" prop="month6">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month6" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="7月" prop="month7">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month7" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="8月" prop="month8">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month8" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="9月" prop="month9">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month9" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="10月" prop="month10">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month10" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="11月" prop="month11">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month11" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="12月" prop="month12">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month12" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 其他列 -->
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</el-form>
|
||||
<reviewprocess :list="list" />
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择科目" width="70%">
|
||||
<costDialog @customEvent="customEvent"></costDialog>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customEdit">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiadjustAdd, apiadjustEdit, apiadjustDetail } from '@/api/cost_budget_adjust'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import reviewprocess from '@/components/reviewprocess/index.vue'
|
||||
import costDialog from '@/components/cost_subject/index.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import type { TableColumnCtx } from 'element-plus'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
const formDataannex = reactive([])
|
||||
const totalmoeny = ref('')
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
const num = ref(0)
|
||||
interface Product {
|
||||
id: string
|
||||
name1: string
|
||||
name2: string
|
||||
month1: number
|
||||
month2: number
|
||||
month3: number
|
||||
month4: number
|
||||
month5: number
|
||||
month6: number
|
||||
month7: number
|
||||
month8: number
|
||||
month9: number
|
||||
month10: number
|
||||
month11: number
|
||||
month12: number
|
||||
}
|
||||
|
||||
interface SummaryMethodProps<T = Product> {
|
||||
columns: TableColumnCtx<T>[]
|
||||
data: T[]
|
||||
}
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
dept_id: '',
|
||||
org_id: '',
|
||||
approve_id: 0,
|
||||
years: "",
|
||||
document_preparation_time: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
detail: [
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
//科目
|
||||
const subjectmu = (row, i, a) => {
|
||||
// console.log(row, i, a)
|
||||
num.value = a
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
const tableData = ref([
|
||||
// 表格数据
|
||||
{ name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', },
|
||||
]);
|
||||
const getSummaries = (param: SummaryMethodProps) => {
|
||||
const { columns, data } = param
|
||||
const sums: string[] = []
|
||||
columns.map((column, index) => {
|
||||
|
||||
if (column.label == '序号') {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
if (column.label == '一级科目') {
|
||||
sums[index] = ''
|
||||
return
|
||||
}
|
||||
if (column.label === '二级科目') {
|
||||
sums[index] = ''
|
||||
return
|
||||
}
|
||||
// console.log(columns)
|
||||
const values = data.map((item: any) => Number(item[column.property]))
|
||||
console.log(values)
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
|
||||
sums[index] = `${values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)}`
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
})
|
||||
if (sums.length > 0) {
|
||||
const kkarr1 = sums.slice(3, sums.length)
|
||||
const kkarr2 = kkarr1.map((item: any) => Number(item))
|
||||
totalmoeny.value = kkarr2.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
|
||||
}
|
||||
return sums
|
||||
}
|
||||
|
||||
|
||||
const handleAdd = (row) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index + 1, 0, { name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', });
|
||||
};
|
||||
|
||||
const handleDelete = (row) => {
|
||||
// 删除 row
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index, 1);
|
||||
};
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const active = ref(0)
|
||||
const showDialog = ref(false)
|
||||
|
||||
const next = () => {
|
||||
if (active.value++ > 2) active.value = 0
|
||||
}
|
||||
const list = reactive([])
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
const customEvent = (e: any) => {
|
||||
tableData.value[num.value].name1 = e.subject1;
|
||||
tableData.value[num.value].name2 = e.subject2;
|
||||
tableData.value[num.value].cost_subject_id = e.id;
|
||||
|
||||
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑公司年度管理费用预算调整' : '新增公司年度管理费用预算调整'
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
|
||||
}
|
||||
if (data.detail && data.detail.length > 0) {
|
||||
tableData.value = data.detail.map((item, i) => {
|
||||
if (item.subject && item.subject.subject1) {
|
||||
item.name1 = item.subject.subject1
|
||||
}
|
||||
if (item.subject && item.subject.subject2) {
|
||||
item.name2 = item.subject.subject2
|
||||
}
|
||||
|
||||
return item
|
||||
})
|
||||
// console.log(arry2, '22222222')
|
||||
}
|
||||
// console.log(formData, '2222222222')
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiadjustDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
//获取所有组织
|
||||
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: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
// console.log(tableData.value)
|
||||
// formData.detail=
|
||||
if (tableData.value.length > 0) {
|
||||
const arr1 = tableData.value.map(({ name1, name2, ...rest }) => rest)
|
||||
Object.assign(formData.detail, arr1)
|
||||
}
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiadjustEdit(data)
|
||||
: await apiadjustAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
206
src/views/cost_budget_adjust/index.vue
Normal file
206
src/views/cost_budget_adjust/index.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="年份" prop="years">
|
||||
<el-date-picker v-model="queryParams.years" clearable type="year" value-format="YYYY" placeholder="选择年份">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="制单时间" prop="document_preparation_time">
|
||||
<el-date-picker class="" v-model="queryParams.document_preparation_time" clearable type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择制单时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['costbudget.costbudget/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['costbudget.costbudget/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
|
||||
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="序号" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="流程编号" prop="custom_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.custom_type" :value="row.custom_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
>
|
||||
<el-table-column label="制单时间" prop="document_preparation_time" show-overflow-tooltip />
|
||||
<el-table-column label="年份" prop="years" show-overflow-tooltip />
|
||||
<el-table-column label="总合计" prop="total" show-overflow-tooltip />
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column label="1月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="2月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="3月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column label="4月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="5月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="6月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="7月合计" show-overflow-tooltip />
|
||||
<el-table-column label="7月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="7月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="8月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="9月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="10月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="11月合计" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="12月合计" show-overflow-tooltip />
|
||||
<el-table-column label="备注" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="附件" show-overflow-tooltip />
|
||||
|
||||
</el-table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiadjustLists, apiadjustDelete, apiadjustDetail } from '@/api/cost_budget_adjust'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const list = reactive([
|
||||
{
|
||||
name: "全部客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "私有客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日新增",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日分配公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
|
||||
{
|
||||
name: "今日应联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日未联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日已联系",
|
||||
count: 1000,
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: '',
|
||||
custom_type: '',
|
||||
phone: '',
|
||||
credit_rating: '',
|
||||
province: '',
|
||||
city: '',
|
||||
status: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('custom_type,credit_rating')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiadjustLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiadjustDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiadjustDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
0
src/views/cost_budget_adjust_detail/detail.vue
Normal file
0
src/views/cost_budget_adjust_detail/detail.vue
Normal file
486
src/views/cost_budget_adjust_detail/edit.vue
Normal file
486
src/views/cost_budget_adjust_detail/edit.vue
Normal file
@ -0,0 +1,486 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="90%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-card class="mb-2">
|
||||
<!-- <div class="tit">客户基本资料</div> -->
|
||||
<div class="tit">
|
||||
<el-steps :active="active" finish-status="success">
|
||||
<el-step title="会计" />
|
||||
<el-step title="财务负责人" />
|
||||
<el-step title="总经理" />
|
||||
</el-steps>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="年份" prop="years">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.years" clearable type="year" value-format="YYYY" placeholder="选择年份">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制单时间" prop="document_preparation_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.document_preparation_time" clearable type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择制单时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总合计" prop="date">
|
||||
<el-input v-model="totalmoeny" readonly placeholder="请输入总合计"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" :key="index" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
|
||||
|
||||
<el-card class="mb-2">
|
||||
<div class="tit">预算明细</div>
|
||||
<el-table :data="tableData" :summary-method="getSummaries" show-summary>
|
||||
<el-table-column label="序号" width="105px">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)" size="small">+</el-button>
|
||||
<el-button @click="handleDelete(row)" size="small">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="一级科目" prop="name1">
|
||||
<template #default="{ row, column, $index }">
|
||||
<el-input v-model="row.name1" @click="subjectmu(row, column, $index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="二级科目" prop="name2">
|
||||
<template #default="{ row }"> <el-input v-model="row.name2" /> </template></el-table-column>
|
||||
<el-table-column label="1月" prop="month1">
|
||||
<template #default="{ row }"> <el-input v-model="row.month1" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="2月" prop="month2">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month2" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="3月" prop="month3">
|
||||
<template #default="{ row }"> <el-input v-model="row.month3" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="4月" prop="month4">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month4" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="5月" prop="month5">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month5" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="6月" prop="month6">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month6" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="7月" prop="month7">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month7" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="8月" prop="month8">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month8" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="9月" prop="month9">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month9" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="10月" prop="month10">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month10" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="11月" prop="month11">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month11" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="12月" prop="month12">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month12" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 其他列 -->
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</el-form>
|
||||
<reviewprocess :list="list" />
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择科目" width="70%">
|
||||
<costDialog @customEvent="customEvent"></costDialog>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customEdit">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomAdd, apiCustomEdit, apiCustomDetail } from '@/api/cost_budget'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import reviewprocess from '@/components/reviewprocess/index.vue'
|
||||
import costDialog from '@/components/cost_subject/index.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import type { TableColumnCtx } from 'element-plus'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
const formDataannex = reactive([])
|
||||
const totalmoeny = ref('')
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
const num = ref(0)
|
||||
interface Product {
|
||||
id: string
|
||||
name1: string
|
||||
name2: string
|
||||
month1: number
|
||||
month2: number
|
||||
month3: number
|
||||
month4: number
|
||||
month5: number
|
||||
month6: number
|
||||
month7: number
|
||||
month8: number
|
||||
month9: number
|
||||
month10: number
|
||||
month11: number
|
||||
month12: number
|
||||
}
|
||||
|
||||
interface SummaryMethodProps<T = Product> {
|
||||
columns: TableColumnCtx<T>[]
|
||||
data: T[]
|
||||
}
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
dept_id: '',
|
||||
org_id: '',
|
||||
approve_id: 0,
|
||||
years: "",
|
||||
document_preparation_time: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
detail: [
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
//科目
|
||||
const subjectmu = (row, i, a) => {
|
||||
// console.log(row, i, a)
|
||||
num.value = a
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
const tableData = ref([
|
||||
// 表格数据
|
||||
{ name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', },
|
||||
]);
|
||||
const getSummaries = (param: SummaryMethodProps) => {
|
||||
const { columns, data } = param
|
||||
const sums: string[] = []
|
||||
columns.map((column, index) => {
|
||||
|
||||
if (column.label == '序号') {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
if (column.label == '一级科目') {
|
||||
sums[index] = ''
|
||||
return
|
||||
}
|
||||
if (column.label === '二级科目') {
|
||||
sums[index] = ''
|
||||
return
|
||||
}
|
||||
// console.log(columns)
|
||||
const values = data.map((item: any) => Number(item[column.property]))
|
||||
// console.log(values)
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
|
||||
sums[index] = `${values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)}`
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
})
|
||||
if (sums.length > 0) {
|
||||
const kkarr1 = sums.slice(3, sums.length)
|
||||
const kkarr2 = kkarr1.map((item: any) => Number(item))
|
||||
totalmoeny.value = kkarr2.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// totalmoeny
|
||||
return sums
|
||||
}
|
||||
|
||||
|
||||
const handleAdd = (row) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index + 1, 0, { name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', });
|
||||
};
|
||||
|
||||
const handleDelete = (row) => {
|
||||
// 删除 row
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index, 1);
|
||||
};
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const active = ref(0)
|
||||
const showDialog = ref(false)
|
||||
|
||||
const next = () => {
|
||||
if (active.value++ > 2) active.value = 0
|
||||
}
|
||||
const list = reactive([])
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
const customEvent = (e: any) => {
|
||||
tableData.value[num.value].name1 = e.subject1;
|
||||
tableData.value[num.value].name2 = e.subject2;
|
||||
tableData.value[num.value].cost_subject_id = e.id;
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑公司年度管理费用预算' : '新增公司年度管理费用预算'
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
|
||||
}
|
||||
if (data.detail && data.detail.length > 0) {
|
||||
tableData.value = data.detail.map((item, i) => {
|
||||
if (item.subject && item.subject.subject1) {
|
||||
item.name1 = item.subject.subject1
|
||||
}
|
||||
if (item.subject && item.subject.subject2) {
|
||||
item.name2 = item.subject.subject2
|
||||
}
|
||||
|
||||
return item
|
||||
})
|
||||
// console.log(arry2, '22222222')
|
||||
}
|
||||
if (data.dept_id) {
|
||||
getlist1(data.dept_id)
|
||||
}
|
||||
|
||||
// console.log(formData, '2222222222')
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
//获取所有组织
|
||||
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: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
// console.log(tableData.value)
|
||||
// formData.detail=
|
||||
if (tableData.value.length) {
|
||||
const arr1 = tableData.value.map(({ name1, name2, ...rest }) => rest)
|
||||
Object.assign(formData.detail, arr1)
|
||||
}
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiCustomEdit(data)
|
||||
: await apiCustomAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
167
src/views/cost_budget_adjust_detail/index.vue
Normal file
167
src/views/cost_budget_adjust_detail/index.vue
Normal file
@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="费用科目" prop="cost_subject_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.cost_subject_ide" clearable placeholder="请选择费用科目">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in subjectlist" :key="index" :label="item.sn" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
|
||||
<div class="mt-4">
|
||||
|
||||
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
|
||||
<el-table-column label="序号" type="index" show-overflow-tooltip width="65" />
|
||||
<!-- <el-table-column label="流程编号" prop="custom_type">
|
||||
<template #default="{ row }">
|
||||
{{ row }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="预算明细ID" prop="id" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="制单时间" prop="document_preparation_time" width="155" show-overflow-tooltip />
|
||||
<el-table-column label="年份" prop="years" show-overflow-tooltip width="155" />
|
||||
<el-table-column label="一级科目" prop="subject1" show-overflow-tooltip width="155" />
|
||||
<el-table-column label="二级科目" prop="subject2" show-overflow-tooltip width="155" />
|
||||
<el-table-column label="1月合计" prop="month1" show-overflow-tooltip />
|
||||
<el-table-column label="2月合计" prop="month2" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="3月合计" prop="month3" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="4月合计" prop="month4" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="5月合计" prop="month5" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="6月合计" prop="month6" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="7月合计" prop="month7" show-overflow-tooltip />
|
||||
<el-table-column label="7月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="7月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="8月合计" prop="month8" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="9月合计" prop="month9" show-overflow-tooltip width="100" />
|
||||
|
||||
|
||||
<el-table-column label="10月合计" prop="month10" show-overflow-tooltip width="100" />
|
||||
|
||||
|
||||
<el-table-column label="11月合计" prop="month11" show-overflow-tooltip width="100" />
|
||||
|
||||
|
||||
<el-table-column label="12月合计" prop="month12" show-overflow-tooltip width="100" />
|
||||
<!-- <el-table-column label="备注" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="附件" show-overflow-tooltip /> -->
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiadjustdetailDetail } from '@/api/cost_budget_adjust'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { apisubjectLists } from '@/api/cost_subject'
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const subjectlist = ref([])
|
||||
const list = reactive([
|
||||
{
|
||||
name: "全部客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "私有客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日新增",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日分配公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
|
||||
{
|
||||
name: "今日应联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日未联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日已联系",
|
||||
count: 1000,
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
cost_subject_id: '',
|
||||
cost_budget_id: '',
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiadjustdetailDetail,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
//获取科目
|
||||
const getsubiect = () => {
|
||||
apisubjectLists({ page_no: 1, page_size: 120 }).then((res) => {
|
||||
subjectlist.value = res.lists
|
||||
})
|
||||
}
|
||||
getsubiect()
|
||||
getLists()
|
||||
</script>
|
||||
|
0
src/views/costbudget/detail.vue
Normal file
0
src/views/costbudget/detail.vue
Normal file
486
src/views/costbudget/edit.vue
Normal file
486
src/views/costbudget/edit.vue
Normal file
@ -0,0 +1,486 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="90%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-card class="mb-2">
|
||||
<!-- <div class="tit">客户基本资料</div> -->
|
||||
<div class="tit">
|
||||
<el-steps :active="active" finish-status="success">
|
||||
<el-step title="会计" />
|
||||
<el-step title="财务负责人" />
|
||||
<el-step title="总经理" />
|
||||
</el-steps>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="年份" prop="years">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.years" clearable type="year" value-format="YYYY" placeholder="选择年份">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制单时间" prop="document_preparation_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.document_preparation_time" clearable type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择制单时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总合计" prop="date">
|
||||
<el-input v-model="totalmoeny" readonly placeholder="请输入总合计"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" :key="index" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
|
||||
|
||||
<el-card class="mb-2">
|
||||
<div class="tit">预算明细</div>
|
||||
<el-table :data="tableData" :summary-method="getSummaries" show-summary>
|
||||
<el-table-column label="序号" width="105px">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)" size="small">+</el-button>
|
||||
<el-button @click="handleDelete(row)" size="small">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="一级科目" prop="name1">
|
||||
<template #default="{ row, column, $index }">
|
||||
<el-input v-model="row.name1" @click="subjectmu(row, column, $index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="二级科目" prop="name2">
|
||||
<template #default="{ row }"> <el-input v-model="row.name2" /> </template></el-table-column>
|
||||
<el-table-column label="1月" prop="month1">
|
||||
<template #default="{ row }"> <el-input v-model="row.month1" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="2月" prop="month2">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month2" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="3月" prop="month3">
|
||||
<template #default="{ row }"> <el-input v-model="row.month3" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="4月" prop="month4">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month4" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="5月" prop="month5">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month5" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="6月" prop="month6">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month6" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="7月" prop="month7">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month7" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="8月" prop="month8">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month8" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="9月" prop="month9">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month9" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="10月" prop="month10">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month10" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="11月" prop="month11">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month11" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="12月" prop="month12">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month12" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 其他列 -->
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</el-form>
|
||||
<reviewprocess :list="list" />
|
||||
</popup>
|
||||
<el-dialog v-model="showDialog" title="选择科目" width="70%">
|
||||
<costDialog @customEvent="customEvent"></costDialog>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customEdit">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomAdd, apiCustomEdit, apiCustomDetail } from '@/api/cost_budget'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import reviewprocess from '@/components/reviewprocess/index.vue'
|
||||
import costDialog from '@/components/cost_subject/index.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import type { TableColumnCtx } from 'element-plus'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
const formDataannex = reactive([])
|
||||
const totalmoeny = ref('')
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
const num = ref(0)
|
||||
interface Product {
|
||||
id: string
|
||||
name1: string
|
||||
name2: string
|
||||
month1: number
|
||||
month2: number
|
||||
month3: number
|
||||
month4: number
|
||||
month5: number
|
||||
month6: number
|
||||
month7: number
|
||||
month8: number
|
||||
month9: number
|
||||
month10: number
|
||||
month11: number
|
||||
month12: number
|
||||
}
|
||||
|
||||
interface SummaryMethodProps<T = Product> {
|
||||
columns: TableColumnCtx<T>[]
|
||||
data: T[]
|
||||
}
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
dept_id: '',
|
||||
org_id: '',
|
||||
approve_id: 0,
|
||||
years: "",
|
||||
document_preparation_time: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
detail: [
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
//科目
|
||||
const subjectmu = (row, i, a) => {
|
||||
// console.log(row, i, a)
|
||||
num.value = a
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
const tableData = ref([
|
||||
// 表格数据
|
||||
{ name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', },
|
||||
]);
|
||||
const getSummaries = (param: SummaryMethodProps) => {
|
||||
const { columns, data } = param
|
||||
const sums: string[] = []
|
||||
columns.map((column, index) => {
|
||||
|
||||
if (column.label == '序号') {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
if (column.label == '一级科目') {
|
||||
sums[index] = ''
|
||||
return
|
||||
}
|
||||
if (column.label === '二级科目') {
|
||||
sums[index] = ''
|
||||
return
|
||||
}
|
||||
// console.log(columns)
|
||||
const values = data.map((item: any) => Number(item[column.property]))
|
||||
// console.log(values)
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
|
||||
sums[index] = `${values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)}`
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
})
|
||||
if (sums.length > 0) {
|
||||
const kkarr1 = sums.slice(3, sums.length)
|
||||
const kkarr2 = kkarr1.map((item: any) => Number(item))
|
||||
totalmoeny.value = kkarr2.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// totalmoeny
|
||||
return sums
|
||||
}
|
||||
|
||||
|
||||
const handleAdd = (row) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index + 1, 0, { name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', });
|
||||
};
|
||||
|
||||
const handleDelete = (row) => {
|
||||
// 删除 row
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index, 1);
|
||||
};
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const active = ref(0)
|
||||
const showDialog = ref(false)
|
||||
|
||||
const next = () => {
|
||||
if (active.value++ > 2) active.value = 0
|
||||
}
|
||||
const list = reactive([])
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
const customEvent = (e: any) => {
|
||||
tableData.value[num.value].name1 = e.subject1;
|
||||
tableData.value[num.value].name2 = e.subject2;
|
||||
tableData.value[num.value].cost_subject_id = e.id;
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑公司年度管理费用预算' : '新增公司年度管理费用预算'
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
|
||||
}
|
||||
if (data.detail && data.detail.length > 0) {
|
||||
tableData.value = data.detail.map((item, i) => {
|
||||
if (item.subject && item.subject.subject1) {
|
||||
item.name1 = item.subject.subject1
|
||||
}
|
||||
if (item.subject && item.subject.subject2) {
|
||||
item.name2 = item.subject.subject2
|
||||
}
|
||||
|
||||
return item
|
||||
})
|
||||
// console.log(arry2, '22222222')
|
||||
}
|
||||
if (data.dept_id) {
|
||||
getlist1(data.dept_id)
|
||||
}
|
||||
|
||||
// console.log(formData, '2222222222')
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
//获取所有组织
|
||||
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: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
// console.log(tableData.value)
|
||||
// formData.detail=
|
||||
if (tableData.value.length) {
|
||||
const arr1 = tableData.value.map(({ name1, name2, ...rest }) => rest)
|
||||
Object.assign(formData.detail, arr1)
|
||||
}
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiCustomEdit(data)
|
||||
: await apiCustomAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
228
src/views/costbudget/index.vue
Normal file
228
src/views/costbudget/index.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="年份" prop="years">
|
||||
<el-date-picker v-model="queryParams.years" clearable type="year" value-format="YYYY" placeholder="选择年份">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="制单时间" prop="document_preparation_time">
|
||||
<el-date-picker class="" v-model="queryParams.document_preparation_time" clearable type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择制单时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['costbudget.costbudget/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['costbudget.costbudget/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
|
||||
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="查看" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="客户属性" prop="custom_type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.custom_type" :value="row.custom_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程编号" prop="province_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="制单时间" prop="document_preparation_time" show-overflow-tooltip />
|
||||
<el-table-column label="年份" prop="years" show-overflow-tooltip />
|
||||
<el-table-column label="总合计" prop="total" show-overflow-tooltip />
|
||||
<el-table-column label="总已发生" prop="master_notes" show-overflow-tooltip />
|
||||
<el-table-column label="负责人" show-overflow-tooltip />
|
||||
<el-table-column label="总剩余" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="备注" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="1月合计" show-overflow-tooltip />
|
||||
<el-table-column label="1月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="1月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="2月合计" show-overflow-tooltip />
|
||||
<el-table-column label="2月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="2月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="3月合计" show-overflow-tooltip />
|
||||
<el-table-column label="3月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="3月剩余" show-overflow-tooltip />
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column label="4月合计" show-overflow-tooltip />
|
||||
<el-table-column label="4月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="4月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="5月合计" show-overflow-tooltip />
|
||||
<el-table-column label="5月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="5月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="6月合计" show-overflow-tooltip />
|
||||
<el-table-column label="6月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="6月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="7月合计" show-overflow-tooltip />
|
||||
<el-table-column label="7月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="7月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="8月合计" show-overflow-tooltip />
|
||||
<el-table-column label="8月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="8月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="9月合计" show-overflow-tooltip />
|
||||
<el-table-column label="9月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="9月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="10月合计" show-overflow-tooltip />
|
||||
<el-table-column label="10月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="10月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="11月合计" show-overflow-tooltip />
|
||||
<el-table-column label="11月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="11月剩余" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="12月合计" show-overflow-tooltip />
|
||||
<el-table-column label="12月已发生" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="12月剩余" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['costbudget.costbudget/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['costbudget.costbudget/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="costbudget">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiCustomLists, apiCustomDelete, apiCustomDetail } from '@/api/cost_budget'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const list = reactive([
|
||||
{
|
||||
name: "全部客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "私有客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日新增",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日分配公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
|
||||
{
|
||||
name: "今日应联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日未联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日已联系",
|
||||
count: 1000,
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
years: '',
|
||||
document_preparation_time: '',
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCustomLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiCustomDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiCustomDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
108
src/views/expenseaccount/edit.vue
Normal file
108
src/views/expenseaccount/edit.vue
Normal file
@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="科目编码" prop="sn">
|
||||
<el-input v-model="formData.sn" clearable placeholder="请输入科目编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="一级科目" prop="subject1">
|
||||
<el-input v-model="formData.subject1" clearable placeholder="请输入一级科目" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二级科目" prop="subject2">
|
||||
<el-input v-model="formData.subject2" clearable placeholder="请输入二级科目" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customFollowEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apisubjectAdd, apisubjectEdit, apisubjectDetail } from '@/api/cost_subject'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑费用科目' : '新增费用科目'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
sn: '',
|
||||
subject1: '',
|
||||
subject2: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apisubjectDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apisubjectEdit(data)
|
||||
: await apisubjectAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
161
src/views/expenseaccount/index.vue
Normal file
161
src/views/expenseaccount/index.vue
Normal file
@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="科目编码" prop="sn">
|
||||
<el-input class="w-[280px]" v-model="queryParams.sn" clearable placeholder="请输入科目编码" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="一级科目" prop="subject1">
|
||||
<el-input class="w-[280px]" v-model="queryParams.subject1" clearable placeholder="请输入一级科目" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['expense.expense/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['expense.expense/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
|
||||
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="序号" type="index" width="105" show-overflow-tooltip />
|
||||
<el-table-column label="科目编码" prop="sn" show-overflow-tooltip />
|
||||
<el-table-column label="一级科目" prop="subject1" show-overflow-tooltip />
|
||||
<el-table-column label="二级科目 " prop="subject2" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['expense.expense/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['expense.expense/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apisubjectLists, apisubjectDelete, apisubjectDetail } from '@/api/cost_subject'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const list = reactive([
|
||||
{
|
||||
name: "全部客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "私有客户",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日新增",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日分配公海客户",
|
||||
count: 1000,
|
||||
},
|
||||
|
||||
{
|
||||
name: "今日应联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日未联系",
|
||||
count: 1000,
|
||||
},
|
||||
{
|
||||
name: "今日已联系",
|
||||
count: 1000,
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
sn: '',
|
||||
subject1: '',
|
||||
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('custom_type,credit_rating')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apisubjectLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apisubjectDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apisubjectDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -0,0 +1,364 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="administrative_contract_id" @click="showDialog1 = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="administrative_contract_id">
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称" rop="administrative_contract_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="supplier_name" readonly clearable placeholder="请选择客户" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" rop="administrative_contract_id">
|
||||
<el-input v-model="supplier_no" readonly clearable placeholder="请选择客户" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请人" prop="applier">
|
||||
<el-input v-model="formData.applier" clearable placeholder="请输入提交人" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请日期" prop="apply_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.apply_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择开票日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="付款方式" prop="pay_type" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
<el-radio-group v-model="formData.pay_type" placeholder="请选择付款方式">
|
||||
<el-radio v-for="(item, index) in dictData.pay_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合计已付款" prop="invoice_sn">
|
||||
<el-input v-model="formData.invoice_sn" readonly clearable placeholder="请输入合计已付款" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本次支付比例(%)" prop="payment_rate">
|
||||
<el-input v-model="formData.payment_rate" clearable placeholder="请输入本次支付比例(%)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本次支付金额" prop="payment_amount">
|
||||
<el-input v-model="formData.payment_amount" clearable placeholder="请输入支付金额" @input="amountinput" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="invoice_amount_daxie">
|
||||
<el-input v-model="invoice_amount_daxie" readonly clearable placeholder="请输入金额大写" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field87">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="tit">收款人信息</div>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户名称" prop="account_name">
|
||||
<el-input v-model="formData.account_name" clearable placeholder="请输入开户名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行" prop="deposit_bank">
|
||||
<el-input v-model="formData.deposit_bank" clearable placeholder="请输入开户银行" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账号" prop="account">
|
||||
<el-input v-model="formData.account" clearable placeholder="请输入账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
|
||||
<salescontractDialog @customEvent="customEvent1"></salescontractDialog>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import salescontractDialog from '@/components/administrative/index.vue'
|
||||
|
||||
import { adminpaymentsAdd, adminpaymentsEdit, adminpaymentsDetail } from '@/api/administrativePayments'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import type { PropType } from 'vue'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const active = ref(0)
|
||||
const formDataannex = reactive([])
|
||||
const contract_name = ref('')
|
||||
const invoice_amount_daxie = ref('')
|
||||
const contract_no = ref('')
|
||||
const supplier_name = ref('')
|
||||
const supplier_no = ref('')
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
const userInfo = userStore.userInfo
|
||||
console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const amount_daxie = ref('')
|
||||
const showDialog1 = ref(false)
|
||||
|
||||
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.administrative_contract_id = e.id;
|
||||
contract_name.value = e.contract_name;
|
||||
contract_no.value = e.contract_no;
|
||||
supplier_name.value = e.contract_name;
|
||||
supplier_no.value = e.contract_no;
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
|
||||
//获取所有组织
|
||||
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: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
invoice_amount_daxie.value = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑行政付款表' : '新增行政付款表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
org_id: 0,
|
||||
dept_id: 0,
|
||||
approve_id: 0,
|
||||
administrative_contract_id: 0,
|
||||
applier: "",
|
||||
apply_date: "",
|
||||
pay_type: 0,
|
||||
payment_rate: "",
|
||||
payment_amount: "",
|
||||
deposit_bank: "",
|
||||
account_name: "",
|
||||
account: "",
|
||||
remark: "",
|
||||
annex: ""
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.return_desc && data.return_desc.length > 0) {
|
||||
|
||||
const arry1 = data.return_desc.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
supplier_name.value = data.contract.contract_name;
|
||||
supplier_no.value = data.contract.contract_no;
|
||||
contract_name.value = data.contract.contract_no;
|
||||
contract_no.value = data.contract.contract_no
|
||||
|
||||
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await adminpaymentsDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.return_desc = formDataannex.map((item: any) => item.uri).toString()
|
||||
}
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await adminpaymentsEdit(data)
|
||||
: await adminpaymentsAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
432
src/views/financialManagement/draft/acceptance_bill/edit.vue
Normal file
432
src/views/financialManagement/draft/acceptance_bill/edit.vue
Normal file
@ -0,0 +1,432 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="组织" prop="org_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-select v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select> </el-form-item></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="请选择部门" prop="dept_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-select v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select></el-form-item> </el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customer_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" @click="showDialog = true">
|
||||
<el-input v-model="customer_name" readonly clearable placeholder="请输入客户名称" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id" @click="showDialog1 = true">
|
||||
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="project_id">
|
||||
<el-input v-model="project_code" clearable placeholder="请输入项目编码" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="reimburser" @click="showDialog2 = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请输入合同名称" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编码" prop="reimburser">
|
||||
<el-input v-model="contract_no" readonly clearable placeholder="请输入合同编码" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-select v-model="contract_type" clearable placeholder="请选择合同类型">
|
||||
<el-option v-for="(item, index) in dictData.contract_type" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收票日期" prop="receipt_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.receipt_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择收票日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="票据编号" prop="bill_sn" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.bill_sn" clearable placeholder="请输入票据编号" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收票银行" prop="bank_account_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="acceptance_bank" clearable placeholder="请输入收票银行" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收票账户编码" prop="bank_account_id">
|
||||
<el-input v-model="acceptance_bank_no" clearable placeholder="请输入收票账户编码" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="汇票类型" prop="bill_type" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-radio-group v-model="formData.bill_type" placeholder="请选择汇票类型">
|
||||
<el-radio v-for="(item, index) in dictData.bill_type" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="汇票承兑银行" prop="draft_acceptance_bank" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.draft_acceptance_bank" clearable placeholder="请输入汇票承兑银行" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="汇票到期日期" prop="bill_due_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.bill_due_date" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择汇票到期日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款金额" prop="receipt_amount" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.receipt_amount" clearable placeholder="请输入收款金额" @input="amountinput" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款金额大写" prop="receipt_amount_daxie" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.receipt_amount_daxie" readonly clearable placeholder="请输入收款金额大写" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field87">
|
||||
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||
<el-button type="primary">
|
||||
上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
|
||||
<projectDialog @customEvent="customEvent1" :customer_id="formData.customer_id"></projectDialog>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="showDialog2" title="选择销售合同" width="70%">
|
||||
<salescontract @customEvent="customEvent2" contract_type="2"></salescontract>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||
<customDialog @customEvent="customEvent"></customDialog>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="showDialog3" title="选择银行" width="70%">
|
||||
<bankaccountDialog @customEvent="customEvent3"></bankaccountDialog>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import projectDialog from '@/components/project/index.vue'
|
||||
import bankaccountDialog from '@/components/bankaccount/index.vue'
|
||||
import salescontractDialog from '@/components/salescontract/index.vue'
|
||||
import { acceptancebillAdd, acceptancebillEdit, acceptancebillDetail } from '@/api/acceptance'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import type { PropType } from 'vue'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const active = ref(0)
|
||||
const formDataannex = reactive([])
|
||||
const contract_name = ref('')
|
||||
const contract_no = ref('')
|
||||
const customer_name = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const contract_type = ref('')
|
||||
const acceptance_bank_no = ref('')
|
||||
const acceptance_bank = ref('')
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
|
||||
const userInfo = userStore.userInfo
|
||||
console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const amount_daxie = ref('')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
|
||||
const showDialog3 = ref(false)
|
||||
|
||||
|
||||
|
||||
|
||||
const customEvent = (e: any) => {
|
||||
formData.customer_id = e.id;
|
||||
customer_name.value = e.name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.contract_id = e.id;
|
||||
project_name.value = e.name;
|
||||
project_code.value = e.project_code;
|
||||
showDialog1.value = false;
|
||||
};
|
||||
const customEvent2 = (e: any) => {
|
||||
formData.project_id = e.id
|
||||
contract_name.value = e.contract_name;
|
||||
contract_no.value = e.contract_code;
|
||||
contract_type.value = e.contract_type;
|
||||
|
||||
showDialog2.value = false;
|
||||
};
|
||||
|
||||
const customEvent3 = (e: any) => {
|
||||
|
||||
|
||||
showDialog3.value = false;
|
||||
};
|
||||
|
||||
//获取所有组织
|
||||
const getlist = () => {
|
||||
getAll().then((res) => {
|
||||
Object.assign(list1, res)
|
||||
|
||||
})
|
||||
}
|
||||
//获取部门
|
||||
const deptrmt = (e: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.receipt_amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑承兑汇票报销表' : '新增承兑汇票表'
|
||||
})
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
org_id: '',
|
||||
dept_id: '',
|
||||
customer_id: 0,
|
||||
project_id: 0,
|
||||
contract_id: 0,
|
||||
receipt_date: "",
|
||||
bill_sn: "",
|
||||
bank_account_id: 0,
|
||||
bill_type: 0,
|
||||
draft_acceptance_bank: "",
|
||||
bill_due_date: "",
|
||||
receipt_amount: "",
|
||||
receipt_amount_daxie: "",
|
||||
remark: "",
|
||||
annex: ""
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
if (data.dept_id) {
|
||||
getlist1(data.dept_id)
|
||||
}
|
||||
contract_name.value = data.contract.contract_name;
|
||||
contract_no.value = data.contract.contract_code;
|
||||
project_name.value = data.project.name;
|
||||
project_code.value = data.project.project_code;
|
||||
contract_type.value = data.contract.contract_type;
|
||||
customer_name.value = data.custom.name
|
||||
acceptance_bank_no.value = data.bankAccount.account_sn
|
||||
acceptance_bank.value = data.bankAccount.deposit_bank
|
||||
if (data.reimbursement_amount) {
|
||||
toChinesNum(data.reimbursement_amount)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await acceptancebillDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await acceptancebillEdit(data)
|
||||
: await acceptancebillAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user