| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406 |
- <template>
- <view class="container">
- <u-tabs :list="list" :is-scroll="true" :current="current" @change="change"></u-tabs>
- <view v-if="current == 0">
- <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
- <equipment-line title="报修单号" :content="infoData.no" />
- <equipment-line title="设备名称" :content="infoData.sbName" />
- <equipment-line title="是否停机" :content="$BaseTool.Object.getField(needStopMap, infoData.needStop)" />
- <equipment-line title="报修人" :content="infoData.userName" />
- <equipment-line title="报修来源" :content="$BaseTool.Object.getField(sourceMap, infoData.source)" />
- <equipment-line title="紧急等级" :content="$BaseTool.Object.getField(levelMap, infoData.level)" />
- <equipment-line title="报修时间" :content="infoData.applyTime" />
- <equipment-line title="状态" :content="$BaseTool.Object.getField(levelMap, infoData.status)" />
- <view class="d-flex py3 border-bottom">
- <view class="f-size-26 text-color-9 w200">图片</view>
- <view class="f-size-26 text-color-3 d-flex">
- <block v-for="(item, index) in imagesList" :key="index">
- <u-image width="100" class="mr-2" :src="item" @click="handlePre(index)"
- mode="widthFix"><u-loading slot="loading"></u-loading></u-image>
- </block>
- </view>
- </view>
- </view>
- </view>
- <view v-if="current == 1">
- <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
- <template v-if="infoData">
- <equipment-line title="故障类别" :content="infoData.repairErrorTypeName" />
- <equipment-line title="维修开始时间" :content="infoData.repairStartTime" />
- <equipment-line title="维修结束时间" :content="infoData.repairEndTime" />
- <equipment-line title="维修耗时" :content="infoData.repairMinutes + ''" />
- <equipment-line title="维修人员" :content="infoData.repairUserName" />
- <equipment-line v-if="infoData.secondRepairUser" title="维修人员2"
- :content="getUserName(infoData.secondRepairUser)" />
- <equipment-line v-if="infoData.threeRepairUser" title="维修人员3"
- :content="getUserName(infoData.threeRepairUser)" />
- <equipment-line v-if="infoData.fourRepairUser" title="维修人员4"
- :content="getUserName(infoData.fourRepairUser)" />
- <!--<equipment-line title="维修次数" :content="infoData.repairTimes + ''" />-->
- <equipment-line title="维修描述" :content="descripitionMap[infoData.repairContent]" />
- <equipment-line title="备注" :content="infoData.repairRemark" />
- <view class="d-flex py3 border-bottom">
- <view class="f-size-26 text-color-9 w200">图片</view>
- <view class="f-size-26 text-color-3 d-flex">
- <block v-for="(item, index) in repairImagesList" :key="index">
- <u-image width="100" class="mr-2" :src="item" @click="handlePreRepair(index)"
- mode="widthFix"><u-loading slot="loading"></u-loading></u-image>
- </block>
- </view>
- </view>
- </template>
- </view>
- </view>
- <view v-if="current == 2">
- <view v-for="(item, index) in dispatchList" :key="index" class="mx3 my2 p3 bg-color-white"
- style="border-radius: 16rpx">
- <view>
- <equipment-line title="转派人" :content="item.username" />
- <equipment-line title="转派时间" :content="item.time" />
- <equipment-line title="转派备注" :content="item.repairDispatchRemark" />
- </view>
- </view>
- </view>
- <view v-if="current == 3">
- <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
- <template v-if="infoData">
- <equipment-line title="验收开始时间" :content="infoData.checkStartTime" />
- <equipment-line title="验收结束时间" :content="infoData.checkEndTime" />
- <equipment-line title="维修人员" :content="infoData.checkUserName" />
- <equipment-line title="验收描述" :content="infoData.checkContent" />
- </template>
- </view>
- </view>
- <view v-if="current == 4">
- <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
- <u-time-line>
- <u-time-line-item>
- <template v-slot:content>
- <view>
- <view class="u-order-desc">报修时间</view>
- <view class="u-order-time">{{ infoData.applyTime }}</view>
- </view>
- </template>
- </u-time-line-item>
- <u-time-line-item>
- <template v-slot:content>
- <view>
- <view class="u-order-desc">派工时间</view>
- <view class="u-order-time">{{ infoData.applyTime }}</view>
- </view>
- </template>
- </u-time-line-item>
- <u-time-line-item>
- <template v-slot:content>
- <view>
- <view class="u-order-desc">维修开始时间</view>
- <view class="u-order-time">{{ infoData.repairStartTime ? infoData.repairStartTime : '' }}
- </view>
- </view>
- </template>
- </u-time-line-item>
- <u-time-line-item>
- <template v-slot:content>
- <view>
- <view class="u-order-desc">维修结束时间</view>
- <view class="u-order-time">{{ infoData.repairEndTime ? infoData.repairEndTime : '' }}</view>
- </view>
- </template>
- </u-time-line-item>
- <u-time-line-item>
- <template v-slot:content>
- <view>
- <view class="u-order-desc">验收开始时间</view>
- <view class="u-order-time">{{ infoData.checkStartTime ? infoData.checkStartTime : '' }}
- </view>
- </view>
- </template>
- </u-time-line-item>
- <u-time-line-item>
- <template v-slot:content>
- <view>
- <view class="u-order-desc">验收结束时间</view>
- <view class="u-order-time">{{ infoData.checkEndTime ? infoData.checkEndTime : '' }}</view>
- </view>
- </template>
- </u-time-line-item>
- </u-time-line>
- </view>
- </view>
- <view v-if="current == 5">
- <view v-for="(item, index) in dataReason" :key="index" class="mx3 my2 p3 bg-color-white"
- style="border-radius: 16rpx" @tap="handleEditReport(item)">
- <view>
- <equipment-line title="分析时间" :content="item.analyzeTime" />
- <equipment-line title="故障部位" :content="item.sbPartName" />
- <equipment-line title="故障现象" :content="item.problemDesc" />
- <equipment-line title="检查处理过程" :content="item.checkProcess" />
- <equipment-line title="原因分析" :content="item.reasonAnalysis" />
- </view>
- </view>
- </view>
- <view class="p-fixed d-flex j-around a-center footer">
- <view class="main-color-bg text-color-white common" @tap="handleAdd" v-show="infoData.status ===
- 2 ||
- infoData.status ===
- 5">维修</view>
- <view class="main-color-bg text-color-white common" v-show="infoData.status === 1" @tap="handleDealEdit">接收</view>
- <view class="main-color-bg text-color-white common" v-show="!infoData.fourRepairUser && infoData.repairUserId" @tap="handleDetail">转派</view>
- <view class="main-color-bg text-color-white common" v-show="infoData.status === 3 ||
- infoData.status === 5" @tap="handleExamine">提交审核</view>
- <view class="main-color-bg text-color-white common"
- v-show="(dataReason === null) || (dataReason.length === 0)" @tap="handleEditReport()">填写维修报告</view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [
- {
- name: '报修'
- },
- {
- name: '维修'
- },
- {
- name: '派工'
- },
- {
- name: '验收'
- },
- {
- name: '时间轴'
- },
- {
- name: '维修报告'
- }
- ],
- current: 0,
- detailId: '',
- infoData: {},
- needStopMap: {},
- sourceMap: {},
- levelMap: {},
- statusMap: {},
- dispatchList: [],
- id: '',
- imagesList: [],
- repairImagesList: [],
- dataReason: [],
- zjList: []
- }
- },
- onShow() {
- if (this.infoData.id) {
- this.getDataReason()
- }
- },
- onLoad(options) {
- this.id = options.id
- this.initData()
- this.needStopMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.YES_NO)
- 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.descripitionMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.REPAIRE_ACTION)
- this.$Http
- .queryUserDept({
- deptCode: this.$DictCache.VALUE.SYS_DEPT_CODE.SYS_DEPT_CODE_XIAN_CHANG_WEI_XIU_ZU,
- userStatus: 1
- })
- .then((res) => {
- console.log(res.data);
- const temp = []
- res.data.forEach((item, index) => {
- temp.push({
- label: item.realName,
- value: item.userId
- })
- })
- this.zjList.push(...temp)
- });
- this.$Http
- .queryUserDept({
- deptCode: this.$DictCache.VALUE.SYS_DEPT_CODE.SYS_DEPT_CODE_CHANG_NEI_WEI_XIU_ZU,
- userStatus: 1
- })
- .then((res) => {
- console.log(res.data);
- const temp = []
- res.data.forEach((item, index) => {
- temp.push({
- label: item.realName,
- value: item.userId
- })
- })
- this.zjList.push(...temp)
- });
- },
- methods: {
- handlePre(index) {
- uni.previewImage({
- urls: this.imagesList,
- current: this.imagesList[index],
- success() { }
- })
- },
- handlePreRepair(index) {
- uni.previewImage({
- urls: this.repairImagesList,
- current: this.repairImagesList[index],
- success() { }
- })
- },
- handleDealEdit() {
- this.$Http
- .repairFormDeal({
- id: this.infoData.id
- })
- .then(res => {
- console.log(res)
- })
- },
- change(index) {
- this.current = index
- },
- handleDetail() {
- uni.navigateTo({
- url: '/pages/repair-detail/transfer?id=' + this.id
- })
- },
- // 提交审批验收
- handleExamine() {
- var that = this
- if (!this.dataReason || this.dataReason.length === 0) {
- uni.showToast({
- title: '请填写维修报告',
- icon: 'none'
- })
- return
- }
- uni.showModal({
- title: '提示',
- content: '确认提交审核?',
- success: function (res) {
- if (res.confirm) {
- that.$Http
- .examine({
- id: that.id
- })
- .then(res => {
- that.infoData.status = that.$DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT
- that.toastSuccess('已提交,请等待审核')
- })
- }
- }
- })
- },
- handleAdd() {
- uni.navigateTo({
- url: '/pages/service-add/service-add?id=' + this.id
- })
- },
- handleEditReport(item) {
- if (item) {
- uni.navigateTo({
- url: `/pages/repair-reason/repair-reason-form?id=${item.id}`
- })
- } else {
- uni.navigateTo({
- url: `/pages/repair-reason/repair-reason-form?sbId=${this.infoData.sbId}&repairId=${this.infoData.id}&no=${this.infoData.no}`
- })
- }
- },
- initData() {
- this.$Http
- .fetchRepairApplicationForm({
- id: this.id
- })
- .then(res => {
- console.log(res)
- this.infoData = res.data
- this.imagesList = res.data.applicationFileList.map(item => {
- return this.$BaseTool.UserUtil.getFileUrl(item.url)
- })
- this.repairImagesList = res.data.repairFileList.map(item => {
- return this.$BaseTool.UserUtil.getFileUrl(item.url)
- })
- this.dispatchList = JSON.parse(res.data.repairDispatchList)
- this.getDataReason()
- })
- },
- getUserName(userId) {
- var name = ''
- this.zjList.forEach(item => {
- if (item.value == userId) {
- name = item.label
- }
- })
- return name
- },
- getDataReason() {
- this.$Http.queryRepairReason({ repairId: this.infoData.id }).then(res => {
- this.dataReason = res.data
- })
- }
- }
- }
- </script>
- <style scoped lang="less">
- page {
- background-color: #f4f4f4;
- }
- .container {
- padding-bottom: 100rpx;
- .footer {
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #fff;
- z-index: 10000;
- }
- .title {
- border-bottom: 1rpx solid #f4f4f4;
- color: #0082ff;
- }
- .img {
- width: 100rpx;
- height: 100rpx;
- }
- .p-fixed {
- border-top: 1rpx solid #f4f4f4;
- height: 100rpx;
- .common {
- padding: 15rpx 100rpx;
- border-radius: 40rpx;
- background-color: #0082ff;
- color: #fff;
- &:last-child {
- background-color: #fff;
- color: #0082ff;
- border: 1rpx solid #0082ff;
- }
- }
- }
- }
- </style>
|