123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733 |
- <template>
- <div>
- <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="showSbFlag" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
- <a-button v-if="showSbFlag" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
- <a-button v-if="$auth('repair-application-forms-assign') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status" type="primary" @click="handleAssign">派工</a-button>
- <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要接收?" @confirm="receive">
- <a-button style="margin-left: 8px" style="margin-left: 16px">接收</a-button>
- </a-popconfirm>
- <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="primary" @click="handleOut">委外</a-button>
- <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 8px" type="primary" @click="handleDispatch">转派</a-button>
- <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleFinish()">维修完成</a-button>
- <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
- <a-button style="margin-left: 8px" type="primary">提交审核</a-button>
- </a-popconfirm>
- <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)">
- <a-divider orientation="left">报修详情</a-divider>
- <detail-list title="" :col="3">
- <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
- <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
- <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
- <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
- <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
- <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
- <detail-list-item term="报修人">{{ model.actualUser }}</detail-list-item>
- <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
- <detail-list-item term="紧急等级"><badge :text="BaseTool.Object.getField(levelMap,model.level)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[model.applicationLevel]"/></detail-list-item>
- <detail-list-item term="报修时间">{{ model.applyTime }}</detail-list-item>
- <detail-list-item term="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></detail-list-item>
- </detail-list>
- <detail-list title="" :col="1">
- <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
- <detail-list-item term="故障描述">{{ model.content }}</detail-list-item>
- </detail-list>
- <detail-list title="报修图片:" :col="6">
- <upload-image-detail :images-list="model.applicationFileList"/>
- </detail-list>
- <a-divider orientation="left">维修详情</a-divider>
- <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>
- <detail-list-item term="维修耗时">{{ model.repairMinutes }}</detail-list-item>
- <detail-list-item term="维修人员">{{ model.repairUserName }}</detail-list-item>
- <!--<detail-list-item term="维修次数">{{ model.repairTimes }}</detail-list-item>-->
- </detail-list>
- <detail-list title="" :col="1">
- <detail-list-item term="维修描述">{{ model.repairContent }}</detail-list-item>
- </detail-list>
- <detail-list title="维修图片:" :col="6">
- <upload-image-detail :images-list="model.repairFileList"/>
- </detail-list>
- <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
- <detail-list v-for="item in dispatchList" title="" :col="3">
- <detail-list-item term="转派人">{{ item.username }}</detail-list-item>
- <detail-list-item term="转派时间">{{ item.time }}</detail-list-item>
- <detail-list-item term="转派备注">{{ item.remark }}</detail-list-item>
- </detail-list>
- <a-divider orientation="left">验收详情</a-divider>
- <detail-list title="" :col="3">
- <detail-list-item term="验收开始时间">{{ model.checkStartTime }}</detail-list-item>
- <detail-list-item term="验收结束时间">{{ model.checkEndTime }}</detail-list-item>
- <detail-list-item term="验收人员">{{ model.checkUserName }}</detail-list-item>
- <detail-list-item term="验收描述">{{ model.checkContent }}</detail-list-item>
- </detail-list>
- <detail-list title="验收图片:" :col="6">
- <upload-image-detail :images-list="model.checkFileList"/>
- </detail-list>
- </a-layout-content>
- <a-layout-sider style="background-color: rgb(255, 255, 255)">
- <div style="margin-top: 30px;margin-left: 30px;">
- <a-steps progress-dot :current="6" direction="vertical" >
- <a-step title="报修时间:" :description="''+model.applyTime?model.applyTime:''" />
- <a-step title="维修开始时间:" :description="''+model.repairStartTime?model.repairStartTime:''" />
- <a-step title="维修结束时间:" :description="''+model.repairEndTime?model.repairEndTime:''" />
- <a-step title="验收开始时间:" :description="''+model.checkStartTime?model.checkStartTime:''" />
- <a-step title="验收结束时间:" :description="''+model.checkEndTime?model.checkEndTime:''" />
- </a-steps>
- </div>
- </a-layout-sider>
- </a-layout>
- <title-divider title="备件清单" width="90px"></title-divider>
- <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
- <a-button type="primary" @click="handleSpareStoreSelect">
- <a-icon type="plus"/>
- 添加
- </a-button>
- </div>
- <a-table
- :data-source="dataSpare"
- :columns="columnsSpare"
- :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
- tableLayout="auto"
- rowKey="id">
- <span slot="actionSpare" slot-scope="record">
- <template>
- <a v-if="$auth('repair-application-forms-finish')" @click="handleEditSpare(record)">修改</a>
- <a-divider type="vertical" />
- <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否要删除该条数据?" @confirm="batchDeleteSpare(record.id)">
- <a>删除</a>
- </a-popconfirm>
- </template>
- </span>
- </a-table>
- <!-- <title-divider title="费用清单" width="90px" v-if="model.type == 2"></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) && model.type === 2">-->
- <!-- <a-button type="primary" @click="handleAddFee">-->
- <!-- <a-icon type="plus"/>-->
- <!-- 添加-->
- <!-- </a-button>-->
- <!-- </div>-->
- <!-- <a-table-->
- <!-- v-if="model.type == 2"-->
- <!-- :data-source="dataFee"-->
- <!-- :columns="columnsFee"-->
- <!-- tableLayout="auto"-->
- <!-- rowKey="id">-->
- <!-- <span slot="action" slot-scope="record">-->
- <!-- <template>-->
- <!-- <a @click="handleViewFee(record)">查看</a>-->
- <!-- <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>-->
- <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="handleAddReason">
- <a-icon type="plus"/>
- 添加
- </a-button>
- </div>
- <a-table
- :data-source="dataReason"
- :columns="columnsReason"
- :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
- rowKey="id">
- <span slot="action" slot-scope="record">
- <template>
- <a @click="handleViewReason(record)">查看</a>
- <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="handleEditReason(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="batchDeleteReason(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="2" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
- </q-tab-pane>
- <q-tab-pane key="b" tab="备件领用">
- <spare-pick-form-select-table :type="2" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
- </q-tab-pane>
- </q-tabs>-->
- </a-card>
- <check-form ref="checkForm" @ok="handleOk" />
- <base-out-form ref="outForm" @ok="handleCancel" />
- <finish-form ref="finishForm" @ok="handleOk" />
- <dispatch-form ref="dispatchForm" @ok="handleCancel" />
- <assign-form ref="assignForm" @ok="handleCancel" />
- <spare-pick-base-form ref="baseModal" @ok="handleOk"/>
- <base-form-for-repair ref="baseFormForRepair" @ok="handleOk" />
- <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
- <fee-base-form ref="feeForm" @ok="handleOk" />
- <fee-detail ref="feeDetail" @ok="handleOk" />
- <reason-base-form ref="reasonForm" @ok="handleOk" />
- <reason-detail ref="reasonDetail" @ok="handleOk" />
- <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
- <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
- <base-form ref="baseRepairProjectModal" @ok="handleOk"/>
- <detail ref="detailRepairProjectModal"/>
- </div>
- </template>
- <script>
- import DetailList from '@/components/tools/DetailList'
- import { fetchRepairApplicationForm, examine, approve, receive } from '@/api/repair/application-form'
- import CheckForm from './CheckForm'
- import BaseOutForm from './BaseOutForm'
- import FinishForm from './FinishForm'
- import DispatchForm from './DispatchForm'
- import AssignForm from './AssignForm'
- import SparePickBaseForm from '../../../store/sparepickform/modules/BaseForm'
- import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
- import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
- import RepairProjectSelectModal from '@/views/repair/repairproject/modules/RepairProjectSelectModal'
- import { queryRepairProject, fetchRepairProject, deleteRepairProjects } from '@/api/repair/repairproject'
- import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
- import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
- import { selectSparePartUsedListByRepairId, addSparePartUsedBatch, deleteSparePartUseds } from '@/api/sqarepartmanage/sparepartused'
- import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
- import BaseTool from '@/utils/tool'
- import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
- import FeeDetail from '@/views/repair/fee/modules/Detail'
- import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
- import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
- import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
- import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
- import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
- import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
- import { fetchSbInfo } from '@/api/sb/info'
- import BaseForm from '@/views/repair/repairproject/modules/BaseForm'
- import Detail from '@/views/repair/repairproject/modules/Detail'
- const DetailListItem = DetailList.Item
- export default {
- name: 'RepairApplicationFormDetail',
- components: {
- CheckForm,
- DetailList,
- DetailSbCheck,
- DetailSbBom,
- ReasonBaseForm,
- ReasonDetail,
- DetailListItem,
- FinishForm,
- BaseOutForm,
- DispatchForm,
- FeeDetail,
- AssignForm,
- FeeBaseForm,
- SparePickBaseForm,
- SparePartUsedSelectTable,
- SparePickFormSelectTable,
- RepairProjectSelectModal,
- SparePartInfoSelectModal,
- BaseFormForRepair,
- SpareStoreSelectModal,
- BaseForm,
- Detail
- },
- data () {
- return {
- confirmLoading: false,
- mdl: {},
- modalTitle: null,
- needStopMap: {},
- dispatchList: [],
- visible: false,
- showSbFlag: false,
- sbInfo: {},
- // 下拉框map
- sourceMap: {},
- typeMap: {},
- levelMap: {},
- descripitionMap: {},
- selectedRowKeys: [],
- statusMap: {},
- repairProjectMap: {},
- repairTechnologyMap: {},
- activeKey: 'a',
- data: [],
- dataSpare: [],
- dataFee: [],
- dataReason: [],
- // 表头
- columns: [
- {
- title: '序号',
- dataIndex: 'index',
- customRender: (text, record, index) => {
- return `${index + 1}`
- }
- },
- {
- title: '维修内容',
- dataIndex: 'name'
- },
- {
- title: '操作',
- key: 'action',
- width: '200px',
- align: 'center',
- scopedSlots: { customRender: 'action' }
- }
- ],
- columnsSpare: [
- {
- title: '序号',
- dataIndex: 'index',
- customRender: (text, record, index) => {
- return `${index + 1}`
- }
- },
- {
- title: '备件名称',
- dataIndex: 'spareId',
- customRender: (text, record, index) => {
- return record.spareName
- }
- },
- {
- title: '数量',
- dataIndex: 'num'
- },
- {
- title: '价格',
- dataIndex: 'price'
- },
- {
- title: '总价',
- dataIndex: 'totalPrice'
- },
- {
- title: '更换日期',
- dataIndex: 'startDate'
- },
- {
- title: '操作',
- key: 'action',
- width: '200px',
- align: 'center',
- scopedSlots: { customRender: 'actionSpare' }
- }
- ],
- 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' }
- }
- ],
- columnsReason: [
- {
- title: '序号',
- dataIndex: 'index',
- width: '70px',
- customRender: (text, record, index) => {
- return `${index + 1}`
- }
- },
- {
- title: '分析时间',
- dataIndex: 'analyzeTime',
- width: '150px'
- },
- {
- title: '故障现象',
- dataIndex: 'problemDesc',
- ellipsis: true,
- width: '150px'
- },
- {
- title: '检查处理过程',
- dataIndex: 'checkProcess',
- ellipsis: true,
- width: '150px'
- },
- {
- title: '原因分析',
- dataIndex: 'reasonAnalysis',
- ellipsis: true,
- width: '150px'
- },
- {
- title: '操作',
- key: 'action',
- width: '200px',
- align: 'center',
- scopedSlots: { customRender: 'action' }
- }
- ],
- model: {
- 'id': null,
- 'sbId': null,
- 'partId': null,
- 'repairUserId': null,
- 'needStop': null,
- 'no': null,
- 'source': null,
- 'applyTime': null,
- 'level': null,
- 'content': null,
- 'status': null,
- 'remark': null,
- 'updateTime': null,
- 'createdUserId': null,
- 'updateUserId': null,
- 'createdUserName': null,
- 'sbName': null,
- 'partName': null,
- 'updateUserName': null,
- 'repairFormVO': null,
- 'repairCheckVO': null
- }
- }
- },
- created () {
- // 下拉框map
- this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
- this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
- this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
- this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
- this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
- this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
- 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.REPAIRE_ACTION)
- this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
- },
- methods: {
- base (record) {
- this.visible = true
- this.showSbFlag = false
- this.modalTitle = '详情'
- this.model = record
- this.activeKey = 'a'
- this.dispatchList = JSON.parse(record.repairDispatchList)
- const sbId = record.sbId
- if (sbId) {
- fetchSbInfo({ id: sbId }).then(res => {
- this.sbInfo = res.data
- this.showSbFlag = true
- })
- }
- this.init()
- },
- init () {
- queryRepairProject({ repairId: this.model.id }).then(res => {
- this.data = res.data
- })
- selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
- this.dataSpare = res.data
- })
- queryRepairFee({ repairId: this.model.id }).then(res => {
- this.dataFee = res.data
- })
- queryRepairReason({ repairId: this.model.id }).then(res => {
- this.dataReason = res.data
- })
- },
- handleViewBom (record) {
- this.visible = false
- const modal = this.$refs.detailSbBomModal
- modal.base(this.sbInfo)
- },
- handleViewCheck (record) {
- this.visible = false
- const modal = this.$refs.detailSbCheckModal
- modal.base(this.sbInfo)
- },
- handleCancel () {
- this.visible = false
- this.confirmLoading = false
- this.$emit('ok')
- },
- receive () {
- this.model.status = 3
- receive(this.model).then(() => {
- // const modal = this.$refs.finishForm
- // modal.base(that.model)
- })
- },
- 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()
- })
- },
- handleOut () {
- const modal = this.$refs.outForm
- modal.base(null, this.model)
- },
- handleAddFee () {
- const modal = this.$refs.feeForm
- modal.base(null, this.model)
- },
- handleEditFee (record) {
- fetchRepairFee({ id: record.id }).then(res => {
- const modal = this.$refs.feeForm
- const data = res.data
- data.repairNo = this.model.no
- modal.base(data, this.model)
- })
- },
- handleViewFee (record) {
- fetchRepairFee({ id: record.id }).then(res => {
- const modal = this.$refs.feeDetail
- modal.base(res.data)
- })
- },
- batchDeleteReason (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]
- }
- deleteRepairReasons(ids).then(res => {
- this.$message.info('删除成功')
- this.handleOk()
- this.$refs.table.clearSelected()
- })
- },
- handleAddReason () {
- const modal = this.$refs.reasonForm
- this.visible = false
- modal.base(null, this.model)
- },
- handleEditReason (record) {
- fetchRepairReason({ id: record.id }).then(res => {
- const modal = this.$refs.reasonForm
- this.visible = false
- modal.base(res.data, this.model)
- })
- },
- handleViewReason (record) {
- fetchRepairReason({ id: record.id }).then(res => {
- const modal = this.$refs.reasonDetail
- modal.base(res.data)
- })
- },
- handleApprove () {
- approve(this.model).then(() => {
- this.$message.info('操作成功')
- this.handleOk()
- })
- },
- handleReturn () {
- const modal = this.$refs.checkForm
- modal.base(this.model)
- },
- handleOk () {
- this.loading = true
- fetchRepairApplicationForm({ id: this.model.id }).then(res => {
- this.loading = false
- this.model = res.data
- this.visible = true
- this.dispatchList = JSON.parse(this.model.repairDispatchList)
- })
- this.init()
- },
- handleFinish () {
- const modal = this.$refs.finishForm
- modal.base(this.model)
- },
- handleExamine () {
- examine({ id: this.model.id }).then(res => {
- this.loading = false
- this.visible = true
- this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINING
- this.$message.info('已提交,请等待审核')
- })
- this.init()
- },
- handleDispatch () {
- const modal = this.$refs.dispatchForm
- modal.base(this.model)
- },
- handleAssign () {
- const modal = this.$refs.assignForm
- modal.base(this.model)
- },
- handleSparePick () {
- const modal = this.$refs.baseModal
- modal.base(null, { repairId: this.model.id, repairNo: this.model.no, reason: '维修领用' })
- },
- changeTab (activeKey) {
- this.activeKey = activeKey
- if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
- const modal = this.$refs.sparePartUsedSelectTable
- modal.handleOk()
- return
- }
- if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
- const modal = this.$refs.sparePickFormSelectTable
- modal.handleOk()
- }
- },
- handleView (record) {
- fetchRepairProject({ id: record.id }).then(res => {
- const modal = this.$refs.detailRepairProjectModal
- modal.base(res.data)
- })
- },
- handleEdit (record) {
- fetchRepairProject({ id: record.id }).then(res => {
- const modal = this.$refs.baseRepairProjectModal
- modal.base(res.data)
- })
- },
- handleRepairProjectAdd () {
- this.$refs.baseRepairProjectModal.base({ repairId: this.model.id })
- },
- batchDelete (id) {
- let ids = []
- if (this.BaseTool.String.isBlank(id)) {
- if (length === 0) {
- this.$message.info('请选择要删除的记录')
- return
- }
- ids = this.selectedRows.map(item => item.id)
- } else {
- ids = [id]
- }
- deleteRepairProjects(ids).then(res => {
- this.$message.info('删除成功')
- this.handleOk()
- })
- },
- handleSpareSelect () {
- this.$refs.spareSelectModal.base({}, { yt: 1 })
- },
- handleSpareSelected (record, keys, rows) {
- const data = []
- for (let i = 0; i < rows.length; i++) {
- data.push({ sbId: this.model.sbId, spareId: rows[i].id, repairId: this.model.id, num: 1, price: rows[i].initialValue, totalPrice: rows[i].initialValue })
- }
- addSparePartUsedBatch(data)
- .then((response) => {
- this.$message.info('添加成功')
- this.handleOk()
- }).catch(() => {
- this.confirmLoading = false
- })
- },
- batchDeleteSpare (id) {
- let ids = []
- if (this.BaseTool.String.isBlank(id)) {
- if (length === 0) {
- this.$message.info('请选择要删除的记录')
- return
- }
- ids = this.selectedRows.map(item => item.id)
- } else {
- ids = [id]
- }
- deleteSparePartUseds(ids).then(res => {
- this.$message.info('删除成功')
- this.handleOk()
- })
- },
- handleEditSpare (record) {
- const modal = this.$refs.baseFormForRepair
- modal.base(record)
- },
- handleSpareStoreSelect () {
- this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId })
- },
- handleSpareStoreSelected (record, keys, rows) {
- const data = []
- for (let i = 0; i < rows.length; i++) {
- data.push({ sbId: this.model.sbId, spareId: rows[i].spareId, repairId: this.model.id, num: 1, price: rows[i].price, totalPrice: rows[i].price, startDate: BaseTool.Date.formatter(new Date(), BaseTool.Date.PICKER_NORM_DATE_PATTERN) })
- }
- addSparePartUsedBatch(data)
- .then((response) => {
- this.$message.info('添加成功')
- this.handleOk()
- }).catch(() => {
- this.confirmLoading = false
- })
- },
- onSelectChange (selectedRowKeys) {
- console.log('selectedRowKeys changed: ', selectedRowKeys)
- this.selectedRowKeys = selectedRowKeys
- }
- }
- }
- </script>
|