|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
|
<a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
|
|
|
<a-row :gutter="48" slot="extra">
|
|
|
- <a-col :md="48" :sm="48">
|
|
|
- <span class="table-page-search-submitButtons" style="float: right">
|
|
|
- <a-button v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="primary" @click="handleApprove()">验收</a-button>
|
|
|
- <a-button v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="danger" @click="handleReturn()">驳回</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
|
|
|
- </span>
|
|
|
- </a-col>
|
|
|
+ <a-col :md="48" :sm="48">
|
|
|
+ <span class="table-page-search-submitButtons" style="float: right">
|
|
|
+ <a-button v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="primary" @click="handleApprove()">验收</a-button>
|
|
|
+ <a-button v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="danger" @click="handleReturn()">驳回</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
|
|
|
+ </span>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
<a-layout>
|
|
|
<a-layout-content style="background-color: rgb(255, 255, 255)">
|
|
@@ -31,7 +31,7 @@
|
|
|
<upload-image-detail :images-list="model.applicationFileList"/>
|
|
|
</detail-list>
|
|
|
<a-divider orientation="left">维修详情</a-divider>
|
|
|
- <detail-list title="" :col="3">
|
|
|
+ <detail-list title="" :col="3">
|
|
|
<detail-list-item term="故障类别">{{ model.repairErrorTypeName }}</detail-list-item>
|
|
|
<detail-list-item term="维修开始时间">{{ model.repairStartTime }}</detail-list-item>
|
|
|
<detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
|
|
@@ -101,6 +101,33 @@
|
|
|
rowKey="id">
|
|
|
|
|
|
</a-table>
|
|
|
+
|
|
|
+ <title-divider title="费用清单" width="90px"></title-divider>
|
|
|
+ <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">
|
|
|
+ <a-button type="primary" @click="handleAddFee">
|
|
|
+ <a-icon type="plus"/>
|
|
|
+ 添加
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
+ <a-table
|
|
|
+ :data-source="dataFee"
|
|
|
+ :columns="columnsFee"
|
|
|
+ tableLayout="auto"
|
|
|
+ rowKey="id">
|
|
|
+ <span slot="action" slot-scope="record">
|
|
|
+ <template>
|
|
|
+ <operation-button
|
|
|
+ v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"
|
|
|
+ @click="handleEditFee(record)" >修改</operation-button>
|
|
|
+
|
|
|
+ <operation-button
|
|
|
+ v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)"
|
|
|
+ :type="2"
|
|
|
+ title="确认删除该笔费用?"
|
|
|
+ @confirm="batchDeleteFee(record.id)" >删除</operation-button>
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
<!--<q-tabs :activeKey="activeKey" @change="changeTab">
|
|
|
<q-tab-pane key="a" tab="配件更换">
|
|
|
<spare-part-used-select-table :type="1" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
|
|
@@ -110,6 +137,7 @@
|
|
|
</q-tab-pane>
|
|
|
</q-tabs>-->
|
|
|
<check-form ref="checkForm" @ok="handleOk" />
|
|
|
+ <fee-base-form ref="feeForm" @ok="handleOk" />
|
|
|
<finish-form ref="finishForm" @ok="handleOk" />
|
|
|
<dispatch-form ref="dispatchForm" @ok="handleCancel" />
|
|
|
</a-card>
|
|
@@ -125,6 +153,8 @@ import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modu
|
|
|
import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
|
|
|
import { selectSparePartUsedListByRepairId } from '@/api/sqarepartmanage/sparepartused'
|
|
|
import { selectRepairProjectListByRepairId } from '@/api/repair/repairprojectrelation'
|
|
|
+import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
|
|
|
+import { deleteRepairFees, fetchRepairFee } from '@/api/repair/fee'
|
|
|
const DetailListItem = DetailList.Item
|
|
|
|
|
|
export default {
|
|
@@ -134,6 +164,7 @@ export default {
|
|
|
DetailList,
|
|
|
DetailListItem,
|
|
|
FinishForm,
|
|
|
+ FeeBaseForm,
|
|
|
DispatchForm,
|
|
|
SparePartUsedSelectTable,
|
|
|
SparePickFormSelectTable
|
|
@@ -152,10 +183,12 @@ export default {
|
|
|
levelMap: {},
|
|
|
descripitionMap: {},
|
|
|
statusMap: {},
|
|
|
+ typeMap: {},
|
|
|
repairProjectMap: {},
|
|
|
repairTechnologyMap: {},
|
|
|
data: [],
|
|
|
dataSpare: [],
|
|
|
+ dataFee: [],
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{
|
|
@@ -228,6 +261,48 @@ export default {
|
|
|
dataIndex: 'totalPrice'
|
|
|
}
|
|
|
],
|
|
|
+ columnsFee: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'index',
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return `${index + 1}`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '费用金额',
|
|
|
+ dataIndex: 'fee',
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return this.BaseTool.Amount.formatter(text)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '费用类别',
|
|
|
+ dataIndex: 'type',
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return this.BaseTool.Object.getField(this.typeMap, text)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '费用原因',
|
|
|
+ dataIndex: 'reason'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '费用描述',
|
|
|
+ dataIndex: 'descripition'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '备注',
|
|
|
+ dataIndex: 'remark'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ key: 'action',
|
|
|
+ width: '200px',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'action' }
|
|
|
+ }
|
|
|
+ ],
|
|
|
model: {
|
|
|
'id': null,
|
|
|
'sbId': null,
|
|
@@ -264,6 +339,7 @@ export default {
|
|
|
this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
|
|
|
this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
|
|
|
this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
|
|
|
+ this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
|
|
|
},
|
|
|
methods: {
|
|
|
base (record) {
|
|
@@ -289,6 +365,34 @@ export default {
|
|
|
this.handleOk()
|
|
|
})
|
|
|
},
|
|
|
+ batchDeleteFee (id) {
|
|
|
+ let ids = []
|
|
|
+ if (this.BaseTool.String.isBlank(id)) {
|
|
|
+ const length = this.selectedRows.length
|
|
|
+ if (length === 0) {
|
|
|
+ this.$message.info('请选择要删除的记录')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ids = this.selectedRows.map(item => item.id)
|
|
|
+ } else {
|
|
|
+ ids = [id]
|
|
|
+ }
|
|
|
+ deleteRepairFees(ids).then(res => {
|
|
|
+ this.$message.info('删除成功')
|
|
|
+ this.handleOk()
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleAddFee () {
|
|
|
+ const modal = this.$refs.feeForm
|
|
|
+ modal.base(null, this.model)
|
|
|
+ },
|
|
|
+ handleEditFee (record) {
|
|
|
+ fetchRepairFee({ id: record.id }).then(res => {
|
|
|
+ const modal = this.$refs.feeForm
|
|
|
+ modal.base(res.data, this.model)
|
|
|
+ })
|
|
|
+ },
|
|
|
handleApprove () {
|
|
|
approve(this.model).then(() => {
|
|
|
this.$message.info('操作成功')
|
|
@@ -306,12 +410,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleFinish () {
|
|
|
- const modal = this.$refs.finishForm
|
|
|
- modal.base(this.model)
|
|
|
+ const modal = this.$refs.finishForm
|
|
|
+ modal.base(this.model)
|
|
|
},
|
|
|
handleDispatch () {
|
|
|
- const modal = this.$refs.dispatchForm
|
|
|
- modal.base(this.model)
|
|
|
+ const modal = this.$refs.dispatchForm
|
|
|
+ modal.base(this.model)
|
|
|
},
|
|
|
changeTab (activeKey) {
|
|
|
this.activeKey = activeKey
|