This commit is contained in:
zmj 2024-03-13 14:47:51 +08:00
parent 4612a09944
commit 725ee1ad25
268 changed files with 327 additions and 45958 deletions

View File

@ -1,5 +1,5 @@
NODE_ENV = 'development'
# VITE_APP_BASE_URL = 'https://ceshi-engineering.lihaink.cn/'
VITE_APP_BASE_URL = 'http://www.eng.local/'
VITE_APP_BASE_URL = 'https://ceshi-engineering.lihaink.cn/'
# VITE_APP_BASE_URL = 'http://www.eng.local/'
# VITE_APP_BASE_URL = 'http://192.168.1.5:9090/'

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,492 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="资产序列号" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产序列号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产名称" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产编号" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产编号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产类别" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产类别" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计量单位" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入计量单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产价格(元)" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产价格(元)" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="生产厂家" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入生产厂家" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="入账日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择入账日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="购入日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择购入日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出厂日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择出厂日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产来源" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产序列号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预计使用寿命(年)" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入预计使用寿命(年)" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单日成本价(元)" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入单日成本价(元)" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="存放地址" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入存放地址" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期初资产金额(元)" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入期初资产金额(元)" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期初折旧(元)" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入期初折旧(元)" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产状态" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产序列号" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">资产申请明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="申请数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
//
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 checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产采购表' : '新增资产采购表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,193 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="资产序列号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产编号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产名称" prop="project_code" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="资产类别" prop="tax" show-overflow-tooltip />
<el-table-column label="计量单位 " prop="tax" show-overflow-tooltip />
<el-table-column label="生产厂家" prop="tax" show-overflow-tooltip />
<el-table-column label="入账日期" prop="tax" show-overflow-tooltip />
<el-table-column label="购入日期 " prop="tax" show-overflow-tooltip />
<el-table-column label="出厂日期" prop="tax" show-overflow-tooltip />
<el-table-column label="资产来源" prop="tax" show-overflow-tooltip />
<el-table-column label="存放地址 " prop="tax" show-overflow-tooltip />
<el-table-column label="资产状态" prop="project_name" show-overflow-tooltip />
<el-table-column label="单日成本价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="资产金额" prop="tax" show-overflow-tooltip />
<el-table-column label="期初折旧" prop="tax" show-overflow-tooltip />
<el-table-column label="累计折旧 " prop="tax" show-overflow-tooltip />
<el-table-column label="处置金额" prop="tax" show-overflow-tooltip />
<el-table-column label="净值金额" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,360 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="资产序列号" prop="contract_id">
<el-input v-model="project_name" clearable readonly placeholder="点击选择[空闲]状态的资产" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产编号" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产名称" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格型号" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产类别" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计量单位" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="生产厂家" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产来源" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预计使用寿命" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="存放地址" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="送修日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择送修日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="送修人" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入送修人" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 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 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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产维修表' : '新增资产维修表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,196 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产维修单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产序列号" prop="tax" show-overflow-tooltip />
<el-table-column label="资产名称 " prop="tax" show-overflow-tooltip />
<el-table-column label="资产类别" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="计量单位 " prop="tax" show-overflow-tooltip />
<el-table-column label="生产厂家" prop="tax" show-overflow-tooltip />
<el-table-column label="送修日期" prop="tax" show-overflow-tooltip />
<el-table-column label="送修人 " prop="tax" show-overflow-tooltip />
<el-table-column label="送修原因" prop="project_name" show-overflow-tooltip />
<el-table-column label="送修前照片" prop="tax" show-overflow-tooltip />
<el-table-column label="维修完成日期" prop="tax" show-overflow-tooltip />
<el-table-column label="维修结果" prop="tax" show-overflow-tooltip />
<el-table-column label="维修结果说明" prop="tax" show-overflow-tooltip />
<el-table-column label="维修费用" prop="tax" show-overflow-tooltip />
<el-table-column label="送修后照片" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,405 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="项目名称" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产序列号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="领用日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择领用日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="领用人" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入领用人" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">资产领用明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="资产编号" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="资产名称" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="计量单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="生产厂家" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="出厂日期" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="存放地点" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="预计使用天数" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
//
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 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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产领用表' : '新增资产领用表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,190 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="资产领用单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="领用人" prop="project_code" show-overflow-tooltip />
<el-table-column label="领用日期" prop="tax" show-overflow-tooltip />
<el-table-column label="资产序列号" prop="tax" show-overflow-tooltip />
<el-table-column label="资产名称 " prop="tax" show-overflow-tooltip />
<el-table-column label="资产类别" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="计量单位 " prop="tax" show-overflow-tooltip />
<el-table-column label="生产厂家" prop="tax" show-overflow-tooltip />
<el-table-column label="出厂日期" prop="tax" show-overflow-tooltip />
<el-table-column label="存放地址 " prop="tax" show-overflow-tooltip />
<el-table-column label="预计使用天数" prop="project_name" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="是否归还" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,410 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="折旧日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD ">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="折旧人" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">资产折旧明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="资产名称" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="计量单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="出厂日期" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="资产金额" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="期初折旧" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="累计折旧" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="净值金额" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="折旧率(%) " prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="本次折旧金额" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
//
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 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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产折旧表' : '新增资产折旧表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,183 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产申请单号" prop="project_code" show-overflow-tooltip />
<el-table-column label="组织名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="部门名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="申请日期" prop="tax" show-overflow-tooltip />
<el-table-column label="希望到货日期" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,386 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="资产序列号" prop="contract_id">
<el-input v-model="project_name" clearable readonly placeholder="点击选择[空闲]状态的资产" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产编号" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产名称" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格型号" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产类别" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计量单位" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="生产厂家" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产来源" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预计使用寿命" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="存放地址" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出厂日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择出厂日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="购入日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择购入日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="处置日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择处置日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="处置方式" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入处置方式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="处置金额" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入处置金额" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 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 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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产处置表' : '新增资产处置表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,195 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产处置单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产序列号" prop="tax" show-overflow-tooltip />
<el-table-column label="资产名称 " prop="tax" show-overflow-tooltip />
<el-table-column label="资产类别" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="计量单位 " prop="tax" show-overflow-tooltip />
<el-table-column label="生产厂家" prop="tax" show-overflow-tooltip />
<el-table-column label="资产来源" prop="tax" show-overflow-tooltip />
<el-table-column label="预计使用寿命 " prop="tax" show-overflow-tooltip />
<el-table-column label="存放地址" prop="project_name" show-overflow-tooltip />
<el-table-column label="出厂日期" prop="tax" show-overflow-tooltip />
<el-table-column label="购入日期" prop="tax" show-overflow-tooltip />
<el-table-column label="处置日期" prop="tax" show-overflow-tooltip />
<el-table-column label="处置人" prop="tax" show-overflow-tooltip />
<el-table-column label="处置方式" prop="tax" show-overflow-tooltip />
<el-table-column label="处置原因" prop="tax" show-overflow-tooltip />
<el-table-column label="处置金额" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,410 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="申请人" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择申请日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="希望到货日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择希望到货日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">资产申请明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="申请数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
//
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 checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产采购表' : '新增资产采购表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,183 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产申请单号" prop="project_code" show-overflow-tooltip />
<el-table-column label="组织名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="部门名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="申请日期" prop="tax" show-overflow-tooltip />
<el-table-column label="希望到货日期" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,394 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="项目名称" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产序列号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_name" clearable placeholder="请输入资产名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">资产归还明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="资产名称" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="计量单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="领用日期" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="归还日期" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="归还人" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="使用天数" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单日成本" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="成本金额" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
//
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 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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产归还表' : '新增资产归还表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,198 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="资产归还单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产序列号" prop="tax" show-overflow-tooltip />
<el-table-column label="资产名称 " prop="tax" show-overflow-tooltip />
<el-table-column label="资产类别" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="计量单位 " prop="tax" show-overflow-tooltip />
<el-table-column label="生产厂家" prop="tax" show-overflow-tooltip />
<el-table-column label="出厂日期" prop="tax" show-overflow-tooltip />
<el-table-column label="存放地址 " prop="tax" show-overflow-tooltip />
<el-table-column label="预计使用天数" prop="project_name" show-overflow-tooltip />
<el-table-column label="领用日期" prop="tax" show-overflow-tooltip />
<el-table-column label="领用人" prop="tax" show-overflow-tooltip />
<el-table-column label="归还日期" prop="tax" show-overflow-tooltip />
<el-table-column label="归还人" prop="tax" show-overflow-tooltip />
<el-table-column label="存放地点" prop="tax" show-overflow-tooltip />
<el-table-column label="成本金额" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,382 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<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-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="资产序列号" prop="contract_id">
<el-input v-model="project_name" clearable readonly placeholder="点击选择[空闲]状态的资产" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产编号" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产名称" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格型号" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产类别" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计量单位" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="生产厂家" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="资产来源" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预计使用寿命" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="存放地址" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出厂日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择出厂日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="购入日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择购入日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择报废日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报废人" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入报废人" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
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 project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 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 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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑资产报废表' : '新增资产报废表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
if (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(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>

View File

@ -1,192 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产报废单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="资产序列号" prop="tax" show-overflow-tooltip />
<el-table-column label="资产名称 " prop="tax" show-overflow-tooltip />
<el-table-column label="资产类别" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="计量单位 " prop="tax" show-overflow-tooltip />
<el-table-column label="生产厂家" prop="tax" show-overflow-tooltip />
<el-table-column label="资产来源" prop="tax" show-overflow-tooltip />
<el-table-column label="预计使用寿命 " prop="tax" show-overflow-tooltip />
<el-table-column label="存放地址" prop="project_name" show-overflow-tooltip />
<el-table-column label="出厂日期" prop="tax" show-overflow-tooltip />
<el-table-column label="购入日期" prop="tax" show-overflow-tooltip />
<el-table-column label="报废日期" prop="tax" show-overflow-tooltip />
<el-table-column label="报废原因" prop="tax" show-overflow-tooltip />
<el-table-column label="报废人" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -104,7 +104,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="附件" prop="field127">
<el-form-item label="附件">
<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"

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,377 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="询价日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择询价日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请人" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入申请人" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">询价明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑询价(比价)单表' : '新增询价(比价)单表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,187 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="询价日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="添加人" prop="tax" show-overflow-tooltip />
<el-table-column label="创建日期" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,182 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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 type="selection" width="55" />
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="询价日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="询价分类" prop="invoicing_amount" show-overflow-tooltip />
<el-table-column label="产品描述" prop="amount_including_tax" show-overflow-tooltip />
<el-table-column label="材料编码" prop="tax_rate" show-overflow-tooltip />
<el-table-column label="材料名称" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="特殊属性" prop="tax" show-overflow-tooltip />
<el-table-column label="品牌" prop="tax" show-overflow-tooltip />
<el-table-column label="单位" prop="tax" show-overflow-tooltip />
<el-table-column label="供应商1" prop="tax" show-overflow-tooltip />
<el-table-column label="报价1" prop="tax" show-overflow-tooltip />
<el-table-column label="型号反馈" prop="tax" show-overflow-tooltip />
<el-table-column label="供应商2" prop="tax" show-overflow-tooltip />
<el-table-column label="报价2" prop="tax" show-overflow-tooltip />
<el-table-column label="供应商3" prop="tax" show-overflow-tooltip />
<el-table-column label="报价3" prop="tax" show-overflow-tooltip />
<el-table-column label="报价4" prop="tax" show-overflow-tooltip />
<el-table-column label="报价5" prop="tax" show-overflow-tooltip />
<el-table-column label="选定供应商" prop="tax" show-overflow-tooltip />
<el-table-column label="选定报价" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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>
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
// import EditPopup from './edit.vue'
// import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
//
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,471 +0,0 @@
<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="120px" :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>
<el-col :span="8">
<el-form-item label="供应商名称" prop="supplier_id" @click="showDialog1 = true"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-input v-model="supplier_name" readonly clearable placeholder="请选择供应商" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="供应商编码" prop="supplier_id"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-input v-model="supplier_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="审批id" prop="approve_id">
<el-input v-model="formData.approve_id" clearable placeholder="请输入审批id" />
</el-form-item> </el-col> <el-col :span="8">
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-input v-model="project_name" readonly clearable placeholder="请选择项目" />
</el-form-item> </el-col>
<el-col :span="8">
<el-form-item label="项目编码" prop="project_id"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-input v-model="project_code" readonly disabled placeholder="系统自动填写" />
</el-form-item> </el-col>
<el-col :span="8">
<el-form-item label="合同编号" prop="contract_no">
<el-input v-model="formData.contract_no" clearable disabled placeholder="系统自动编号" />
</el-form-item> </el-col> <el-col :span="8">
<el-form-item label="供应商合同号" prop="supplier_id">
<el-input v-model="supplier_contract_no" clearable placeholder="请输入供应商合同号" />
</el-form-item> </el-col> <el-col :span="24">
<el-form-item label="合同类型" prop="contract_type">
<el-radio-group v-model="formData.contract_type" placeholder="请选择合同类型"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-radio v-for="(item, index) in dictData.procurement_contract_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="signing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.signing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择签订日期">
</el-date-picker>
</el-form-item>
</el-col> <el-col :span="24">
<el-form-item label="付款方式" prop="pay_type">
<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="24">
<el-form-item label="账期" prop="account_period">
<el-radio-group v-model="formData.account_period" placeholder="请选择账期">
<el-radio v-for="(item, index) in dictData.account_period" :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="amount">
<el-input v-model="formData.amount" clearable placeholder="请输入合同金额" />
</el-form-item> </el-col> <el-col :span="8">
<el-form-item label="不含税金额" prop="amount_excluding_tax">
<el-input v-model="formData.amount_excluding_tax" clearable placeholder="请输入不含税金额" />
</el-form-item> </el-col> <el-col :span="8">
<el-form-item label="金额大写" prop="amount_daxie"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-input v-model="formData.amount_daxie" clearable placeholder="请输入金额大写" />
</el-form-item> </el-col> <el-col :span="8">
<el-form-item label="质保金比例" prop="retention_money_rate">
<el-input v-model="formData.retention_money_rate" clearable placeholder="请输入质保金比例" />
</el-form-item> </el-col> <el-col :span="8">
<el-form-item label="质保金" prop="retention_money"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-input v-model="formData.retention_money" clearable placeholder="请输入质保金" />
</el-form-item> </el-col> <el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
</el-form-item> </el-col> <el-col :span="8">
<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" 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-col :span="24">
<div style="margin-bottom: 30px;">采购合同明细</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.material">
<el-table-column label="序号">
<template #default="{ row }">
<el-button @click="handleAdd1(row)">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="采购申请单号" prop="material_procurement_application_id">
<template #default="{ row }">
<el-input v-model="row.material_procurement_application_id" />
</template>
</el-table-column>
<el-table-column label="材料名称" prop="material_procurement_application_id">
<template #default="{ row }"> <el-input
v-model="row.material_procurement_application_id" />
</template></el-table-column>
<el-table-column label="材料编码" prop="material_procurement_application_id">
<template #default="{ row }"> <el-input
v-model="row.material_procurement_application_id" />
</template></el-table-column>
<el-table-column label="规格型号" prop="material_procurement_application_id">
<template #default="{ row }">
<el-input v-model="row.material_procurement_application_id" />
</template>
</el-table-column>
<el-table-column label="数量" prop="product_num">
<template #default="{ row }">
<el-input v-model="row.product_num" />
</template>
</el-table-column>
<el-table-column label="单位" prop="tax_rate">
<template #default="{ row }">
<el-input v-model="row.tax_rate" />
</template>
</el-table-column>
<el-table-column label="数量" prop="num">
<template #default="{ row }">
<el-input v-model="row.num" />
</template>
</el-table-column>
<el-table-column label="含税单价" prop="unit_price_including_tax">
<template #default="{ row }">
<el-input v-model="row.unit_price_including_tax" />
</template>
</el-table-column>
<el-table-column label="税率" prop="tax_rate">
<template #default="{ row }">
<el-input v-model="row.tax_rate" />
</template>
</el-table-column>
<el-table-column label="不含税金额" prop="amount_excluding_tax">
<template #default="{ row }">
<el-input v-model="row.amount_excluding_tax" />
</template>
</el-table-column>
<el-table-column label="含税金额" prop="amount_including_tax">
<template #default="{ row }">
<el-input v-model="row.amount_including_tax" />
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-bottom: 30px;">付款计划</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.pay_plan">
<el-table-column label="序号">
<template #default="{ row }">
<el-button @click="handleAdd(row)">+</el-button>
<el-button @click="handleDelete(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="期次" prop="name1">
<template #default="{ row }">
<el-select v-model="row.period" clearable placeholder="请选择期次">
<el-option v-for="(item, index) in dictData.pay_period " :key="index"
:label="item.name" :value="item.id" />
</el-select>
</template>
</el-table-column>
<el-table-column label="计划付款日期" prop="pay_date">
<template #default="{ row }">
<el-date-picker v-model="row.pay_date" clearable value-format="YYYY-MM-DD "
placeholder="选择签订日期">
</el-date-picker>
</template></el-table-column>
<el-table-column label="金额" prop="pay_amount">
<template #default="{ row }"> <el-input v-model="row.pay_amount" />
</template></el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" />
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-form>
</popup>
<el-dialog v-model="showDialog" title="选择项目" width="70%">
<projectTable @customEvent="customEvent"></projectTable>
</el-dialog>
<el-dialog v-model="showDialog1" title="选择供应商" width="70%">
<suppliertable @customEvent="customEvent1"></suppliertable>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="procurementContractEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import projectTable from '@/components/project/index.vue'
import suppliertable from '@/components/supplier/index.vue'
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
import { apiProcurementContractAdd, apiProcurementContractEdit, apiProcurementContractDetail } from '@/api/procurement_contract'
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 showDialog = ref(false)
const showDialog1 = ref(false)
const project_name = ref('')
const project_code = ref('')
const supplier_name = ref('')
const supplier_code = ref('')
const supplier_contract_no = ref('')
const formDataannex = reactive([])
import feedback from '@/utils/feedback'
import configs from "@/config"
const base_url = configs.baseUrl + configs.urlPrefix
import useUserStore from "@/stores/modules/user";
const userStore = useUserStore();
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
feedback.msgError(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
const handleAdd = (row: any) => {
// row
const index = formData.pay_plan.indexOf(row);
formData.pay_plan.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = formData.pay_plan.indexOf(row);
formData.pay_plan.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = formData.pay_plan.indexOf(row);
formData.material.splice(index + 1, 0, {});
};
const handleDelete1 = (row: any) => {
// row
const index = formData.pay_plan.indexOf(row);
formData.material.splice(index, 1);
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑采购合同' : '新增采购合同'
})
//
const getlist = () => {
getAll().then((res) => {
Object.assign(list1, res)
if (res.length > 0 && !formData.org_id) {
formData.org_id = res[0].id
deptAll({ 'org_id': res[0].id }).then((res) => {
if (res.length > 0) {
Object.assign(list2, res)
formData.dept_id = res[0].id
}
})
}
})
}
//
const deptrmt = (e: any) => {
formData.dept_id = ''
getlist1(e)
}
//
const getlist1 = (id: any) => {
deptAll({ 'org_id': id }).then((res) => {
list2.splice(0, list2.length, ...res)
})
}
//
const formData = reactive({
id: '',
dept_id: '',
org_id: '',
supplier_id: '',
approve_id: '',
project_id: '',
contract_no: '',
contract_type: '',
signing_date: '',
pay_type: '',
account_period: '',
amount: '',
amount_excluding_tax: '',
amount_daxie: '',
retention_money_rate: '',
retention_money: '',
remark: '',
annex: '',
material: [{
material_procurement_application_id: 2222,
num: 0,
unit_price_including_tax: 0,
tax_rate: "",
amount_excluding_tax: 0,
amount_including_tax: 0
}],
pay_plan: [{
period: '',
pay_date: '',
pay_amount: '',
remark: ''
}]
})
const customEvent = (e: any) => {
project_name.value = e.name
formData.project_id = e.id
project_code.value = e.project_code
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.supplier_id = e.id;
supplier_code.value = e.supplier_code
supplier_name.value = e.supplier_name
showDialog1.value = false;
};
//
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)
}
if (data.dept_id) {
getlist1(data.org_id)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
project_name.value = data.project.name
project_code.value = data.project.project_code
//@ts-ignore
formData.signing_date = timeFormat(formData.signing_date, 'YYYY-MM-DD ')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiProcurementContractDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiProcurementContractEdit(data)
: await apiProcurementContractAdd(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>

View File

@ -1,196 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="材料类别" prop="tax_rate" show-overflow-tooltip />
<el-table-column label="材料中类" prop="tax" show-overflow-tooltip />
<el-table-column label="材料小类" prop="tax" show-overflow-tooltip />
<el-table-column label="材料名称" prop="tax" show-overflow-tooltip />
<el-table-column label="材料编码" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="品牌" prop="tax" show-overflow-tooltip />
\
<el-table-column label="单位" prop="tax" show-overflow-tooltip />
<el-table-column label="订单数量" prop="tax" show-overflow-tooltip />
<el-table-column label="已发货数量" prop="tax" show-overflow-tooltip />
<el-table-column label="未发货数量" prop="tax" show-overflow-tooltip />
<el-table-column label="库存数量" prop="tax" show-overflow-tooltip />
<el-table-column label="在途采购量" prop="tax" show-overflow-tooltip />
<el-table-column label="安全库存量" prop="tax" show-overflow-tooltip />
<el-table-column label="缺口数量" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,174 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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 type="selection" width="55" />
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="供应方式" prop="project_code" show-overflow-tooltip />
<el-table-column label="仓库名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="库存数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="占用数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="可用数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="库存金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
// import EditPopup from './edit.vue'
// import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,342 +0,0 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
<el-col :span="24">
<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="24">
<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="24">
<el-form-item label="供应商名称" prop="project_id" @click="showDialog = true">
<el-input v-model="project_name" clearable placeholder="点击选择供应商名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="供应商编码" prop="project_id" @click="showDialog = true">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料编码" prop="project_id" @click="showDialog = true">
<el-input v-model="project_name" clearable placeholder="点击选择材料" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="事故类型" prop="type">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料名称" prop="device_accident">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料大类" prop="contractor_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料中类" prop="our_company_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料小类" prop="our_company_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="规格型号" prop="our_company_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="参数说明" prop="our_company_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料中类" prop="our_company_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="品牌" prop="our_company_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="单位" prop="not_our_company_user">
<el-input v-model="formData.not_our_company_user" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="询价日期" prop="require">
<el-date-picker class="flex-1 !flex" v-model="formData.happen_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择询价日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="价格" prop="content">
<el-input v-model="formData.content" type="number" 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="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 " 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="showDialog" title="选择项目" width="70%">
<porjectDialog @customEvent="customEvent"></porjectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { qualityaccidentAdd, qualityaccidentEdit, qualityaccidentDetail } from '@/api/quality_accident'
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 configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
const showDialog = ref(false)
const project_name = ref('')
const project_code = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
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 customEvent = (e: any) => {
formData.project_id = e.id;
project_name.value = e.name;
project_code.value = e.project_code
showDialog.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 popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑安全事故表' : '新增安全事故表'
})
//
const formData = reactive({
id: '',
project_id: "",
name: "",
happen_date: "",
type: "",
file: [],
remark: "",
dept_id: '',
org_id: "",
device_accident: "",
contractor_user: "",
not_our_company_user: "",
our_company_user: "",
content: "",
})
//
const formRules = reactive<any>({
})
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.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
)
}
project_name.value = data.project_name
project_code.value = data.project_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await qualityaccidentDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
formData.file = formDataannex.map((item) => item.uri)
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await qualityaccidentEdit(data)
: await qualityaccidentAdd(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>

View File

@ -1,190 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="供应商名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="供应商编码 " prop="project_code" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="询价日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="价格" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,380 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库名称" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="仓库名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盘点日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择询价日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盘点负责人" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入盘点负责人" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">盘点材料清单</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑月度盘点表' : '新增月度盘点表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,187 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="询价日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="添加人" prop="tax" show-overflow-tooltip />
<el-table-column label="创建日期" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,183 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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 type="selection" width="55" />
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="ID" prop="customer_name" show-overflow-tooltip />
<el-table-column label="盘点单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="仓库名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="年" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="月" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应方式" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="出库日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="库存数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="剩余数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="使用数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
// import EditPopup from './edit.vue'
// import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,286 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,378 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable readonly placeholder="点击选择供应商" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="供应商编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目名称" prop="contract_id">
<el-input v-model="project_name" clearable readonly placeholder="点击选择项目" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="采购合同编号" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入采购合同编号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="入库日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择入库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">入库明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="参数说明" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="含税单价" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="税率" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="不含税金额" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="含税金额" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑自购入库单表' : '新增自购入库单表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,187 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="询价日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="添加人" prop="tax" show-overflow-tooltip />
<el-table-column label="创建日期" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,317 +0,0 @@
<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="contract_id" @click="showDialog1 = true">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择申请日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="希望到货日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择希望到货日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<!-- <el-form-item label="附件" prop="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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="showDialog" title="选择客户" width="70%">
<customDialog @customEvent="customEvent"></customDialog>
</el-dialog>
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</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 { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑采购需求目表' : '新增采购需求表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,200 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="入库单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="采购合同编号" prop="project_code" show-overflow-tooltip />
<el-table-column label="供应商名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="入库日期" prop="customer_name" show-overflow-tooltip />
<el-table-column label="仓库" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="含税单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="税率" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="不含税金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="含税金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,291 +0,0 @@
<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="出库流水表ID" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请选择出库流水" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="序列号" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入序列号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出库日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择出库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库编码" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料类别" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料类别" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料中类" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料中类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料小类" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料小类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库名称" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料名称" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料编码" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格型号" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入规格型号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="品牌" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入品牌" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参数说明" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入参数说明" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入单位" />
</el-form-item>
</el-col>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑序列号出库表' : '新增序列号出库表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,189 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="序列号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="出库日期" prop="customer_name" show-overflow-tooltip />
<el-table-column label="仓库" prop="customer_name" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,290 +0,0 @@
<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="入库流水表ID" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请选择入库流水" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="序列号" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入序列号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="入库日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择入库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库编码" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料类别" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料类别" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料中类" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料中类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料小类" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料小类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库名称" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料名称" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料编码" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入材料编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格型号" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入规格型号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="品牌" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入品牌" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参数说明" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入参数说明" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入单位" />
</el-form-item>
</el-col>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑序列号入库表' : '新增序列号入库表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,189 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="序列号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="入库日期" prop="customer_name" show-overflow-tooltip />
<el-table-column label="仓库" prop="customer_name" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,405 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="调出仓库" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="调入项目名称" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="调入仓库" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="调出负责人" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="调入负责人" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="调拨日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择调拨日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">调拨明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="参数说明" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑调拨单表' : '新增调拨单表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,187 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="询价日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="添加人" prop="tax" show-overflow-tooltip />
<el-table-column label="创建日期" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,405 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="调出仓库" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="调入项目名称" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="调入仓库" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="调出负责人" prop="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="调入负责人" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="调拨日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择调拨日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">调拨明细</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="参数说明" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑调拨单表' : '新增调拨单表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,199 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="调拨单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="调出项目名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="调出项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="调出仓库" prop="project_name" show-overflow-tooltip />
<el-table-column label="调出仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="调入项目名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="调入项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="调入仓库" prop="project_name" show-overflow-tooltip />
<el-table-column label="调入仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="调拨日期" prop="tax" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="调出单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="调出金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,391 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="处理日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择处理日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">材料清单</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="供应方式" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="库存数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="处理单价" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="处理金额" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑余料处理单表' : '新增余料处理单表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,187 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="询价日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="附件" prop="tax" show-overflow-tooltip />
<el-table-column label="添加人" prop="tax" show-overflow-tooltip />
<el-table-column label="创建日期" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,195 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="ID" prop="customer_name" show-overflow-tooltip />
<el-table-column label="余料处理单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="仓库名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="订单编号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="处理日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应方式" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="库存数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="处理单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="处理金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
// import EditPopup from './edit.vue'
// import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,423 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable placeholder="材料大类" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="材料中类" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="材料中类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料小类" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="材料小类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料编码" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入材料编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="品牌" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入品牌" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料名称" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入材料名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格型号" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入规格型号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参数说明" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入参数说明" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="安全库存量" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入安全库存量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售指导价" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入销售指导价" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预算成本价" prop="invoice_no">
<el-input v-model="formData.invoice_no" clearable placeholder="请输入预算成本价" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">盘点材料清单</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑自购材料表' : '新增自购材料表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,316 +0,0 @@
<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="contract_id" @click="showDialog1 = true">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择申请日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="希望到货日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择希望到货日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<!-- <el-form-item label="附件" prop="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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="showDialog" title="选择客户" width="70%">
<customDialog @customEvent="customEvent"></customDialog>
</el-dialog>
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</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 { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑采购需求目表' : '新增采购需求表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,196 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="MRP建议" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="希望到货日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="tax_rate" show-overflow-tooltip />
<el-table-column label="材料中类" prop="tax" show-overflow-tooltip />
<el-table-column label="材料小类" prop="tax" show-overflow-tooltip />
<el-table-column label="材料名称" prop="tax" show-overflow-tooltip />
<el-table-column label="材料编码" prop="tax" show-overflow-tooltip />
<el-table-column label="规格型号" prop="tax" show-overflow-tooltip />
<el-table-column label="品牌" prop="tax" show-overflow-tooltip />
<el-table-column label="参数说明" prop="tax" show-overflow-tooltip />
<el-table-column label="单位" prop="tax" show-overflow-tooltip />
<el-table-column label="申请采购数量" prop="tax" show-overflow-tooltip />
<el-table-column label="已采购数量" prop="tax" show-overflow-tooltip />
<el-table-column label="已调拨数量" prop="tax" show-overflow-tooltip />
<el-table-column label="缺口数量" prop="tax" show-overflow-tooltip />
<el-table-column label="库存数量" prop="tax" show-overflow-tooltip />
<el-table-column label="备注" prop="tax" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,189 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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 type="selection" width="55" />
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="出库单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="客户名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="仓库名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="订单编号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="出货方式" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应方式" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="出库日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="退库数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="退库金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="是否锁定" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="添加人" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="创建日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="更新人" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="更新日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" /> -->
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
// import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,346 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目名称" prop="contract_id" @click="showDialog1 = true">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单据类型" prop="contract_id">
<el-input v-model="project_name" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="供应方式" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="供应方式" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出库日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择出库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入仓库" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库编码" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入仓库编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入供应商" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商编码" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入供应商编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料类别" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料类别" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料中类" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料中类" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料小类" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料小类" />
</el-form-item>
</el-col> <el-col :span="12">
<el-form-item label="材料名称" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料编码" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格型号" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入规格型号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="品牌" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入品牌" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特殊属性" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入特殊属性" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入单位" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库数量" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入出库数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成本单价" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入成本单价" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成本金额" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入成本金额" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否占用" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入是否占用" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="已退货数量" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入已退货数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="未退货数量" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入未退货数量" />
</el-form-item>
</el-col>
</el-row>
<el-dialog v-model="showDialog" title="选择客户" width="70%">
<customDialog @customEvent="customEvent"></customDialog>
</el-dialog>
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</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 { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const next = () => {
if (active.value++ > 3) active.value = 0
}
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑出库流水表' : '新增出库流水表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,203 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="ID" prop="customer_name" show-overflow-tooltip />
<el-table-column label="单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="入库流水编号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_code" show-overflow-tooltip />
<el-table-column label="单据类型" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应方式" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="出库日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应商" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应商编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="特殊属性" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="出库数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="成本单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="成本金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="是否占用" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="已退货数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="未退货数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,395 +0,0 @@
<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="contract_id" @click="showDialog1 = true">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库名称" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出库日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择出库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="领用人" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入领用人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出库负责人" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入出库负责人" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">出库清单</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="参数说明" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑出库单表' : '新增出库单表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,185 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="采购申请单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="开票日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="希望到货日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="申请人" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,415 +0,0 @@
<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="contract_id">
<el-input v-model="project_name" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目名称" prop="contract_id" @click="showDialog1 = true">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="供应方式" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="供应方式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入仓库" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库编码" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入仓库编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入供应商" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商编码" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入供应商编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="入库日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择入库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料类别" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料类别" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料中类" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料中类" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料小类" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料小类" />
</el-form-item>
</el-col> <el-col :span="12">
<el-form-item label="材料名称" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材料编码" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入材料编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格型号" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入规格型号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="品牌" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入品牌" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="参数说明" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入参数说明" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="已出库数量" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入已出库数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="未出库数" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入未出库数" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="占用数量" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入占用数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可用数量" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入可用数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="含税单价" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入含税单价" />
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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="showDialog" title="选择客户" width="70%">
<customDialog @customEvent="customEvent"></customDialog>
</el-dialog>
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</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 { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑入库流水表' : '新增入库流水表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,202 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="ID" prop="customer_name" show-overflow-tooltip />
<el-table-column label="单据类型" prop="customer_name" show-overflow-tooltip />
<el-table-column label="同步记录ID" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_name" show-overflow-tooltip />
<el-table-column label="仓库" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应商" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应商编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="入库日期" prop="invoicing_date" show-overflow-tooltip />\
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="已出库数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="未出库数量 " prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="占用数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="已退货数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="可用数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="含税单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="库存金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,287 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,316 +0,0 @@
<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="contract_id" @click="showDialog1 = true">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择申请日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="希望到货日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择希望到货日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<!-- <el-form-item label="附件" prop="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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="showDialog" title="选择客户" width="70%">
<customDialog @customEvent="customEvent"></customDialog>
</el-dialog>
<el-dialog v-model="showDialog1" title="选择合同" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</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 { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑采购需求目表' : '新增采购需求表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,203 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="退库单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="出库单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="客户名称" prop="customer_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="仓库名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="订单编号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="出货方式" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="供应方式" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="退库日期" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料类别" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料中类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料小类" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料名称" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="材料编码" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="规格型号" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="品牌" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="参数说明" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单位" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="数量" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="单价" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="金额" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -1,286 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="开票申请详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称">
{{ formData.project_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称">
{{ formData.custom.name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码">
{{ formData.project_code
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同编号">
{{ formData.contract.contract_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称">
{{ formData.contract ? formData.contract.contract_code : '暂无数据' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
{{ formData.contract.amount
}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="期次">
<dict-value :options="dictData.pay_period" :value="formData.period" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计开票金额">
{{ formData.accumulate_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计回款金额">
{{ formData.accumulated_payments_received }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率">
{{ formData.tax_rate }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型">
<dict-value :options="dictData.invoice_type" :value="formData.invoice_type" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(含税)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额大写">
{{ formData.invoicing_amount_daxie }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(税额)">
{{ formData.invoicing_amount }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票金额(非税)">
{{ formData.amount_including_tax }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票编号">
{{ formData.invoice_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票公司名称">
{{ formData.invoicing_company_name }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
{{ formData.taxpayer_identification_number }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
{{ formData.deposit_bank }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账号">
{{ formData.bank_accnout }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址及电话">
{{ formData.address_phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收票地址">
{{ formData.receiving_address }}
</el-form-item>
</el-col> <el-col :span="8">
<el-form-item label="联系人">
{{ formData.contacts }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话">
{{ formData.phone }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄时间">
{{ formData.mailing_time }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄方式">
{{ formData.mailing_type }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄单号">
{{ formData.mailing_no }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
{{ formData.remark }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<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>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
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 formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
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]
// }
// }
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: formData.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

View File

@ -1,424 +0,0 @@
<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="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入出库单号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出货方式" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入出货方式" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库名称" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="仓库编码" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入仓库编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户名称" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入客户名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目名称" prop="contract_id" @click="showDialog1 = true">
<el-input v-model="project_name" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编码" prop="contract_id">
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="订单编号" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入订单编号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="退库人" prop="contract_id">
<el-input v-model="project_code" clearable placeholder="请输入退库人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="退库日期" prop="invoicing_date"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.invoicing_date" clearable
value-format="YYYY-MM-DD " placeholder="选择退库日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<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="annex">
<el-input v-model="formData.annex" clearable placeholder="请输入附件" />
</el-form-item> -->
<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" 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 style="margin: 20px 0;">退库清单</div>
<el-row>
<el-table :data="tablist1">
<el-table-column label="序号">
<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, $index }">
<el-input v-model="row.name1" readonly @click="subjectmu(row, $index)" />
</template>
</el-table-column>
<el-table-column label="材料编码" prop="name2">
<template #default="{ row }">
<el-input v-model="row.name2" readonly />
</template></el-table-column>
<el-table-column label="材料名称" prop="use_to">
<template #default="{ row }">
<el-input v-model="row.use_to" /> </template>
</el-table-column>
<el-table-column label="规格型号" prop="amount">
<template #default="{ row }">
<el-input v-model="row.amount" type="number" /> </template>
</el-table-column>
<el-table-column label="品牌" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="参数说明" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="单位" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="数量" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row }">
<el-input v-model="row.remark" /> </template>
</el-table-column>
</el-table>
</el-row>
<el-dialog v-model="showDialog1" title="选择项目" width="70%">
<projectDialog @customEvent="customEvent1" contract_type="2"></projectDialog>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { toChinesNum } from "@/utils/util";
import projectDialog from '@/components/project/index.vue'
import { apiinvoiceapplyAdd, apiinvoiceapplyEdit, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const contract_name = ref('')
const project_name = ref('')
const project_code = ref('')
const project_amount = ref('')
const contract_no = ref('')
const custom_name = ref('')
const tablist1 = reactive([{}])
const next = () => {
if (active.value++ > 3) active.value = 0
}
//
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 handleAdd = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
// row
const index = tablist1.indexOf(row);
tablist1.splice(index, 1);
};
const handleAdd1 = (row: any) => {
// row
const index = tablist2.indexOf(row);
tablist2.splice(index + 1, 0, {});
};
//
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
if (value && !/^1\d{10}$/.test(value)) {
callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
}
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
// const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
// // if (!value) {
// // return callback(new Error(''))
// // }
if (value && !mailReg.test(value)) {
callback(new Error('请输入正确的邮箱格式'))
} else {
callback()
}
};
//
const amountinput = (e) => {
if (e && e > 0) {
formData.invoicing_amount_daxie = toChinesNum(e)
}
}
//
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 showDialog = ref(false)
const showDialog1 = ref(false)
const customEvent = (e: any) => {
formData.customer_id = e.id;
custom_name.value = e.name;
showDialog.value = false;
};
const customEvent1 = (e: any) => {
formData.contract_id = e.id;
project_name.value = e.project_name;
project_code.value = e.project_code;
contract_name.value = e.contract_name;
contract_no.value = e.contract_code
project_amount.value = e.amount
showDialog1.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑退库单表' : '新增退库单表'
})
//
const formData = reactive({
id: '',
customer_id: '',
contract_id: '',
approve_id: '',
invoicing_date: "",
period: "",
accumulate_amount: '',
accumulated_payments_received: '',
tax_rate: "",
invoice_type: '',
invoicing_amount: '',
invoicing_amount_daxie: "",
tax: '',
amount_including_tax: '',
content: "",
invoice_no: "",
remark: "",
annex: [],
invoicing_company_name: "",
taxpayer_identification_number: "",
deposit_bank: "",
bank_accnout: "",
address_phone: "",
receiving_address: "",
contacts: "",
phone: "",
mailing_time: "",
mailing_type: "",
mailing_no: ""
})
//
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 (formData.invoicing_amount) {
toChinesNum(formData.invoicing_amount)
}
custom_name.value = data.custom.name
project_name.value = data.contract_name;
project_code.value = data.contract_code
project_amount.value = data.contract.amount
contract_name.value = data.contract.contract_name;
contract_no.value = data.contract.contract_code
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiinvoiceapplyDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
if (formDataannex.length > 0) {
formData.annex = formDataannex.map((item: any) => item.uri)
}
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await apiinvoiceapplyEdit(data)
: await apiinvoiceapplyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getAllProjectTypes().then((res) => {
protype.splice(0, protype.length, ...res);
})
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,186 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="开票公司名称" prop="invoicing_company_name">
<el-input class="w-[280px]" v-model="queryParams.invoicing_company_name" clearable
placeholder="请输入开票公司名称" />
</el-form-item>
<el-form-item label="客户" prop="customer_id">
<el-select class="w-[280px]" v-model="queryParams.customer_id" clearable placeholder="请选择客户">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, i) in list1" :key="i" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="合同" prop="contract_id">
<el-select class="w-[280px]" v-model="queryParams.contract_id" clearable placeholder="请选择合同">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in list" :key="index" :label="item.contract_name"
: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">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/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="55" />
<el-table-column label="流程步骤" prop="customer_name" show-overflow-tooltip />
<el-table-column label="退库单号" prop="customer_name" show-overflow-tooltip />
<el-table-column label="出库单号" prop="project_code" show-overflow-tooltip />
<el-table-column label="仓库编码" prop="project_name" show-overflow-tooltip />
<el-table-column label="仓库名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="项目编码" prop="project_name" show-overflow-tooltip />
<el-table-column label="订单编号" prop="project_name" show-overflow-tooltip />
<el-table-column label="客户名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="退库日期" prop="project_name" show-overflow-tooltip />
<el-table-column label="退库人" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="备注" prop="invoicing_date" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button v-perms="['InvoicingRequests.InvoicingRequests/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['InvoicingRequests.InvoicingRequests/detail']" link
@click="handledetail(row)">
详情
</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" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiinvoiceapplyLists, apiinvoiceapplyDelete, apiinvoiceapplyDetail } from '@/api/InvoicingRequests'
import { timeFormat } from '@/utils/util'
import { apiContractLists } from '@/api/contract'
import { apiCustomLists } from '@/api/custom'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const showDtail = ref(false)
const list = ref([])
const list1 = ref([])
//
const queryParams = reactive({
invoicing_company_name: '',
contract_id: '',
customer_id: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('pay_period,invoice_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiinvoiceapplyLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiinvoiceapplyDetail({ 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 apiinvoiceapplyDelete({ id })
getLists()
}
//
const handledetail = async (data: any) => {
let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const getlist1 = () => {
apiContractLists().then((res) => {
list.value = res.lists
})
}
//
const getlist2 = () => {
apiCustomLists().then((res) => {
list1.value = res.lists
})
}
getlist1()
getlist2()
getLists()
</script>

View File

@ -149,7 +149,7 @@
<el-col :span="24">
<el-form-item label="附件" prop="field87">
<el-form-item label="附件">
<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"

View File

@ -119,7 +119,7 @@
<el-col :span="24">
<el-form-item label="附件" prop="field127">
<el-form-item label="附件">
<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"

View File

@ -103,7 +103,7 @@
<el-col :span="24">
<el-form-item label="附件" prop="field87">
<el-form-item label="附件">
<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"

View File

@ -122,7 +122,7 @@
<el-col :span="24">
<el-form-item label="附件" prop="field87">
<el-form-item label="附件">
<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"

View File

@ -101,7 +101,7 @@
<el-form-item label="项目简介" prop="project_desc">
<el-input v-model="formData.project_desc" clearable placeholder="请输入项目简介" />
</el-form-item></el-col><el-col :span="24">
<el-form-item label="附件" prop="field127">
<el-form-item label="附件">
<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"

View File

@ -46,19 +46,6 @@
<el-form-item label="购买标书金额" prop="amount">
<el-input v-model="formData.amount" clearable placeholder="请输入购买标书金额" />
</el-form-item></el-col>
<!-- <el-col :span="24">
<el-form-item label="招标项目资金来源" prop="project_fund_source">
<el-radio-group v-model="formData.project_fund_source" placeholder="请选择招标项目资金来源">
<el-radio v-for="(item, index) in dictData.construction_funds_sources" :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="bid_date">
<el-date-picker class="flex-1 !flex" v-model="formData.bid_date" clearable value-format="YYYY-MM-DD " placeholder="选择投标时间">
</el-date-picker>
</el-form-item>
</el-col> -->
<el-col :span="8">
<el-form-item label="购买标书时间" prop="buy_date">
<el-date-picker class="flex-1 !flex" v-model="formData.buy_date" clearable
@ -66,56 +53,8 @@
</el-date-picker>
</el-form-item>
</el-col>
<!-- <el-col :span="24">
<el-form-item label="招标方式" prop="invite_tenders_type">
<el-radio-group v-model="formData.invite_tenders_type" placeholder="请选择招标方式">
<el-radio v-for="(item, index) in dictData.bidding_method" :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="bid_address">
<el-input v-model="formData.bid_address" clearable placeholder="请输入投标地址" />
</el-form-item></el-col><el-col :span="24">
<el-form-item label="是否需要保证金" prop="is_margin">
<el-radio-group v-model="formData.is_margin" placeholder="请选择是否需要保证金">
<el-radio v-for="(item, index) in dictData.whether_status" :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="margin_amount">
<el-input v-model="formData.margin_amount" clearable placeholder="请输入保证金金额" />
</el-form-item></el-col><el-col :span="8">
<el-form-item label="招标项目慨况" prop="bid_project_overview">
<el-input v-model="formData.bid_project_overview" clearable placeholder="请输入招标项目慨况" />
</el-form-item></el-col><el-col :span="8">
<el-form-item label="项目简介" prop="project_desc">
<el-input v-model="formData.project_desc" clearable placeholder="请输入项目简介" />
</el-form-item></el-col>
<el-col :span="8">
<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" 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-form>
<!-- <reviewprocess /> -->
</popup>
<personnelselector ref="personnel" @confirm="submituser" type="1"></personnelselector>

View File

@ -77,7 +77,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="附件" prop="field127">
<el-form-item label="附件">
<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"

View File

@ -1,174 +0,0 @@
<template>
<div>
<el-card>
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="130px" label-position="left">
<el-form-item label="组织名称" prop="field101">
<el-input v-model="formData.field101" placeholder="请输入组织名称" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="部门名称" prop="field104">
<el-select v-model="formData.field104" placeholder="请选择部门名称" clearable :style="{ width: '100%' }">
<el-option v-for="(item, index) in field104Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="field109">
<el-input v-model="formData.field109" placeholder="点教选择项目" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="项目编码" prop="field105">
<el-input v-model="formData.field105" placeholder="系统自动获取" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="客户名称" prop="field108">
<el-input v-model="formData.field108" placeholder="系统自动获取" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="需求名称" prop="field130">
<el-input v-model="formData.field130" placeholder="点击选择目项点需求名称" :disabled='true' clearable
suffix-icon='el-icon-search' :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="竞争对手联系人" prop="field131" label-width="132px">
<el-input v-model="formData.field131" placeholder="请输入竞争对手联系人" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="联系人电话" prop="field132">
<el-input v-model="formData.field132" placeholder="请输入联系人电话" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="竞争能力" prop="field134">
<el-input v-model="formData.field134" type="textarea" placeholder="请输入竞争能力"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="竞争能对手优势" prop="field135">
<el-input v-model="formData.field135" type="textarea" placeholder="请输入竞争能对手优势"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="竞争能对手劣势" prop="field136">
<el-input v-model="formData.field136" type="textarea" placeholder="请输入竞争能对手劣势"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="备注" prop="field137">
<el-input v-model="formData.field137" type="textarea" placeholder="请输入备注"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="附件" prop="field138">
<el-upload ref="field138" :file-list="field138fileList" :action="field138Action"
:before-upload="field138BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: [],
data() {
return {
formData: {
field101: undefined,
field104: undefined,
field109: undefined,
field105: undefined,
field108: undefined,
field130: undefined,
field131: undefined,
field132: undefined,
field134: undefined,
field135: undefined,
field136: undefined,
field137: undefined,
field138: null,
},
rules: {
field101: [{
required: true,
message: '请输入组织名称',
trigger: 'blur'
}],
field104: [{
required: true,
message: '请选择部门名称',
trigger: 'change'
}],
field109: [{
required: true,
message: '点教选择项目',
trigger: 'blur'
}],
field105: [{
required: true,
message: '系统自动获取',
trigger: 'blur'
}],
field108: [{
required: true,
message: '系统自动获取',
trigger: 'blur'
}],
field130: [{
required: true,
message: '教选择目项点需求名称',
trigger: 'blur'
}],
field131: [{
required: true,
message: '请输入竞争对手联系人',
trigger: 'blur'
}],
field132: [],
field134: [],
field135: [],
field136: [],
field137: [],
},
field138Action: 'https://jsonplaceholder.typicode.com/posts/',
field138fileList: [],
field104Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
}
},
computed: {},
watch: {},
created() { },
mounted() { },
methods: {
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field138BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
}
}
</script>
<style>
.el-upload__tip {
line-height: 1.2;
}
</style>

View File

@ -1,170 +0,0 @@
<template>
<div>
<el-card>
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" label-position="left">
<el-form-item label="组织名称" prop="field101">
<el-input v-model="formData.field101" placeholder="请输入组织名称" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="部门名称" prop="field104">
<el-select v-model="formData.field104" placeholder="请选择部门名称" clearable :style="{ width: '100%' }">
<el-option v-for="(item, index) in field104Options" :key="index" :label="item.label" :value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="field109">
<el-input v-model="formData.field109" placeholder="选择项目" :disabled='true' clearable :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="客户名称" prop="field108">
<el-input v-model="formData.field108" placeholder="系统自动获取" :disabled='true' clearable :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="项目编码" prop="field105">
<el-input v-model="formData.field105" placeholder="系统自动获取" :disabled='true' clearable :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="需求主题" prop="field110">
<el-input v-model="formData.field110" placeholder="请输入需求" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="客户需求提供人" prop="field111" label-width="120px">
<el-input v-model="formData.field111" placeholder="请输入客户需求提供人" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="提供联系人" prop="field112">
<el-input v-model="formData.field112" placeholder="请输入提供联系人" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="重要程度" prop="field113">
<el-radio-group v-model="formData.field113" size="medium">
<el-radio v-for="(item, index) in field113Options" :key="index" :label="item.value" :disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="记录时间" prop="field114">
<el-date-picker v-model="formData.field114" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :style="{ width: '100%' }" placeholder="请选择记录时间" clearable></el-date-picker>
</el-form-item>
<el-form-item label="需求内容" prop="field115">
<el-input v-model="formData.field115" type="textarea" placeholder="请输入需求内容" :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="附件" prop="field116">
<el-upload ref="field116" :file-list="field116fileList" :action="field116Action" :before-upload="field116BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: [],
data() {
return {
formData: {
field101: undefined,
field104: undefined,
field109: undefined,
field108: undefined,
field105: undefined,
field110: undefined,
field111: undefined,
field112: undefined,
field113: undefined,
field114: null,
field115: undefined,
field116: null,
},
rules: {
field101: [{
required: true,
message: '请输入组织名称',
trigger: 'blur'
}],
field104: [{
required: true,
message: '请选择部门名称',
trigger: 'change'
}],
field109: [{
required: true,
message: '点教选择项目',
trigger: 'blur'
}],
field108: [{
required: true,
message: '系统自动获取',
trigger: 'blur'
}],
field105: [{
required: true,
message: '系统自动获取',
trigger: 'blur'
}],
field110: [{
required: true,
message: '请输入需求',
trigger: 'blur'
}],
field111: [],
field112: [],
field113: [],
field114: [],
field115: [],
},
field116Action: 'https://jsonplaceholder.typicode.com/posts/',
field116fileList: [],
field104Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
field113Options: [{
"label": "非常重要",
"value": 1
}, {
"label": "重要",
"value": 2
}, {
"label": "一般",
"value": 3
}, {
"label": "不重要",
"value": 4
}],
}
},
computed: {},
watch: {},
created() { },
mounted() { },
methods: {
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field116BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
}
}
</script>
<style>
.el-upload__tip {
line-height: 1.2;
}
</style>

View File

@ -1,257 +0,0 @@
<template>
<div>
<el-card>
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" label-position="left">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="项目名称" prop="field101">
<el-input v-model="formData.field101" placeholder="点击选择" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目编码" prop="field102">
<el-input v-model="formData.field102" placeholder="系统自动填写" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="field103">
<el-input v-model="formData.field103" placeholder="系统自动填写" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="执行人" prop="field104">
<el-input v-model="formData.field104" placeholder="请输入执行人" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="field105">
<el-input v-model="formData.field105" placeholder="请输入联系人" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系方式" prop="field106">
<el-input v-model="formData.field106" placeholder="请输入联系方式" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目角色" prop="field108">
<el-input v-model="formData.field108" placeholder="请输入项目角色" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职位" prop="field107">
<el-input v-model="formData.field107" placeholder="请输入职位" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="日期" prop="field109">
<el-date-picker v-model="formData.field109" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '100%' }" placeholder="请选择日期" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类型" prop="field110">
<el-input v-model="formData.field110" placeholder="请输入类型" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="主题" prop="field111">
<el-input v-model="formData.field111" placeholder="请输入主题" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="行动描述" prop="field113">
<el-input v-model="formData.field113" type="textarea" placeholder="请输入行动描述"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目把握度" prop="field114">
<el-select v-model="formData.field114" placeholder="请选择项目把握度" clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in field114Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="field116">
<el-select v-model="formData.field116" placeholder="请选择状态" clearable :style="{ width: '100%' }">
<el-option v-for="(item, index) in field116Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="阶段" prop="field117">
<el-input v-model="formData.field117" placeholder="请输入阶段" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="field118">
<el-input v-model="formData.field118" placeholder="请输入备注" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="下次回访日期" prop="field119">
<el-date-picker v-model="formData.field119" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '100%' }" placeholder="请选择下次回访日期" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="附件" prop="field120">
<el-upload ref="field120" :file-list="field120fileList" :action="field120Action"
:before-upload="field120BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: [],
data() {
return {
formData: {
field101: undefined,
field102: undefined,
field103: undefined,
field104: undefined,
field105: undefined,
field106: undefined,
field108: undefined,
field107: undefined,
field109: null,
field110: undefined,
field111: undefined,
field113: undefined,
field114: undefined,
field116: undefined,
field117: undefined,
field118: undefined,
field119: null,
field120: null,
},
rules: {
field101: [{
required: true,
message: '点击选择',
trigger: 'blur'
}],
field102: [{
required: true,
message: '系统自动填写',
trigger: 'blur'
}],
field103: [{
required: true,
message: '系统自动填写',
trigger: 'blur'
}],
field104: [],
field105: [],
field106: [],
field108: [],
field107: [],
field109: [{
required: true,
message: '请选择日期',
trigger: 'change'
}],
field110: [{
required: true,
message: '请输入类型',
trigger: 'blur'
}],
field111: [{
required: true,
message: '请输入主题',
trigger: 'blur'
}],
field113: [],
field114: [{
required: true,
message: '请选择项目把握度',
trigger: 'change'
}],
field116: [],
field117: [],
field118: [],
field119: [],
},
field120Action: 'https://jsonplaceholder.typicode.com/posts/',
field120fileList: [],
field114Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
field116Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
}
},
computed: {},
watch: {},
created() { },
mounted() { },
methods: {
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field120BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
}
}
</script>
<style>
.el-upload__tip {
line-height: 1.2;
}
</style>

View File

@ -1,469 +0,0 @@
<template>
<div>
<el-card>
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" label-position="left">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="客户名称" prop="field101">
<el-input v-model="formData.field101" placeholder="请输入客户名称" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目类型" prop="field103">
<el-select v-model="formData.field103" placeholder="请选择项目类型" clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in field103Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目名称" prop="field104">
<el-input v-model="formData.field104" placeholder="请输入项目名称" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单行文本" prop="field105">
<el-input v-model="formData.field105" placeholder="系统自动生成" readonly clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="项目内容" prop="field106">
<el-checkbox-group v-model="formData.field106" size="medium">
<el-checkbox v-for="(item, index) in field106Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目估算(万元)" prop="field107" label-width="120px">
<el-input v-model="formData.field107" placeholder="请输入项目估算项目估算(万元)" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目估算(外币)" prop="field108" label-width="120px">
<el-input v-model="formData.field108" placeholder="请输入项目估算(外币)" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目所在地" prop="field109">
<el-input v-model="formData.field109" placeholder="请输入项目所在地" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="预计工期" prop="field110">
<el-input v-model="formData.field110" placeholder="请输入预计工期" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="投标时间" prop="field111">
<el-date-picker v-model="formData.field111" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '100%' }" placeholder="请选择投标时间" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="招聘方式" prop="field112">
<el-radio-group v-model="formData.field112" size="medium">
<el-radio v-for="(item, index) in field112Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="field113">
<el-input v-model="formData.field113" placeholder="请输入联系人" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人职位" prop="field114">
<el-input v-model="formData.field114" placeholder="请输入联系人职位" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="field115">
<el-input v-model="formData.field115" placeholder="请输入联系电话" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人部门" prop="field116">
<el-input v-model="formData.field116" placeholder="请输入联系人部门" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人" prop="field117">
<el-input v-model="formData.field117" placeholder="请输入负责人" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="关系度" prop="field118">
<el-radio-group v-model="formData.field118" size="medium">
<el-radio v-for="(item, index) in field118Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发现时间" prop="field119">
<el-date-picker v-model="formData.field119" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '100%' }" placeholder="请选择发现时间" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="信息来源" prop="field120">
<el-input v-model="formData.field120" placeholder="请输入信息来源" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="竞争对手" prop="field121">
<el-input v-model="formData.field121" placeholder="请输入竞争对手" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目建设资金来源" prop="field122" label-width="136px">
<el-radio-group v-model="formData.field122" size="medium">
<el-radio v-for="(item, index) in field122Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="建设方付款方式" prop="field123" label-width="120px">
<el-input v-model="formData.field123" placeholder="请输入建设方付款方式" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="建设方财务状况" prop="field124" label-width="136px">
<el-radio-group v-model="formData.field124" size="medium">
<el-radio v-for="(item, index) in field124Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="战略意义" prop="field125">
<el-radio-group v-model="formData.field125" size="medium">
<el-radio v-for="(item, index) in field125Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位性质" prop="field126">
<el-radio-group v-model="formData.field126" size="medium">
<el-radio v-for="(item, index) in field126Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="所属行业" prop="field127">
<el-radio-group v-model="formData.field127" size="medium">
<el-radio v-for="(item, index) in field127Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="附件" prop="field128">
<el-upload ref="field128" :file-list="field128fileList" :action="field128Action"
:before-upload="field128BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: [],
data() {
return {
formData: {
field101: undefined,
field103: undefined,
field104: undefined,
field105: undefined,
field106: [],
field107: undefined,
field108: undefined,
field109: undefined,
field110: undefined,
field111: null,
field112: undefined,
field113: undefined,
field114: undefined,
field115: undefined,
field116: undefined,
field117: undefined,
field118: undefined,
field119: null,
field120: undefined,
field121: undefined,
field122: undefined,
field123: undefined,
field124: undefined,
field125: undefined,
field126: undefined,
field127: 5,
field128: null,
},
rules: {
field101: [{
required: true,
message: '请输入客户名称',
trigger: 'blur'
}],
field103: [{
required: true,
message: '请选择项目类型',
trigger: 'change'
}],
field104: [{
required: true,
message: '请输入项目名称',
trigger: 'blur'
}],
field105: [],
field106: [{
required: true,
type: 'array',
message: '请至少选择一个项目内容',
trigger: 'change'
}],
field107: [],
field108: [],
field109: [],
field110: [],
field111: [],
field112: [],
field113: [],
field114: [],
field115: [],
field116: [],
field117: [],
field118: [],
field119: [{
required: true,
message: '请选择发现时间',
trigger: 'change'
}],
field120: [{
required: true,
message: '请输入信息来源',
trigger: 'blur'
}],
field121: [],
field122: [],
field123: [],
field124: [],
field125: [],
field126: [],
field127: [],
},
field128Action: 'https://jsonplaceholder.typicode.com/posts/',
field128fileList: [],
field103Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
field106Options: [{
"label": "备品备件",
"value": 1
}, {
"label": "硬件成套",
"value": 2
}, {
"label": "编程测试",
"value": 3
}, {
"label": "系统升级",
"value": 4
}, {
"label": "安装施工",
"value": 5
}, {
"label": "系统开发",
"value": 6
}, {
"label": "现场服务",
"value": 7
}, {
"label": "基建技改",
"value": 8
}, {
"label": "其他",
"value": 9
}],
field112Options: [{
"label": "公开招标",
"value": 1
}, {
"label": "邀标",
"value": 2
}, {
"label": "议标",
"value": 3
}],
field118Options: [{
"label": "不认识",
"value": 1
}, {
"label": "初始",
"value": 2
}, {
"label": "普通",
"value": 3
}, {
"label": "要好",
"value": 4
}, {
"label": "密切",
"value": 5
}],
field122Options: [{
"label": "自筹",
"value": 1
}, {
"label": "财政拨款",
"value": 2
}, {
"label": "政府补贴",
"value": 3
}, {
"label": "其他",
"value": 4
}],
field124Options: [{
"label": "优",
"value": 1
}, {
"label": "良好",
"value": 2
}, {
"label": "不还",
"value": 3
}, {
"label": "未知",
"value": 4
}],
field125Options: [{
"label": "持续合作",
"value": 1
}, {
"label": "潜力",
"value": 2
}, {
"label": "样板示范",
"value": 3
}],
field126Options: [{
"label": "国有企业",
"value": 1
}, {
"label": "政府",
"value": 2
}, {
"label": "部队",
"value": 3
}, {
"label": "其他",
"value": 4
}, {
"label": "集体企业",
"value": ""
}],
field127Options: [{
"label": "钢铁",
"value": 1
}, {
"label": "光伏",
"value": 2
}, {
"label": "石化",
"value": 3
}, {
"label": "电力",
"value": 4
}, {
"label": "有色",
"value": 5
}, {
"label": "食品医疗",
"value": 6
}, {
"label": "其他",
"value": 7
}],
}
},
computed: {},
watch: {},
created() { },
mounted() { },
methods: {
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field128BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
}
}
</script>
<style>
.el-upload__tip {
line-height: 1.2;
}
</style>

View File

@ -1,159 +0,0 @@
<template>
<div>
<el-card>
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" label-position="left">
<el-form-item label="组织名称" prop="field101">
<el-input v-model="formData.field101" placeholder="请输入组织名称" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="部门名称" prop="field104">
<el-select v-model="formData.field104" placeholder="请选择部门名称" clearable :style="{ width: '100%' }">
<el-option v-for="(item, index) in field104Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="field109">
<el-input v-model="formData.field109" placeholder="点教选择项目" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="项目编码" prop="field105">
<el-input v-model="formData.field105" placeholder="系统自动获取" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="客户名称" prop="field108">
<el-input v-model="formData.field108" placeholder="系统自动获取" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="需求名称" prop="field110">
<el-input v-model="formData.field110" placeholder="点击选择项目需求" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="解决方案主题" prop="field111" label-width="120px">
<el-input v-model="formData.field111" placeholder="请输入解决方案主题" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
<el-form-item label="提交时间" prop="field114">
<el-date-picker v-model="formData.field114" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '100%' }" placeholder="请选择提交时间" clearable></el-date-picker>
</el-form-item>
<el-form-item label="方案内容" prop="field117">
<el-input v-model="formData.field117" type="textarea" placeholder="请输入方案内容"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="客户反馈" prop="field115">
<el-input v-model="formData.field115" type="textarea" placeholder="请输入客户反馈"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
<el-form-item label="附件" prop="field116">
<el-upload ref="field116" :file-list="field116fileList" :action="field116Action"
:before-upload="field116BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: [],
data() {
return {
formData: {
field101: undefined,
field104: undefined,
field109: undefined,
field105: undefined,
field108: undefined,
field110: undefined,
field111: undefined,
field114: null,
field117: undefined,
field115: undefined,
field116: null,
},
rules: {
field101: [{
required: true,
message: '请输入组织名称',
trigger: 'blur'
}],
field104: [{
required: true,
message: '请选择部门名称',
trigger: 'change'
}],
field109: [{
required: true,
message: '点教选择项目',
trigger: 'blur'
}],
field105: [{
required: true,
message: '系统自动获取',
trigger: 'blur'
}],
field108: [{
required: true,
message: '系统自动获取',
trigger: 'blur'
}],
field110: [],
field111: [{
required: true,
message: '请输入解决方案主题',
trigger: 'blur'
}],
field114: [],
field117: [],
field115: [],
},
field116Action: 'https://jsonplaceholder.typicode.com/posts/',
field116fileList: [],
field104Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
}
},
computed: {},
watch: {},
created() { },
mounted() { },
methods: {
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field116BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
}
}
</script>
<style>
.el-upload__tip {
line-height: 1.2;
}
</style>

View File

@ -54,7 +54,7 @@
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
</el-form-item>
<el-form-item label="附件" prop="field127">
<el-form-item label="附件">
<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"

Some files were not shown because too many files have changed in this diff Show More