|
@@ -8,39 +8,27 @@
|
|
|
>
|
|
>
|
|
|
<el-tabs v-model="activeName">
|
|
<el-tabs v-model="activeName">
|
|
|
<el-tab-pane label="选择检验项目" name="selectCheckItem">
|
|
<el-tab-pane label="选择检验项目" name="selectCheckItem">
|
|
|
- <el-form :model="queryParams" ref="queryFormRef" inline>
|
|
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryFormRef" class="view-info-form">
|
|
|
<el-form-item label="设备类型" prop="equipmentCategory">
|
|
<el-form-item label="设备类型" prop="equipmentCategory">
|
|
|
- <el-select
|
|
|
|
|
- v-model="queryParams.equipmentCategory"
|
|
|
|
|
- placeholder="请选择设备类型"
|
|
|
|
|
- clearable
|
|
|
|
|
- style="width: 150px"
|
|
|
|
|
- :disabled="true"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(label, value) in PressureBoilerEquipTypeMap"
|
|
|
|
|
- :key="value"
|
|
|
|
|
- :label="label"
|
|
|
|
|
- :value="Number(value)"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <span class="info-text">{{ PressureBoilerEquipTypeMap[String(queryParams.equipmentCategory)] || '-' }}</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="检验性质" prop="inspectionNature">
|
|
<el-form-item label="检验性质" prop="inspectionNature">
|
|
|
- <el-select
|
|
|
|
|
- v-model="queryParams.inspectionNature"
|
|
|
|
|
- placeholder="请选择检验性质"
|
|
|
|
|
- multiple
|
|
|
|
|
- clearable
|
|
|
|
|
- style="width: 150px"
|
|
|
|
|
- :disabled="true"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(label, value) in filterPressureBoilerCheckTypeMap"
|
|
|
|
|
- :key="value"
|
|
|
|
|
- :label="label"
|
|
|
|
|
- :value="Number(value)"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <span class="info-text">{{
|
|
|
|
|
+ Array.isArray(queryParams.inspectionNature)
|
|
|
|
|
+ ? queryParams.inspectionNature
|
|
|
|
|
+ .map(val => filterPressureBoilerCheckTypeMap[String(val)])
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .join('、')
|
|
|
|
|
+ : (filterPressureBoilerCheckTypeMap[String(queryParams.inspectionNature)] || '-')
|
|
|
|
|
+ }}</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="新增费用">
|
|
|
|
|
+
|
|
|
|
|
+ <div class="flex items-center gap-4 mb-2">
|
|
|
|
|
+ <span class="text-gray-600">应收法定金额: {{ formData.shouldAmount }}</span>
|
|
|
|
|
+ <span class="text-gray-600">服务收费金额: {{ formData.serviceAmount }}</span>
|
|
|
|
|
+ <span class="text-gray-600">免征费用: {{ formData.reduceFee }}</span>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div class="checkItemContentWrapper" v-loading="checkItemListLoading">
|
|
<div class="checkItemContentWrapper" v-loading="checkItemListLoading">
|
|
@@ -69,15 +57,18 @@
|
|
|
<!-- 循环渲染子项(模拟数据) -->
|
|
<!-- 循环渲染子项(模拟数据) -->
|
|
|
<div class="grid-item" v-for="(item, index) in checkItem.itemList" :key="index">
|
|
<div class="grid-item" v-for="(item, index) in checkItem.itemList" :key="index">
|
|
|
<el-checkbox
|
|
<el-checkbox
|
|
|
- :disabled="selectedPartTemIds.includes(item.templateId)"
|
|
|
|
|
|
|
+ :disabled="item.isMainProject === '1'"
|
|
|
v-model="item.use"
|
|
v-model="item.use"
|
|
|
@change="(val) => handleCheckItemSelectedChange(item, val)"
|
|
@change="(val) => handleCheckItemSelectedChange(item, val)"
|
|
|
/>
|
|
/>
|
|
|
- <span>{{ item.name }}</span>
|
|
|
|
|
|
|
+ <div style="display: flex; align-items: center; gap: 4px;">
|
|
|
|
|
+ <span v-if="item.isMainProject === '1'"
|
|
|
|
|
+ style="display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background-color: #6cbcf5; color: #fff; font-size: 12px; border-radius: 2px; font-weight: bold;">主</span>
|
|
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
|
|
+ </div>
|
|
|
<template
|
|
<template
|
|
|
v-if="
|
|
v-if="
|
|
|
- (equipmentIds.length === 1 && !selectedPartTemIds.includes(item.templateId)) ||
|
|
|
|
|
- isBatch
|
|
|
|
|
|
|
+ true
|
|
|
"
|
|
"
|
|
|
>
|
|
>
|
|
|
(
|
|
(
|
|
@@ -146,12 +137,13 @@ import CheckerSelect from '@/views/pressure2/equipboilerscheduling/components/Ch
|
|
|
import { PressureBoilerCheckTypeMap, PressureReportType } from '@/utils/constants'
|
|
import { PressureBoilerCheckTypeMap, PressureReportType } from '@/utils/constants'
|
|
|
import { ReportItemVO, BoilerTaskOrderApi } from '@/api/pressure2/boilertaskorder'
|
|
import { ReportItemVO, BoilerTaskOrderApi } from '@/api/pressure2/boilertaskorder'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
-import { is } from '@/utils/is'
|
|
|
|
|
|
|
+import { is, isEmpty } from '@/utils/is'
|
|
|
import {
|
|
import {
|
|
|
getCheckSchemeList,
|
|
getCheckSchemeList,
|
|
|
getPressureReportTemplateListNoLimit
|
|
getPressureReportTemplateListNoLimit
|
|
|
} from '@/api/pressure2/reportTemplate' // 承压报告模板
|
|
} from '@/api/pressure2/reportTemplate' // 承压报告模板
|
|
|
import { ElForm } from 'element-plus'
|
|
import { ElForm } from 'element-plus'
|
|
|
|
|
+import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
|
|
|
|
|
|
|
|
const { queryCheckItemList } = BoilerTaskOrderApi
|
|
const { queryCheckItemList } = BoilerTaskOrderApi
|
|
|
|
|
|
|
@@ -220,6 +212,12 @@ const emit = defineEmits(['update:modelValue', 'refresh'])
|
|
|
type ActiveName = 'selectCheckItem' | 'checkNotice' | 'jobGuide' | 'checkScheme' | 'subProject'
|
|
type ActiveName = 'selectCheckItem' | 'checkNotice' | 'jobGuide' | 'checkScheme' | 'subProject'
|
|
|
const activeName = ref<ActiveName>('selectCheckItem')
|
|
const activeName = ref<ActiveName>('selectCheckItem')
|
|
|
|
|
|
|
|
|
|
+const formData = ref({
|
|
|
|
|
+ shouldAmount:0,
|
|
|
|
|
+ serviceAmount:0,
|
|
|
|
|
+ reduceFee:0
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const filterPressureBoilerCheckTypeMap = computed(() => {
|
|
const filterPressureBoilerCheckTypeMap = computed(() => {
|
|
|
return Object.fromEntries(
|
|
return Object.fromEntries(
|
|
|
Object.entries(PressureBoilerCheckTypeMap).filter(([value, label]) => {
|
|
Object.entries(PressureBoilerCheckTypeMap).filter(([value, label]) => {
|
|
@@ -272,32 +270,49 @@ const handleCheckItemSelectedChange = (checkItem, selected) => {
|
|
|
|
|
|
|
|
selectedCheckItem.value.splice(index, 1)
|
|
selectedCheckItem.value.splice(index, 1)
|
|
|
}
|
|
}
|
|
|
|
|
+ calculateAmounts()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const checkItemListLoading = ref(false)
|
|
const checkItemListLoading = ref(false)
|
|
|
// 查询项目列表
|
|
// 查询项目列表
|
|
|
const handleQueryCheckItemList = async (checkType) => {
|
|
const handleQueryCheckItemList = async (checkType) => {
|
|
|
- console.log(props.selectedPartTemIds)
|
|
|
|
|
|
|
+ // 获取统一的设备类型,如果列表为空则设为 undefined
|
|
|
|
|
+ const equipType = props.orderInfo.orderItems?.length > 0 ? props.orderInfo?.orderItems[0].type : props.taskOrderItem.type
|
|
|
const params = {
|
|
const params = {
|
|
|
orderId: props.orderInfo?.id,
|
|
orderId: props.orderInfo?.id,
|
|
|
itemIds: props.equipmentIds,
|
|
itemIds: props.equipmentIds,
|
|
|
equipmentCategory: queryParams.value.equipmentCategory,
|
|
equipmentCategory: queryParams.value.equipmentCategory,
|
|
|
- inspectionNature: [checkType]
|
|
|
|
|
|
|
+ inspectionNature: [checkType],
|
|
|
|
|
+ equipType:equipType
|
|
|
}
|
|
}
|
|
|
- let queryResult = await queryCheckItemList(params)
|
|
|
|
|
- //去掉主报告
|
|
|
|
|
- queryResult = queryResult.filter(item => {
|
|
|
|
|
- return item.reportType !== 100
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const queryResult = await queryCheckItemList(params)
|
|
|
//console.log(queryResult)
|
|
//console.log(queryResult)
|
|
|
checkItemList.value.push({
|
|
checkItemList.value.push({
|
|
|
- inspectionNatureName: filterPressureBoilerCheckTypeMap.value[checkType],
|
|
|
|
|
|
|
+ inspectionNatureName: filterPressureBoilerCheckTypeMap.value[checkType] + " 法定收费项目",
|
|
|
inspectionNature: checkType,
|
|
inspectionNature: checkType,
|
|
|
|
|
+ type: '1',
|
|
|
itemList: (queryResult || []).map((item) => ({
|
|
itemList: (queryResult || []).map((item) => ({
|
|
|
...item,
|
|
...item,
|
|
|
isAutoAmount: props.isBatch ? '0' : item.isAutoAmount,
|
|
isAutoAmount: props.isBatch ? '0' : item.isAutoAmount,
|
|
|
inspectionNature: checkType,
|
|
inspectionNature: checkType,
|
|
|
- use: props.selectedPartTemIds.includes(item.templateId)
|
|
|
|
|
|
|
+ // use: props.equipmentIds.length > 1 ? false : props.selectedIds.includes(item.templateId) && item.reportType === 100
|
|
|
|
|
+ //use: props.selectedIds.includes(item.templateId)
|
|
|
|
|
+ use:false,
|
|
|
|
|
+ type: '1'
|
|
|
|
|
+ }))
|
|
|
|
|
+ })
|
|
|
|
|
+ checkItemList.value.push({
|
|
|
|
|
+ inspectionNatureName: filterPressureBoilerCheckTypeMap.value[checkType] + " 服务收费项目",
|
|
|
|
|
+ inspectionNature: checkType,
|
|
|
|
|
+ type: '2',
|
|
|
|
|
+ itemList: (queryResult || []).map((item) => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ isAutoAmount: props.isBatch ? '0' : item.isAutoAmount,
|
|
|
|
|
+ inspectionNature: checkType,
|
|
|
|
|
+ // use: props.equipmentIds.length > 1 ? false : props.selectedIds.includes(item.templateId) && item.reportType === 100
|
|
|
|
|
+ //use: props.selectedIds.includes(item.templateId)
|
|
|
|
|
+ use:false,
|
|
|
|
|
+ type: '2'
|
|
|
}))
|
|
}))
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -309,7 +324,8 @@ const getReportCheckNoticeTemplateList = async () => {
|
|
|
type: '3',
|
|
type: '3',
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
|
- status: 200
|
|
|
|
|
|
|
+ status: 200,
|
|
|
|
|
+ reportType : 400
|
|
|
}
|
|
}
|
|
|
getPressureReportTemplateListNoLimit(params)
|
|
getPressureReportTemplateListNoLimit(params)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -417,6 +433,35 @@ const handleSaveCalcFee = (templateInfo) => {
|
|
|
item.fee = templateInfo.fee
|
|
item.fee = templateInfo.fee
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ calculateAmounts()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const calculateAmounts = () => {
|
|
|
|
|
+
|
|
|
|
|
+ // 分离法定收费项目和服务收费项目
|
|
|
|
|
+ const find = checkItemList?.value.find(item => item.type === '1');
|
|
|
|
|
+ if (!find) return;
|
|
|
|
|
+ const statutoryItems = find.itemList.filter(item => item.use)
|
|
|
|
|
+ const find1 = checkItemList?.value.find(item => item.type === '2');
|
|
|
|
|
+ if (!find1) return;
|
|
|
|
|
+ const serviceItems = find1.itemList.filter(item => item.use)
|
|
|
|
|
+
|
|
|
|
|
+ // 计算法定金额总和
|
|
|
|
|
+ const totalStatutoryAmount = statutoryItems.reduce((sum, item) => sum + (item.fee * (item.quantity || 1) || 0), 0)
|
|
|
|
|
+ // 计算服务收费金额总和
|
|
|
|
|
+ const totalServiceAmount = serviceItems.reduce((sum, item) => sum + (item.fee * (item.quantity || 1) || 0), 0)
|
|
|
|
|
+
|
|
|
|
|
+ if (props.orderInfo.feeNature === '1') {
|
|
|
|
|
+ // 免征:免征费用=应收法定金额,应收法定金额=0
|
|
|
|
|
+ formData.value.reduceFee = totalStatutoryAmount
|
|
|
|
|
+ formData.value.shouldAmount = 0
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 不免征:免征费用=0,应收法定金额=总金额
|
|
|
|
|
+ formData.value.reduceFee = 0
|
|
|
|
|
+ formData.value.shouldAmount = totalStatutoryAmount
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ formData.value.serviceAmount = totalServiceAmount
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 选择检验员
|
|
// 选择检验员
|
|
@@ -517,8 +562,9 @@ const handleConfirm = async () => {
|
|
|
.map((orderItemId) => {
|
|
.map((orderItemId) => {
|
|
|
return selectedCheckItem.value.map((x,index) => ({
|
|
return selectedCheckItem.value.map((x,index) => ({
|
|
|
templateId: x.templateId,
|
|
templateId: x.templateId,
|
|
|
- fee: x.fee,
|
|
|
|
|
connectId: x.connectId,
|
|
connectId: x.connectId,
|
|
|
|
|
+ fee: x.fee,
|
|
|
|
|
+ type: x.type,
|
|
|
orderItemId
|
|
orderItemId
|
|
|
}))
|
|
}))
|
|
|
})
|
|
})
|
|
@@ -534,7 +580,6 @@ const handleConfirm = async () => {
|
|
|
partType: props.partTypeId,
|
|
partType: props.partTypeId,
|
|
|
itemList,
|
|
itemList,
|
|
|
}
|
|
}
|
|
|
- console.log(params)
|
|
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
const result = await BoilerTaskOrderApi.addPartReport(params)
|
|
const result = await BoilerTaskOrderApi.addPartReport(params)
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -648,6 +693,31 @@ const handleConfirm = async () => {
|
|
|
text-align: left;
|
|
text-align: left;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// 查看信息表单样式优化
|
|
|
|
|
+.view-info-form {
|
|
|
|
|
+ background: #f5f7fa;
|
|
|
|
|
+ padding: 16px 20px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
+
|
|
|
|
|
+ :deep(.el-form-item) {
|
|
|
|
|
+ margin-right: 32px;
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ :deep(.el-form-item__label) {
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #606266;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .info-text {
|
|
|
|
|
+ color: #303133;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
.AddOrEditCheckItemForEquipmentDialog {
|
|
.AddOrEditCheckItemForEquipmentDialog {
|