图片格式修改 ,施工管理,项目人员
This commit is contained in:
parent
5470804aad
commit
227e8ccf0c
src
api
components
views
InvoicingRequests
administrativeContracts
bid_bidding_decision
bidbbond
build
competitor
contract
contract_negotiation
custom_follow
customer_demand
customer_demand_solution
financialManagement/Management
paymentplan
paymentrequest
procurement_contract
project_document
project_estimate
project_logs
project_manager_appointment
project_personnel
project_plan
purchaseContracts
qualitycontrol/quality_detection
quotation
recordsPayment
remittance
subcontract
subcontracting_contract
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 分部分项划分表列表
|
||||
// 分项划分表列表
|
||||
export function builddivisionLists(params: any) {
|
||||
return request.get({ url: '/build.build_division/lists', params })
|
||||
}
|
||||
|
27
src/api/build/build_plan.ts
Normal file
27
src/api/build/build_plan.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 施工计划表列表
|
||||
export function buildplanLists(params: any) {
|
||||
return request.get({ url: '/build.build_plan/lists', params })
|
||||
}
|
||||
|
||||
// 添加施工计划
|
||||
export function buildplanAdd(params: any) {
|
||||
return request.post({ url: '/build.build_plan/add', params })
|
||||
}
|
||||
|
||||
// 编辑施工计划
|
||||
export function buildplanEdit(params: any) {
|
||||
return request.post({ url: '/build.build_plan/edit', params })
|
||||
}
|
||||
|
||||
// 删除施工计划
|
||||
export function buildplanDelete(params: any) {
|
||||
return request.post({ url: '/build.build_plan/delete', params })
|
||||
}
|
||||
|
||||
|
||||
// 施工计划详情
|
||||
export function buildplanDetail(params: any) {
|
||||
return request.get({ url: '/build.build_plan/detail', params })
|
||||
}
|
@ -24,4 +24,9 @@ export function buildprocesssettingsDelete(params: any) {
|
||||
// 施工工序详情
|
||||
export function buildprocesssettingsDetail(params: any) {
|
||||
return request.get({ url: '/build.build_process_settings/detail', params })
|
||||
}
|
||||
|
||||
//获取某个分部工程下的工序列表
|
||||
export function listToDivision(params: any) {
|
||||
return request.get({ url: '/build.build_process_settings/listToDivision', params })
|
||||
}
|
@ -24,3 +24,8 @@ export function apiProjectmemberDelete(params: any) {
|
||||
export function apiProjectmemberDetail(params: any) {
|
||||
return request.get({ url: '/project.project_member/detail', params })
|
||||
}
|
||||
|
||||
//获取某个项目下的所有成员
|
||||
export function listToProject(params: any) {
|
||||
return request.get({ url: '/project.project_member/listToProject', params })
|
||||
}
|
||||
|
26
src/api/project_personnel.ts
Normal file
26
src/api/project_personnel.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 项目人员表列表
|
||||
export function projectpersonnelLists(params: any) {
|
||||
return request.get({ url: '/project.project_personnel/lists', params })
|
||||
}
|
||||
|
||||
// 添加项目人员
|
||||
export function projectpersonnelAdd(params: any) {
|
||||
return request.post({ url: '/project.project_personnel/add', params })
|
||||
}
|
||||
|
||||
// 编辑项目人员
|
||||
export function projectpersonnelEdit(params: any) {
|
||||
return request.post({ url: '/project.project_personnel/edit', params })
|
||||
}
|
||||
|
||||
// 删除项目人员
|
||||
export function projectpersonnelDelete(params: any) {
|
||||
return request.post({ url: '/project.project_personnel/delete', params })
|
||||
}
|
||||
|
||||
// 项目人员详情
|
||||
export function projectpersonnelDetail(params: any) {
|
||||
return request.get({ url: '/project.project_personnel/detail', params })
|
||||
}
|
77
src/components/build_process/index.vue
Normal file
77
src/components/build_process/index.vue
Normal file
@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="工序步骤" prop="process_step">
|
||||
<el-input class="w-[280px]" v-model="queryParams.process_step" clearable placeholder="请输入工序步骤" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="分部工程" prop="division_engineering" show-overflow-tooltip />
|
||||
<el-table-column label="子分部工程" prop="sub_division_engineering" show-overflow-tooltip />
|
||||
<el-table-column label="分项工程" prop="subentry_engineering" show-overflow-tooltip />
|
||||
<el-table-column label="分项工程编码" prop="subentry_engineering_code" show-overflow-tooltip />
|
||||
<el-table-column label="工序步骤号" prop="process_step_no" show-overflow-tooltip />
|
||||
<el-table-column label="工序步骤" prop="process_step" show-overflow-tooltip />
|
||||
<el-table-column label="质量控制点" prop="quality_control_points" show-overflow-tooltip />
|
||||
<el-table-column label="图例说明" prop="file" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.file && row.file.length > 0">
|
||||
<div v-for="(item, i) in row.file " :key='i'>
|
||||
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无文件
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
import { buildprocesssettingsLists } from '@/api/build/build_process_settings'
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
process_step: ''
|
||||
});
|
||||
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: buildprocesssettingsLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
70
src/components/project-member/index.vue
Normal file
70
src/components/project-member/index.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="查询" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_name" clearable placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>-->
|
||||
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="序号" property="name" />
|
||||
<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="project_role_name" show-overflow-tooltip />
|
||||
<el-table-column label="人员" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="工时单价" prop="working_unit_price" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
import { listToProject } from '@/api/project_member'
|
||||
import { defineEmits } from "vue"
|
||||
const props = defineProps({
|
||||
project_id: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
|
||||
console.log(props.project_id)
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_id: props.project_id,
|
||||
|
||||
});
|
||||
const { dictData } = useDictData('contract_type')
|
||||
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: listToProject,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
@ -210,20 +210,15 @@ const formData = reactive({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
// for (const key in formData) {
|
||||
|
@ -368,20 +368,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -411,8 +406,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
@ -70,7 +70,17 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="附件">
|
||||
<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>
|
||||
@ -93,6 +103,7 @@ defineProps({
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formDataannex = reactive([])
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
@ -116,7 +127,21 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
|
@ -188,6 +188,7 @@ const popupTitle = computed(() => {
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
supplier_id: 0,
|
||||
contract_no: "",
|
||||
contract_name: "",
|
||||
@ -224,7 +225,7 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -88,7 +88,7 @@
|
||||
</el-upload>
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
|
||||
<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>
|
||||
@ -136,6 +136,7 @@ import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
const formDataannex = reactive([])
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
@ -145,14 +146,14 @@ const handleAvatarSuccess_four = (
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.annex.push(
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formData.annex.splice(index, 1)
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
//获取值
|
||||
const customEvent = (e: any) => {
|
||||
@ -201,6 +202,17 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
matsname.value = data.project.person
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_code
|
||||
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
|
||||
@ -221,6 +233,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
|
@ -264,20 +264,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -309,8 +304,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目计划详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<popup ref="popupRef" title="施工计划详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
@ -18,19 +18,77 @@
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划开始日期">
|
||||
{{ formData.start_time }}
|
||||
{{ formData.plan_start_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划结束日期">
|
||||
{{ formData.deliver_time }}
|
||||
{{ formData.plan_end_date }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工序步骤号">
|
||||
{{ formData.process_step_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人">
|
||||
{{ formData.project_manager_name }}
|
||||
<el-form-item label="工序步骤">
|
||||
{{ formData.process_step }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="图例说明">
|
||||
<div v-if="formData.file && formData.file.length > 0"> <material-picker v-model="formData.file" /></div>
|
||||
<div v-else>暂无文件</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质量控制点">
|
||||
{{ formData.quality_control_points }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组长">
|
||||
{{ formData.project_member_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="施工人员">
|
||||
{{ formData.work_user }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="施工内容">
|
||||
{{ formData.work_content }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="作业量">
|
||||
{{ formData.workload }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位">
|
||||
{{ formData.unit }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单价">
|
||||
{{ formData.price }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额">
|
||||
{{ formData.amount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
|
@ -2,21 +2,9 @@
|
||||
<div class="edit-popup">
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-steps :active="active" align-center style="margin-bottom: 20px;">
|
||||
<el-step title="项目经理提交" />
|
||||
<el-step title="事业部总工审核" />
|
||||
|
||||
</el-steps>
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
|
||||
<el-row :gutter="10">
|
||||
@ -33,72 +21,92 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目经理" prop="project_manage" @click="userclick">
|
||||
<el-input v-model="manage_name" readonly clearable placeholder="请输入项目经理" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="填报日期" prop="declare_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.declare_time" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择项目开始日期">
|
||||
</el-date-picker>
|
||||
<el-form-item label="工序步骤号" prop="process_id" @click="showDialog1 = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="process_step_no" clearable placeholder="请输入工序步骤号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目开始日期" prop="start_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.start_time" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择项目开始日期">
|
||||
</el-date-picker>
|
||||
<el-form-item label="工序步骤" prop="process_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="process_step" clearable placeholder="请输入工序步骤" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目交付日期" prop="deliver_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.deliver_time" 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="24">
|
||||
<el-form-item label="图例说明">
|
||||
<material-picker v-model="anneximg" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="质量控制点" prop="process_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="quality_control_points" clearable placeholder="请输入质量控制点" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<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-col :span="8">
|
||||
<el-form-item label="计划开始日期" prop="plan_start_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.plan_start_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="plan_end_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.plan_end_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="project_member_id" @click="showDialog = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formDatamember" clearable placeholder="请输入班组长" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="施工人员" prop="work_user">
|
||||
<el-input v-model="formData.work_user" clearable placeholder="请输入施工人员" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="施工内容" prop="work_content">
|
||||
<el-input v-model="formData.work_content" type="textarea" clearable placeholder="请输入施工内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="作业量" prop="workload" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.workload" type="number" clearable placeholder="请输入作业量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位" prop="unit" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.unit" clearable placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单价" prop="price" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.price" type="number" clearable placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额" prop="amount" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.amount" type="number" 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="showDialog" title="选择项目成员" width="70%">
|
||||
<customDialog @customEvent="customEvent" :project_id="formData.project_id"></customDialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showDialog1" title="选择施工工序" width="70%">
|
||||
<builddivisionDialog @customEvent="customEvent1" division_id=""></builddivisionDialog>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="showDialog2" title="选择项目" width="70%">
|
||||
<projectDialog @customEvent="customEvent2"></projectDialog>
|
||||
</el-dialog>
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1"></personnelselector>
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
@ -106,13 +114,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import customDialog from '@/components/project-member/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import salescontractDialog from '@/components/salescontract/index.vue'
|
||||
import projectDialog from '@/components/project/index.vue'
|
||||
import { apiProjectplanAdd, apiProjectplanEdit, apiProjectplanDetail } from '@/api/project_plan'
|
||||
|
||||
import { buildplanAdd, buildplanEdit, buildplanDetail } from '@/api/build/build_plan'
|
||||
import builddivisionDialog from '@/components/build_process/index.vue'
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
@ -120,42 +127,18 @@ import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import type { PropType } from 'vue'
|
||||
import configs from "@/config"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import feedback from '@/utils/feedback'
|
||||
|
||||
|
||||
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
const userStore = useUserStore();
|
||||
const active = ref(0)
|
||||
const formDataannex = reactive([])
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
const contract_name = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const custom_name = ref('')
|
||||
const manage_name = ref('')
|
||||
const personnel = ref<any>()
|
||||
// console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
const formDatamember = ref('')
|
||||
const process_step_no = ref('')
|
||||
const process_step = ref('')
|
||||
const anneximg = ref([])
|
||||
const quality_control_points = ref('')
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
@ -166,57 +149,55 @@ const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
const showDialog1 = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
const showDialog = ref(false)
|
||||
const customEvent = (e: any) => {
|
||||
formData.project_member_id = e.id;
|
||||
formDatamember.value = e.admin_name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
const customEvent1 = (e: any) => {
|
||||
formData.process_id = e.id;
|
||||
process_step_no.value = e.process_step_no
|
||||
process_step.value = e.process_step
|
||||
if (e.file && e.file.length > 0) {
|
||||
anneximg.value = e.file
|
||||
console.log(e.file, '1')
|
||||
}
|
||||
|
||||
quality_control_points.value = e.quality_control_points
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
const customEvent2 = (e: any) => {
|
||||
formData.project_id = e.id;
|
||||
project_name.value = e.name;
|
||||
project_code.value = e.project_code;
|
||||
custom_name.value = e.custom_name;
|
||||
showDialog2.value = false;
|
||||
};
|
||||
//打开弹窗
|
||||
|
||||
const userclick = () => {
|
||||
// console.log(personnel.value, '1111111')
|
||||
personnel.value.open()
|
||||
|
||||
}
|
||||
//确认
|
||||
const submituser = (e: any) => {
|
||||
formData.project_manage = e.id;
|
||||
manage_name.value = e.name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//监听输入
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目计划表' : '新增项目计划表'
|
||||
return mode.value == 'edit' ? '编辑施工计划表' : '新增施工计划表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
org_id: "",
|
||||
dept_id: "",
|
||||
project_id: 0,
|
||||
declare_time: '',
|
||||
project_manage: '',
|
||||
project_approval_date: "",
|
||||
start_time: "",
|
||||
deliver_time: "",
|
||||
remark: "",
|
||||
annex: "",
|
||||
process_approval: '{"current_step":"1","action":"1","submit_step":"2","check_user":"2","check_opinions":"dgfdsfds","copy_user":"3,4"}'
|
||||
project_id: "",
|
||||
process_id: "",
|
||||
project_member_id: 0,
|
||||
plan_start_date: '',
|
||||
plan_end_date: '',
|
||||
work_user: "",
|
||||
work_content: "",
|
||||
unit: "",
|
||||
price: "",
|
||||
amount: "",
|
||||
workload: "",
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -225,50 +206,9 @@ const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
//获取所有组织
|
||||
const getlist = () => {
|
||||
getAll().then((res) => {
|
||||
Object.assign(list1, res)
|
||||
if (res.length > 0) {
|
||||
formData.org_id = res[0].id
|
||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||
if (res.length > 0) {
|
||||
Object.assign(list2, res)
|
||||
formData.dept_id = res[0].id
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const deptrmt = (e) => {
|
||||
getlist1(e)
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
Object.assign(list2, res)
|
||||
})
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
@ -277,20 +217,24 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom_name
|
||||
formDatamember.value = data.project_member_name;
|
||||
project_name.value = data.project_name
|
||||
project_code.value = data.project_code
|
||||
manage_name.value = data.project_manager_name
|
||||
|
||||
if (data && data.contract_name) {
|
||||
contract_name.value = data.contract_name;
|
||||
|
||||
process_step_no.value = data.process_step_no
|
||||
process_step.value = data.process_step
|
||||
if (data.file && data.file.length > 0) {
|
||||
anneximg.value = data.file
|
||||
console.log(data.file, '1')
|
||||
}
|
||||
|
||||
quality_control_points.value = data.quality_control_points
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiProjectplanDetail({
|
||||
const data = await buildplanDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
@ -299,16 +243,23 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
const endTime = new Date(formData.plan_end_date)
|
||||
const startTime = new Date(formData.plan_start_date)
|
||||
if (endTime < startTime) {
|
||||
feedback.msgError("结束时间不能小于开始时间");
|
||||
return
|
||||
} else if (startTime > endTime) {
|
||||
feedback.msgError("开始时间不能大于结束时间");
|
||||
return
|
||||
} else {
|
||||
console.log("开始时间和结束时间合法");
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await apiProjectplanEdit(data)
|
||||
: await apiProjectplanAdd(data)
|
||||
? await buildplanEdit(data)
|
||||
: await buildplanAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
@ -319,7 +270,7 @@ const open = (type = 'add') => {
|
||||
popupRef.value?.open()
|
||||
|
||||
|
||||
getlist()
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,14 +2,15 @@
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="填报日期" prop="declare_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.declare_time" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择填报日期">
|
||||
</el-date-picker>
|
||||
<el-form-item label="作业编码" prop="zy_code">
|
||||
<el-input v-model="queryParams.zy_code" clearable placeholder="请输入作业编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="施工人员" prop="work_user">
|
||||
<el-input v-model="queryParams.work_user" clearable placeholder="请输入施工人员" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="项目时间范围">
|
||||
<el-date-picker v-model="dtimevalue" type="daterange" start-placeholder="项目开始日期" end-placeholder="项目交付日期" :default-time="defaultTime" value-format="YYYY-MM-DD " @change="dateclick" />
|
||||
<el-form-item label="计划时间范围">
|
||||
<el-date-picker v-model="dtimevalue" type="daterange" start-placeholder="计划开始日期" end-placeholder="计划结束日期" :default-time="defaultTime" value-format="YYYY-MM-DD " @change="dateclick" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@ -20,58 +21,46 @@
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['project.project_plan/add']" type="primary" @click="handleAdd">
|
||||
<el-button v-perms="['build.build_plan/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_plan/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
<el-button v-perms="['build.build_plan/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="作业编码" prop="zy_code" 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="sort" show-overflow-tooltip />
|
||||
<el-table-column label="是否末节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="一级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="二级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="三级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="四级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="五级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="六级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="七级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="八级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="九级节点" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="计划开始日期" prop="start_time" show-overflow-tooltip />
|
||||
<el-table-column label="计划结束日期" prop="deliver_time" show-overflow-tooltip />
|
||||
<el-table-column label="负责人" prop="project_manager_name" show-overflow-tooltip />
|
||||
<el-table-column label="预算工时" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="工时单价" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="预算工时费" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="实际开始日期" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="实际结束日期" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="实际工时" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="实际工时费" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="权重" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="工时进度" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="输出资料" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="权重" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="排序号" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="关键里程碑" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="分项工程" prop="subentry_engineering" show-overflow-tooltip />
|
||||
<el-table-column label="工序步骤号" prop="process_step_no" show-overflow-tooltip />
|
||||
<el-table-column label="工序步骤" prop="process_step" show-overflow-tooltip />
|
||||
<el-table-column label="计划开始日期" prop="plan_start_date" show-overflow-tooltip />
|
||||
<el-table-column label="计划结束日期" prop="plan_end_date" show-overflow-tooltip />
|
||||
<el-table-column label="班组长" prop="project_member_name" show-overflow-tooltip />
|
||||
<el-table-column label="施工人员" prop="work_user" show-overflow-tooltip />
|
||||
<el-table-column label="施工内容" prop="work_content" show-overflow-tooltip />
|
||||
<el-table-column label="作业量" prop="workload" show-overflow-tooltip />
|
||||
<el-table-column label="单位" prop="unit" show-overflow-tooltip />
|
||||
<el-table-column label="完工作业量 " prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="剩余作业量" prop="plan_start_date" show-overflow-tooltip />
|
||||
<el-table-column label="进度(%)" prop="plan_end_date" show-overflow-tooltip />
|
||||
<el-table-column label="单价" prop="price" show-overflow-tooltip />
|
||||
<el-table-column label="金额" prop="amount" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project_plan/edit']" type="primary" link @click="handleEdit(row)">
|
||||
<el-button v-perms="['build.build_plan/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_plan/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
<el-button v-perms="['build.build_plan/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_plan/detail']" link @click="handledetail(row)">
|
||||
<el-button v-perms="['build.build_plan/detail']" link @click="handledetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
|
||||
@ -91,7 +80,7 @@
|
||||
<script lang="ts" setup name="projectLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiProjectplanLists, apiProjectplanDelete, apiProjectplanDetail } from '@/api/project_plan'
|
||||
import { buildplanLists, buildplanDelete, buildplanDetail } from '@/api/build/build_plan'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
const protype = reactive([])
|
||||
@ -106,14 +95,15 @@ const showDtail = ref(false)
|
||||
const dtimevalue = ref([])
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
deliver_time: '',
|
||||
start_time: '',
|
||||
declare_time: ''
|
||||
zy_code: '',
|
||||
plan_end_date: '',
|
||||
plan_start_date: '',
|
||||
work_user: ''
|
||||
})
|
||||
//查询
|
||||
const dateclick = (e: any) => {
|
||||
queryParams.start_time = e[0]
|
||||
queryParams.deliver_time = e[1]
|
||||
queryParams.plan_start_date = e[0]
|
||||
queryParams.plan_end_date = e[1]
|
||||
}
|
||||
|
||||
//重置
|
||||
@ -138,7 +128,7 @@ const handleSelectionChange = (val: any[]) => {
|
||||
const { dictData } = useDictData('')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiProjectplanLists,
|
||||
fetchFun: buildplanLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
@ -153,7 +143,7 @@ const handleAdd = async () => {
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
console.log(data.id)
|
||||
let res = await apiProjectplanDetail({ id: data.id })
|
||||
let res = await buildplanDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
@ -163,11 +153,11 @@ const handleEdit = async (data: any) => {
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiProjectplanDelete({ id })
|
||||
await buildplanDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiProjectplanDetail({ id: data.id })
|
||||
let res = await buildplanDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
|
@ -26,6 +26,37 @@
|
||||
{{ formData.subentry_engineering_code }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工序步骤号">
|
||||
{{ formData.process_step_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工序步骤">
|
||||
{{ formData.process_step }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质量控制点">
|
||||
{{ formData.quality_control_points }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质量控制点">
|
||||
{{ formData.quality_control_points }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="图例说明">
|
||||
<div v-if="formData.annex && formData.annex.length > 0">
|
||||
<material-picker v-model="formData.annex" />
|
||||
</div>
|
||||
<div>
|
||||
暂无文件
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
@ -44,19 +44,7 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<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" :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>
|
||||
<material-picker v-model="formData.annex" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -90,11 +78,7 @@ import { buildprocesssettingsAdd, buildprocesssettingsEdit, buildprocesssettings
|
||||
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 formDataannex = reactive([])
|
||||
|
||||
const showDialog = ref(false)
|
||||
const subentry_engineering = ref('')
|
||||
const subentry_engineering_code = ref('')
|
||||
@ -111,27 +95,8 @@ const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑分部分项划分表' : '新增分部分项划分表'
|
||||
@ -165,22 +130,7 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
|
||||
if (data.file && data.file.length > 0) {
|
||||
if (data.file.includes(",")) {
|
||||
const arry1 = data.file.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.file }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
@ -202,9 +152,7 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
|
||||
if (formDataannex.length > 0) {
|
||||
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
@ -2,22 +2,8 @@
|
||||
<div class="edit-popup">
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-steps :active="active" align-center style="margin-bottom: 20px;">
|
||||
<el-step title="项目经理提交" />
|
||||
<el-step title="事业部总工审核" />
|
||||
|
||||
</el-steps>
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||
|
||||
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
|
||||
<el-row :gutter="10">
|
||||
|
||||
@ -33,66 +19,159 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目经理" prop="project_manage" @click="userclick">
|
||||
<el-input v-model="manage_name" readonly clearable placeholder="请输入项目经理" />
|
||||
|
||||
<el-form-item label="工序步骤号" prop="process_step_no" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.process_step_no" clearable placeholder="请输入工序步骤号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工序步骤" prop="process_step" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.process_step" clearable placeholder="请输入工序步骤" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="图例说明">
|
||||
<material-picker v-model="formData.annex" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="质量控制点" prop="quality_control_points" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.quality_control_points" clearable placeholder="请输入质量控制点" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="填报日期" prop="declare_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.declare_time" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择项目开始日期">
|
||||
<el-form-item label="计划开始日期" prop="start_time" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.start_time" 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="start_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.start_time" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择项目开始日期">
|
||||
<el-form-item label="计划结束日期" prop="deliver_time" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.deliver_time" 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="deliver_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.deliver_time" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择项目交付日期">
|
||||
</el-date-picker>
|
||||
|
||||
<el-form-item label="班组长" prop="remark" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.remark" 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="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 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="remark" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.remark" type="number" clearable placeholder="请输入作业量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="剩余作业量" prop="remark" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.remark" 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="deliver_time" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.deliver_time" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择填报日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div>
|
||||
人工明细
|
||||
</div>
|
||||
<el-row>
|
||||
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="序号" width="105px">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)" size="small">+</el-button>
|
||||
<el-button @click="handleDelete(row)" size="small">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="一级科目" prop="name1">
|
||||
<template #default="{ row, column, $index }">
|
||||
<el-input v-model="row.name1" @click="subjectmu(row, column, $index)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="二级科目" prop="name2">
|
||||
<template #default="{ row }"> <el-input v-model="row.name2" /> </template></el-table-column>
|
||||
<el-table-column label="1月" prop="month1">
|
||||
<template #default="{ row }"> <el-input v-model="row.month1" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="2月" prop="month2">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month2" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="3月" prop="month3">
|
||||
<template #default="{ row }"> <el-input v-model="row.month3" type="number" /> </template></el-table-column>
|
||||
|
||||
<el-table-column label="4月" prop="month4">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month4" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="5月" prop="month5">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month5" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="6月" prop="month6">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month6" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="7月" prop="month7">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month7" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="8月" prop="month8">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month8" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="9月" prop="month9">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month9" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="10月" prop="month10">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month10" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="11月" prop="month11">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month11" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="12月" prop="month12">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.month12" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 其他列 -->
|
||||
</el-table>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||
<el-dialog v-model="showDialog" title="选择项目成员" width="70%">
|
||||
<customDialog @customEvent="customEvent"></customDialog>
|
||||
</el-dialog> -->
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog v-model="showDialog2" title="选择项目" width="70%">
|
||||
@ -106,7 +185,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectEdit">
|
||||
import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import customDialog from '@/components/project-member/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import salescontractDialog from '@/components/salescontract/index.vue'
|
||||
@ -120,42 +199,14 @@ import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
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 list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
const contract_name = ref('')
|
||||
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const custom_name = ref('')
|
||||
const manage_name = ref('')
|
||||
const personnel = ref<any>()
|
||||
// console.log(userInfo, '222222')
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formDataannex.push(
|
||||
{ uri: response.data.uri, name: response.data.name }
|
||||
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => {
|
||||
formDataannex.splice(index, 1)
|
||||
}
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
@ -166,7 +217,7 @@ const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
const showDialog = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
|
||||
const customEvent2 = (e: any) => {
|
||||
@ -176,6 +227,28 @@ const customEvent2 = (e: any) => {
|
||||
custom_name.value = e.custom_name;
|
||||
showDialog2.value = false;
|
||||
};
|
||||
const customEvent = (e: any) => {
|
||||
|
||||
showDialog2.value = false;
|
||||
};
|
||||
const tableData = ref([
|
||||
// 表格数据
|
||||
{ name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', },
|
||||
]);
|
||||
|
||||
const handleAdd = (row) => {
|
||||
// 在 row 后面插入一行数据
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index + 1, 0, { name1: "", name2: "", month1: ' ', month2: ' ', month3: ' ', month4: ' ', month5: ' ', month6: ' ', month7: ' ', month8: ' ', month9: ' ', month10: ' ', month11: ' ', month12: ' ', });
|
||||
};
|
||||
|
||||
const handleDelete = (row) => {
|
||||
// 删除 row
|
||||
const index = tableData.value.indexOf(row);
|
||||
tableData.value.splice(index, 1);
|
||||
};
|
||||
|
||||
|
||||
//打开弹窗
|
||||
|
||||
const userclick = () => {
|
||||
@ -254,20 +327,15 @@ const getlist1 = (id: any) => {
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -300,9 +368,10 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
||||
const data = { ...formData }
|
||||
|
@ -211,7 +211,7 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
deptAll({ 'org_id': data.org_id }).then((res) => {
|
||||
Object.assign(jobs, res)
|
||||
})
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -105,12 +105,13 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件" prop="field127">
|
||||
|
||||
<div>
|
||||
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||
<div v-if="formDataannex.length > 0">
|
||||
<div v-for="(item, index) in formDataannex" :key="index" style="margin-left: 5px;display: block;">
|
||||
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||
<!-- <span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>暂无文件</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -155,7 +156,7 @@ const formData = reactive({
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -2,6 +2,15 @@
|
||||
<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="140px" :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="customer_id" @click="showDialog = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
@ -69,17 +78,26 @@
|
||||
<el-input v-model="formData.party_b_email" clearable placeholder="请输入乙方邮箱" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入金额" />
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入金额" @input="amountinput" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="金额大写" prop="amount_daxie">
|
||||
<el-input v-model="formData.amount_daxie" clearable placeholder="请输入金额大写" />
|
||||
<el-input v-model="formData.amount_daxie" readonly clearable placeholder="请输入金额大写" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="业务负责人" prop="business_director">
|
||||
<el-input v-model="formData.business_director" clearable placeholder="请输入业务负责人" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
</el-form-item></el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="合同状态" prop="contract_status">
|
||||
<el-input v-model="formData.contract_status" clearable placeholder="请输入合同状态" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-radio-group v-model="formData.contract_status" placeholder="请选择合同状态">
|
||||
<el-radio v-for="(item, index) in dictData.contract_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="expire">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.expire" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择合同有效期">
|
||||
</el-date-picker>
|
||||
@ -151,12 +169,17 @@ const formDataannex = reactive([])
|
||||
import configs from "@/config"
|
||||
const base_url = configs.baseUrl + configs.urlPrefix
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { toChinesNum } from "@/utils/util";
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const custom_name = ref('')
|
||||
const document_name = ref('')
|
||||
const document_code = ref('')
|
||||
const bidding_code = ref('')
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
const userStore = useUserStore();
|
||||
//验证
|
||||
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
|
||||
@ -217,6 +240,39 @@ const customEvent1 = (e: any) => {
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
//监听输入 金额大写
|
||||
const amountinput = (e) => {
|
||||
// console.log(e)
|
||||
if (e && e > 0) {
|
||||
formData.amount_daxie = toChinesNum(e)
|
||||
}
|
||||
}
|
||||
//获取所有组织
|
||||
const getlist = () => {
|
||||
getAll().then((res) => {
|
||||
Object.assign(list1, res)
|
||||
if (res.length > 0) {
|
||||
formData.org_id = res[0].id
|
||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||
if (res.length > 0) {
|
||||
Object.assign(list2, res)
|
||||
formData.dept_id = res[0].id
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
//获取部门
|
||||
const deptrmt = (e) => {
|
||||
getlist1(e)
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
Object.assign(list2, res)
|
||||
})
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目合同' : '新增项目合同'
|
||||
@ -225,7 +281,9 @@ const popupTitle = computed(() => {
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
approve_id: '',
|
||||
dept_id: '',
|
||||
org_id: '',
|
||||
approve_id: 1,
|
||||
customer_id: '',
|
||||
buy_bidding_document_id: '',
|
||||
contract_name: '',
|
||||
@ -264,23 +322,22 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
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 (formData.dept_id) {
|
||||
getlist1(formData.dept_id)
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
@ -305,7 +362,7 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item) => item.uri))
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
@ -320,6 +377,7 @@ const handleSubmit = async () => {
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
|
@ -49,8 +49,14 @@
|
||||
<el-table-column label="乙方" prop="party_b" show-overflow-tooltip />
|
||||
<el-table-column label="金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="业务负责人" prop="business_director" show-overflow-tooltip />
|
||||
<el-table-column label="合同状态" prop="contract_status" show-overflow-tooltip />
|
||||
<el-table-column label="合同状态" prop="contract_status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.contract_status" :value="row.contract_status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同有效期" prop="expire" show-overflow-tooltip />
|
||||
|
||||
|
||||
<el-table-column label="签约日期" prop="contract_date" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@ -103,11 +109,11 @@ const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ approve_id }) => approve_id)
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('contract_type,contract_pricing_method')
|
||||
const { dictData } = useDictData('contract_type,contract_pricing_method,contract_status')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
@ -134,9 +140,9 @@ const handleEdit = async (data: any) => {
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (approve_id: number | any[]) => {
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiContractDelete({ approve_id })
|
||||
await apiContractDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
//详情
|
||||
|
@ -8,19 +8,19 @@
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同编号" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
<el-input v-model="contract_code" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
<el-input v-model="project_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
<el-input v-model="custom_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
<el-input v-model="contract_type" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="合同计价方式" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
<el-input v-model="contract_pricing_method" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
</el-form-item></el-col><el-col :span="8">
|
||||
<el-form-item label="业务负责人" prop="contract_id" @click="showDialog = true">
|
||||
<el-input v-model="contract_name" readonly clearable placeholder="请选择合同" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||
@ -109,6 +109,12 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const contract_name = ref('')
|
||||
const contract_code = ref('')
|
||||
const project_name = ref('')
|
||||
const custom_name = ref('')
|
||||
const contract_type = ref('')
|
||||
const contract_pricing_method = ref('')
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑合同洽商' : '新增合同洽商'
|
||||
|
@ -25,7 +25,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型">
|
||||
<dict-value :options="dictData.follow_type" :value="row.types" />
|
||||
<dict-value :options="dictData.follow_type" :value="formData.types" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -199,7 +199,7 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
deptAll({ 'org_id': data.org_id }).then((res) => {
|
||||
Object.assign(jobs, res)
|
||||
})
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -187,7 +187,7 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
deptAll({ 'org_id': data.org_id }).then((res) => {
|
||||
Object.assign(jobs, res)
|
||||
})
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -356,20 +356,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -440,8 +435,9 @@ const handleSubmit = async () => {
|
||||
Object.assign(formData.detail, arr1)
|
||||
}
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
|
@ -359,20 +359,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
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) {
|
||||
@ -394,7 +389,9 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
})
|
||||
// console.log(arry2, '22222222')
|
||||
}
|
||||
|
||||
if (formData.dept_id) {
|
||||
getlist1(formData.dept_id)
|
||||
}
|
||||
|
||||
// console.log(formData, '2222222222')
|
||||
|
||||
@ -443,8 +440,9 @@ const handleSubmit = async () => {
|
||||
Object.assign(formData.detail, arr1)
|
||||
}
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
|
@ -115,20 +115,15 @@ const formData = reactive({
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -246,20 +246,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -291,8 +286,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
@ -338,20 +338,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -382,8 +377,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
@ -145,7 +145,7 @@ const formData = reactive({
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -332,7 +332,7 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -99,20 +99,14 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -200,20 +200,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -223,15 +218,13 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
custom_name.value = data.custom_name
|
||||
|
||||
project_name.value = data.project_name
|
||||
project_code.value = data.project_code
|
||||
manage_name.value = data.project_manager_name
|
||||
document_no.value = data.code
|
||||
large_document.value = data.large_category;
|
||||
middle_document.value = data.middle_category;
|
||||
|
||||
if (data && data.contract_name) {
|
||||
contract_name.value = data.contract_name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -246,7 +239,7 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
@ -37,7 +37,18 @@
|
||||
<el-table-column label="文档编号" prop="code" show-overflow-tooltip />
|
||||
<el-table-column label="文档名称" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="版本号" prop="version" show-overflow-tooltip />
|
||||
<el-table-column label="附件" prop="annex" show-overflow-tooltip />
|
||||
<el-table-column label="附件" prop="annex" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.annex && row.annex.length > 0">
|
||||
<div v-for="(item, i) in row.annex " :key='i'>
|
||||
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无文件
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project_document/edit']" type="primary" link @click="handleEdit(row)">
|
||||
|
@ -241,7 +241,7 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
deptAll({ 'org_id': data.org_id }).then((res) => {
|
||||
Object.assign(jobs, res)
|
||||
})
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -146,7 +146,7 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -67,7 +67,20 @@
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field127">
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
@ -94,7 +107,7 @@ defineProps({
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const formDataannex = reactive([])
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
@ -113,7 +126,17 @@ const formData = reactive({
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -46,12 +46,14 @@
|
||||
<el-input v-model="contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="项目类型" prop="project_type_id">
|
||||
<el-select class="w-[280px]" v-model="formData.project_type_id" clearable placeholder="请选择项目类型">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目类型" prop="project_type_id">
|
||||
<el-select class="w-[280px]" v-model="formData.project_type_id" clearable placeholder="请选择项目类型">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, index) in protype" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目经理" prop="project_manager" @click="userclick">
|
||||
<el-input v-model="manage_name" readonly clearable placeholder="请输入项目经理" />
|
||||
@ -67,20 +69,20 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="立项日期" prop="project_approval_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.project_approval_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择签订日期">
|
||||
<el-date-picker v-model="formData.project_approval_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="start_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.start_date" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择项目开始日期">
|
||||
<el-date-picker v-model="formData.start_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="delivery_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.delivery_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择项目交付日期">
|
||||
<el-date-picker v-model="formData.delivery_date" clearable type="date" value-format="YYYY-MM-DD " placeholder="选择项目交付日期">
|
||||
</el-date-picker>
|
||||
|
||||
</el-form-item>
|
||||
@ -323,20 +325,15 @@ const getlist1 = (id: any) => {
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -370,8 +367,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
161
src/views/project_personnel/detail.vue
Normal file
161
src/views/project_personnel/detail.vue
Normal file
@ -0,0 +1,161 @@
|
||||
|
||||
<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="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.project_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project_code }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名">
|
||||
{{ formData.name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号">
|
||||
{{ formData.idcard
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工种">
|
||||
<dict-value :options="dictData.work_type" :value="row.work_type" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人工单价">
|
||||
{{ formData.unit_price }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证正面">
|
||||
<material-picker v-model="formData.idcard_front" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证反面">
|
||||
<material-picker v-model="formData.idcard_backend" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="银行卡照片">
|
||||
<material-picker v-model="formData.bank_card" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行卡号">
|
||||
{{ formData.bank_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户银行">
|
||||
{{ formData.deposit_bank }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ formData.remark }}
|
||||
</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>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
console.log('1111111')
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
273
src/views/project_personnel/edit.vue
Normal file
273
src/views/project_personnel/edit.vue
Normal file
@ -0,0 +1,273 @@
|
||||
<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="project_id" @click="showDialog2 = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_name" clearable readonly placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="project_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="project_code" clearable readonly placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="name" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.name" clearable placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="身份证号" prop="idcard" :rules="[{ required: true, validator: checkIDcard, trigger: 'blur' }]">
|
||||
<el-input v-model="formData.idcard" clearable placeholder="请输入身份证号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机号" prop="mobile" :rules="[{ required: true, validator: checkPhone, trigger: 'blur' }]">
|
||||
<el-input v-model="formData.mobile" clearable placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工种" prop="work_type" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
<el-select v-model="formData.work_type" clearable placeholder="请选择工种">
|
||||
<el-option v-for="(item, index) in dictData.work_type" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="人工单价" prop="unit_price">
|
||||
<el-input v-model="formData.unit_price" clearable placeholder="请输入人工单价" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="每日生活费" prop="daily_living_expenses">
|
||||
<el-input v-model="formData.daily_living_expenses" clearable placeholder="请输入每日生活费" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证正面">
|
||||
<material-picker v-model="formData.idcard_front" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证反面">
|
||||
<material-picker v-model="formData.idcard_backend" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="银行卡照片">
|
||||
<material-picker v-model="formData.bank_card" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行卡号" prop="bank_no">
|
||||
<el-input v-model="formData.bank_no" clearable placeholder="请输入银行卡号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行" prop="deposit_bank">
|
||||
<el-input v-model="formData.deposit_bank" clearable placeholder="请输入开户银行" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="初期收入" prop="opening_income">
|
||||
<el-input v-model="formData.opening_income" clearable placeholder="请输入初期收入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<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="showDialog2" title="选择项目" width="70%">
|
||||
<projectDialog @customEvent="customEvent2"></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 documentDialog from '@/components/project_document/index.vue'
|
||||
import projectDialog from '@/components/project/index.vue'
|
||||
import { projectpersonnelAdd, projectpersonnelEdit, projectpersonnelDetail } from '@/api/project_personnel'
|
||||
import { getAllProjectTypes } from '@/api/projecttype'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
|
||||
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
|
||||
const customEvent2 = (e: any) => {
|
||||
formData.project_id = e.id;
|
||||
project_name.value = e.name;
|
||||
project_code.value = e.project_code;
|
||||
showDialog2.value = false;
|
||||
};
|
||||
|
||||
|
||||
//验证
|
||||
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
|
||||
const phoneReg = /^1[3|4|5|7|8][0-9]{9}$/
|
||||
if (!value) {
|
||||
return callback(new Error('电话号码不能为空'))
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (phoneReg.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('电话号码格式不正确'))
|
||||
}
|
||||
|
||||
}, 100)
|
||||
}
|
||||
|
||||
const checkIDcard = (rule: any, value: any, callback: (arg0: Error) => any) => {
|
||||
const Reg = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[Xx\d]$/
|
||||
if (!value) {
|
||||
return callback(new Error('身份证号码不能为空'))
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (Reg.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('身份证号码格式不正确'))
|
||||
}
|
||||
|
||||
}, 100)
|
||||
}
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑项目人员表' : '新增项目人员表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: "",
|
||||
name: "",
|
||||
idcard: "",
|
||||
mobile: "",
|
||||
work_type: "",
|
||||
unit_price: "",
|
||||
daily_living_expenses: "",
|
||||
idcard_front: "",
|
||||
idcard_backend: "",
|
||||
bank_card: "",
|
||||
bank_no: "",
|
||||
deposit_bank: "",
|
||||
remark: "",
|
||||
opening_income: "",
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
|
||||
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
project_name.value = data.project_name
|
||||
project_code.value = data.project_code
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await projectpersonnelDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit'
|
||||
? await projectpersonnelEdit(data)
|
||||
: await projectpersonnelAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
147
src/views/project_personnel/index.vue
Normal file
147
src/views/project_personnel/index.vue
Normal file
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input class="w-[280px]" v-model="queryParams.mobile" clearable placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-select v-model="queryParams.work_type" clearable placeholder="请选择工种">
|
||||
<el-option v-for="(item, index) in dictData.work_type" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
<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="['project.project_document/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_document/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="ID" prop="id" 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="name" show-overflow-tooltip />
|
||||
<el-table-column label="身份证号" prop="idcard" show-overflow-tooltip />
|
||||
<el-table-column label="工种" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.work_type" :value="row.work_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人工单价" prop="unit_price" show-overflow-tooltip />
|
||||
<el-table-column label="银行卡号" prop="bank_no" show-overflow-tooltip />
|
||||
<el-table-column label="开户银行" prop="deposit_bank" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project_document/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_document/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project_document/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 { projectpersonnelLists, projectpersonnelDelete, projectpersonnelDetail } from '@/api/project_personnel'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
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 queryParams = reactive({
|
||||
mobile: '',
|
||||
name: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('work_type')
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: projectpersonnelLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
console.log(data.id)
|
||||
let res = await projectpersonnelDetail({ 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 projectpersonnelDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await projectpersonnelDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -31,6 +31,20 @@
|
||||
{{ formData.project_manager_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-form-item label="附件" prop="field127">
|
||||
|
||||
|
||||
<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-card>
|
||||
</el-form>
|
||||
@ -54,7 +68,7 @@ defineProps({
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const formDataannex = reactive([])
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
@ -72,7 +86,17 @@ const formData = reactive({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -254,20 +254,15 @@ const getlist1 = (id: any) => {
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -300,7 +295,7 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
@ -340,7 +340,7 @@ const formRules = reactive<any>({
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -48,11 +48,11 @@
|
||||
<el-table-column label="处理流程" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程步骤" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="流程编号" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="custom_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="供应商合同号" prop="supplier_contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="供应商名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="供应商编码" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="供应商名称" prop="supplier_name" show-overflow-tooltip />
|
||||
<el-table-column label="供应商编码" prop="supplier_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="不含税金额" prop="amount_excluding_tax" show-overflow-tooltip />
|
||||
|
@ -176,6 +176,7 @@ const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
const showDialog = ref(false)
|
||||
const project_name = ref('')
|
||||
import feedback from '@/utils/feedback'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
const userInfo = userStore.userInfo
|
||||
@ -321,6 +322,34 @@ const handleSubmit = async () => {
|
||||
formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
|
||||
|
||||
const startTime = new Date(formData.actual_start_time)
|
||||
const endTime = new Date(formData.actual_end_time)
|
||||
if (endTime < startTime) {
|
||||
feedback.msgError("实际结束时间不能小于实际开始时间");
|
||||
return
|
||||
} else if (startTime > endTime) {
|
||||
feedback.msgError("实际开始时间不能大于实际结束时间");
|
||||
return
|
||||
} else {
|
||||
console.log("实际开始时间和实际结束时间合法");
|
||||
}
|
||||
|
||||
|
||||
const startTime1 = new Date(formData.scheduled_start_time)
|
||||
const endTime1 = new Date(formData.scheduled_end_time)
|
||||
if (endTime1 < startTime1) {
|
||||
feedback.msgError("计划结束时间不能小于计划开始时间");
|
||||
return
|
||||
} else if (startTime1 > endTime1) {
|
||||
feedback.msgError("计划开始时间不能大于计划结束时间");
|
||||
return
|
||||
} else {
|
||||
console.log("计划开始时间和计划结束时间合法");
|
||||
}
|
||||
|
||||
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
||||
|
@ -260,7 +260,7 @@ const handleDelete = (row: any) => {
|
||||
};
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -130,20 +130,15 @@ const formData = reactive({
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -346,20 +346,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -392,8 +387,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
@ -117,20 +117,15 @@ const formData = reactive({
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -200,20 +200,15 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.annex.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.annex }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
console.log(formDataannex)
|
||||
|
||||
}
|
||||
const arry1 = data.annex.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -239,8 +234,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item: any) => item.uri).toString()
|
||||
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||
}
|
||||
|
||||
console.log(formRef.value?.validate(), '22222222')
|
||||
await formRef.value?.validate()
|
||||
|
||||
|
@ -7,22 +7,22 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称">
|
||||
{{ formData.contract_name }}
|
||||
{{ formData.project.name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.contract_name }}
|
||||
{{ formData.project.project_code }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同名称">
|
||||
{{ formData.contract_name }}
|
||||
{{ formData.contract.contract_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同编号">
|
||||
{{ formData.contract_code }}
|
||||
{{ formData.contract.contract_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -31,11 +31,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.supplier_contract_no }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="洽商单名称">
|
||||
{{ formData.negotiation_name }}
|
||||
|
@ -211,7 +211,7 @@ const formData = reactive({
|
||||
})
|
||||
const customEvent = (e: any) => {
|
||||
|
||||
project_name.value = e.name
|
||||
project_name.value = e.project_name;
|
||||
formData.project_id = e.id
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
@ -228,37 +228,28 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
if (data.negotiation_quotation.length > 0) {
|
||||
if (data.negotiation_quotation.includes(",")) {
|
||||
const arry1 = data.negotiation_quotation.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.negotiation_quotation }]
|
||||
Object.assign(formDataannex, arry1)
|
||||
|
||||
}
|
||||
const arry1 = data.negotiation_quotation.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex, arry1)
|
||||
}
|
||||
if (data.negotiation_basis.length > 0) {
|
||||
if (data.negotiation_basis.includes(",")) {
|
||||
const arry1 = data.negotiation_basis.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex1, arry1)
|
||||
} else {
|
||||
const arry1 = [{ name: `文件1`, uri: data.negotiation_basis }]
|
||||
Object.assign(formDataannex1, arry1)
|
||||
|
||||
}
|
||||
const arry1 = data.negotiation_basis.map((item: any, index: any) => {
|
||||
return {
|
||||
name: `文件${index + 1}`,
|
||||
uri: item
|
||||
};
|
||||
});
|
||||
Object.assign(formDataannex1, arry1)
|
||||
|
||||
}
|
||||
// project_name.value = data.project.name
|
||||
// project_code.value = data.project.project_code
|
||||
project_name.value = data.project.name
|
||||
project_code.value = data.project.project_code
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
@ -282,10 +273,10 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.negotiation_quotation = formDataannex.map((item) => item.uri).toString()
|
||||
formData.negotiation_quotation = JSON.stringify(formDataannex.map((item) => item.uri))
|
||||
}
|
||||
if (formDataannex1.length > 0) {
|
||||
formData.negotiation_basis = formDataannex1.map((item) => item.uri).toString()
|
||||
formData.negotiation_basis = JSON.stringify(formDataannex1.map((item) => item.uri))
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
|
@ -51,9 +51,10 @@
|
||||
<el-table-column label="洽商编号" prop="negotiation_no" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="洽商单名称" prop="negotiation_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="供应商" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="amount_excluding_tax" 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="supplier_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="洽商报价金额" prop="amount_including_tax" show-overflow-tooltip />
|
||||
<el-table-column label="洽商金额" prop="negotiation_amount" show-overflow-tooltip />
|
||||
<el-table-column label="洽商类别" prop="contract_type">
|
||||
|
@ -342,7 +342,7 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
if (data.annex.length > 0) {
|
||||
if (data.annex && data.annex.length > 0) {
|
||||
if (data.file.includes(",")) {
|
||||
const arry1 = data.annex.split(',').map((item: any, index: any) => {
|
||||
return {
|
||||
|
@ -27,8 +27,8 @@
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="项目名称" prop="org_id" show-overflow-tooltip />
|
||||
<el-table-column label="供应商名称" prop="department_id" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="供应商名称" prop="supplier_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="合同名称" prop="contract_name" show-overflow-tooltip />
|
||||
|
Loading…
x
Reference in New Issue
Block a user