| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854 |
- <template>
- <view>
- <uni-nav-bar
- fixed="true"
- statusBar="true"
- left-icon="back"
- :title="isApproval ? '设备维修验收详情' : workOrderType.code==10?'计划维修工单详情':'维修工单详情'"
- @clickLeft="back"
- >
- </uni-nav-bar>
- <view class="tab-title">
- <view
- v-for="(item, index) in tabList"
- :key="index"
- class="tab-item"
- v-text="item.label"
- :class="index === pickTabIndex ? 'active' : ''"
- @click="changeChartsTab(index)"
- ></view>
- </view>
- <view class="main">
- <!-- 工单信息 -->
- <view class="kd-baseInfo" v-if="pickTabIndex == 0">
- <view class="kd-cell">
- <text class="kd-label">工单编号</text>
- {{ worksheetInfo.workOrderCode }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">执行部门</text>
- {{ worksheetInfo.executorDeptName }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">执行人</text>
- {{ worksheetInfo.executeUserName }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">计划单号</text>
- {{ planRepair.planCode }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">计划名称</text>
- {{ planRepair.planName }}
- </view>
- <view class="kd-cell" v-if="workOrderType.code != 10">
- <text class="kd-label">计划完成时间</text>
- {{ worksheetInfo.planFinishTime }}
- </view>
-
- <view class="kd-cell" v-if="workOrderType.code == 10">
- <text class="kd-label">计划开始时间</text>
- {{ planRepair.planStartTime }}
- </view>
-
- <view class="kd-cell" v-if="workOrderType.code == 10">
- <text class="kd-label">计划完成时间</text>
- {{ planRepair.planEndTime }}
- </view>
-
- <view class="kd-cell" >
- <text class="kd-label">开工时间:</text>
- {{ worksheetInfo.acceptTime }}
- </view>
-
- <view class="kd-cell" >
- <text class="kd-label">完工时间:</text>
- {{ worksheetInfo.finishTime }}
- </view>
-
- <view class="kd-cell" >
- <text class="kd-label">实际工时:</text>
- {{ timeInterval(worksheetInfo.acceptTime, worksheetInfo.finishTime) }}
- </view>
-
-
-
-
- <view
- class="zxpg-wrap"
- v-if="worksheetInfo.status && !isApproval && isMygd"
- >
-
- <template v-if="worksheetInfo.status.code === 8">
- <!-- <view class="zx-btn btns" @click="handleExecute"> 开始执行 </view> -->
- <view class="zx-btn btns" @click="handleNotice"> 开始执行 </view>
- </template>
- <template v-if="worksheetInfo.status.code === 1">
- <view class="zx-btn btns" @click="handlbg"> 报工 </view>
- <!-- <view class="zp-btn btns" @click="handlbpbj" v-if="!worksheetInfo.applyOrder">
- 申请备品备件
- </view>
- <view class="zp-btn btns" v-if="worksheetInfo.applyOrder" @click="handCkbpbj">
- 查看备品备件
- </view> -->
- </template>
- <template v-if="worksheetInfo.status.code === 5">
- <view class="zx-btn btns disabled"> 已报工 </view>
- </template>
- <div class="apply-box">
- <view
- class="zp-btn btns"
- @click="handlbpbj"
- v-if="
- worksheetInfo.status.code != 5 &&
- worksheetInfo.status.code != 3 &&
- worksheetInfo.status.code != 7
- "
- >
- 申请备品备件
- </view>
- <view
- class="zp-btn btns"
- @click="handlZp"
- v-if="worksheetInfo.status.code === 8"
- >
- 转派
- </view>
- </div>
- </view>
- <Assign ref="Assign" @success="handleAssign"></Assign>
- </view>
- <!-- 报修信息 -->
- <view class="bg" v-if="pickTabIndex == 1 ">
- <view class="kd-baseInfo" v-if=" workOrderType.code != 10 ">
- <view class="kd-cell">
- <text class="kd-label">报修记录编号</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.repairsCode
- }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">报修时间</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.createTime
- }}
- </view>
- <view class="kd-cell" >
- <text class="kd-label">来源编码</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.sourceCode
- }}
- </view>
-
- <view class="kd-cell">
- <text class="kd-label">固资编码</text>
- {{
- device.fixAssetCode
- }}
- </view>
-
-
-
-
- <view class="kd-cell" >
- <text class="kd-label">来源</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.source.desc
- }}
- </view>
- <view class="kd-cell" >
- <text class="kd-label">报修部门</text>
- {{
- worksheetInfo.repairInfo &&
- worksheetInfo.repairInfo.repairsDeptName
- }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">报修人</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.repairsPerson
- }}
- </view>
- <view class="kd-cell" >
- <text class="kd-label">报修人电话</text>
- {{
- worksheetInfo.repairInfo &&
- worksheetInfo.repairInfo.repairsDeptPhone
- }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">期望完成时间</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.expectedTime
- }}
- </view>
- <view class="kd-cell">
- <text class="kd-label2">委托单位交底负责人</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.repairsPerson
- }}
- </view>
-
- <view class="kd-cell">
- <text class="kd-label2">交底时间</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.repairInfo.tellTime
- }}
- </view>
-
- <view class="kd-cell">
- <text class="kd-label2">接受交底负责人</text>
- {{
- worksheetInfo.repairInfo && worksheetInfo.tellName
- }}
- </view>
-
-
- <view class="kd-cell" >
- <text class="kd-label">故障描述</text>
- {{
- worksheetInfo.repairInfo &&
- worksheetInfo.repairInfo.repairsDescription
- }}
- </view>
-
-
-
- <view class="img-wrap" v-if="workOrderType.code != 10 && worksheetInfo.repairInfo.repairsImg">
- <image
- class="img"
- @click="
- clickImg(worksheetInfo.repairInfo.repairsImg.split(','), item_s)
- "
- :src="apiUrl + item_s"
- v-for="(
- item_s, index_s
- ) in worksheetInfo.repairInfo.repairsImg.split(',')"
- :key="index_s"
- >
- </image>
- </view>
- </view>
-
- <view class="kd-baseInfo" v-if=" workOrderType.code == 10 ">
- <view class="kd-cell">
- <text class="kd-label">报修时间</text>
- {{
- planRepair.createTime
- }}
- </view>
-
- <view class="kd-cell">
- <text class="kd-label">维修部门</text>
- {{
- planRepair.executorDeptName
- }}
- </view>
-
- <view class="kd-cell">
- <text class="kd-label">维修人员</text>
- {{
- planRepair.executorName
- }}
- </view>
-
- </view>
-
- </view>
- <!-- 设备信息 -->
- <view class="kd-baseInfo" v-if="pickTabIndex == 2">
- <view class="kd-cell">
- <text class="kd-label">设备编号</text>
- {{ workOrderType.code == 10 ? device.equiCode : device.assetCode }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">设备名称</text>
- {{workOrderType.code == 10 ? device.equiName : device.assetName }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">设备分类</text>
- {{ workOrderType.code == 10 ? planRepair.equiTypeName : device.information && device.information.classificationUrl }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">固资编码</text>
- {{ device.fixedAssetsCode }}
- </view>
- <view class="kd-cell">
- <text class="kd-label">规格型号</text>
- {{ workOrderType.code == 10 ? device.equiModel : device.information && device.information.specification }}
- </view>
- <view class="kd-cell" v-if='workOrderType.code != 10'>
- <text class="kd-label">权属部门</text>
- {{ device.ownershipDeptName }}
- </view>
- <view class="kd-cell" v-if='workOrderType.code != 10'>
- <text class="kd-label">权属人</text>
- {{ device.ownershipUserName }}
- </view>
- <view class="kd-cell" v-if='workOrderType.code != 10'>
- <text class="kd-label">权属部门电话</text>
- {{ device.ownershipUserMobile }}
- </view>
- <view class="kd-cell" v-if='workOrderType.code != 10'>
- <text class="kd-label">设备位置</text>
- {{ device.factoryName }}—{{ device.workshopName }}—{{
- device.lineName
- }}
- </view>
-
- <view class="kd-cell" v-if='workOrderType.code == 10'>
- <text class="kd-label">设备位置</text>
- {{ device.equiLocation }}
-
- </view>
-
-
-
- </view>
- <!-- 维修历程 -->
- <view class="" v-if="pickTabIndex == 3">
- <!-- 步骤条 -->
- <maintain_course
- :repairInfoLogList="worksheetInfo.repairInfoLogList"
- :planEquiList="worksheetInfo.planEquiList"
- :workOrderCode="workOrderCode"
- ></maintain_course>
- </view>
- <!-- 维修记录 -->
- <view class="wx-main" v-if="pickTabIndex == 4">
- <view class="wx-wrap">
- <view
- class="item"
- v-for="(item, index) in worksheetInfo.workOrderRecordRespList"
- :key="index"
- >
- <view class="bh-wrap">
- <view class="s1">
- <view class="title-md"> 工单编号: </view>
- <view class="b1">
- {{ item.workOrderCode }}
- </view>
- </view>
- <view class="s2"> {{ item.createTime }} </view>
- </view>
- <fold :hide="false">
- <view class="title-wrap">
- <view class="s1 title-md"> 执行人 </view>
- <view class="s2">
- {{ item.executeUserName }}
- </view>
- </view>
- <view class="bg-wrap-item">
- <view class="label title-md"> 故障描述 </view>
- <view class="value-wrap">
- <view class="text">
- {{ item.repairsDescription }}
- </view>
- <view class="img-wrap" v-if="item.repairsImg">
- <image
- class="img"
- @click="clickImg(item.repairsImg.split(','), item_s)"
- :src="apiUrl + item_s"
- v-for="(item_s, index_s) in item.repairsImg.split(',')"
- :key="index_s"
- >
- </image>
- </view>
- </view>
- </view>
- <view class="bg-wrap-item">
- <view class="label title-md"> 处理说明 </view>
- <view class="value-wrap">
- <view class="text">
- {{ item.repairReportExplain }}
- </view>
- <view class="img-wrap" v-if="item.workOrderImg">
- <image
- class="img"
- @click="clickImg(item.workOrderImg.split(','), item_s)"
- :src="apiUrl + item_s"
- v-for="(item_s, index_s) in item.workOrderImg.split(',')"
- :key="index_s"
- >
- </image>
- </view>
- </view>
- </view>
- <view class="bjsymx" @click="handlbjsymx(item.workOrderCode)">
- 备件使用明细
- </view>
- </fold>
- </view>
- </view>
- </view>
- </view>
- <PopSparePart
- ref="PopSparePart"
- :workOrderCode="sparePartWorkOrderCode"
- ></PopSparePart>
- <Approval
- v-if="
- isApproval && worksheetInfo.status && worksheetInfo.status.code == 5
- "
- :devOpsType="1"
- :planType="3"
- :myHandleId="myHandleId"
- :id="worksheetInfo.workOrderId"
- />
-
- <Notice v-if="noticeShow" :id='worksheetInfo.id' :repairInfo='worksheetInfo.repairInfo' @agree="agree"></Notice>
- </view>
- </template>
- <script>
- import Step from '@/components/Step/Step.vue'
- import StepItem from '@/components/Step/StepItem.vue'
- import Assign from '@/components/Assign.vue'
- import fold from '../components/fold.vue'
- import PopSparePart from '../components/PopSparePart.vue'
- import Approval from '@/components/Approval.vue'
- import maintain_course from '../components/maintain_course.vue'
- import Notice from '../components/notice.vue'
- import { get, postJ, post } from '@/utils/api.js'
- export default {
- components: {
- Step,
- StepItem,
- Assign,
- fold,
- PopSparePart,
- Approval,
- maintain_course,
- Notice
- },
- computed: {
- // 是否为自己的工单
- isMygd () {
- let userInfo = uni.getStorageSync('userInfo')
- // 当前登录人id
- let userId = userInfo.id
- // 执行人id
- let executeUserId = this.worksheetInfo.executeUserId
- if (executeUserId == userId) {
- return true
- } else {
- return false
- }
- }
- },
- data () {
- return {
- type: 1,
- sparePartWorkOrderCode: '',
- tabList: [
- {
- label: '工单信息',
- value: '0'
- },
- {
- label: '报修信息',
- value: '1'
- },
- {
- label: '设备信息',
- value: '2'
- },
- {
- label: '维修历程',
- value: '3'
- },
- {
- label: '维修记录',
- value: '4'
- }
- ],
- pickTabIndex: 0,
- workOrderCode: '',
- worksheetInfo: {},
- dict: {
- // 报修来源 1:手动创建;2:工单反工;3:告警通知;4:保养工单;5:巡点检工单)
- source: {
- 1: '手动创建',
- 2: '工单反工',
- 3: '告警通知',
- 4: '保养工单',
- 5: '巡点检工单'
- }
- },
- // 设备信息
- device: {},
- isApproval: false,
- myHandleId: '',
- equiCode: '',
-
- noticeShow: false,
-
- workOrderType: { },
- planRepair: {}
-
-
- }
- },
- onLoad (options) {
- this.workOrderCode = options.workOrderCode
- this.isApproval = options.type === 'approval'
- this.myHandleId = options.myHandleId
- },
- onShow () {
- if (this.workOrderCode) {
- this.getInfo()
- }
- },
- methods: {
- handleAssign () {
- this.back()
- },
- getInfo () {
- get(
- this.apiUrl + '/repair/info/getWorkOrderDetail/' + this.workOrderCode
- ).then(res => {
- if (res.success) {
- res.data.repairInfoLogList = res.data.repairInfoLogList.reverse()
- res.data.repairInfoLogList = res.data.repairInfoLogList.map(n => {
- if (n.content) {
- n.content = JSON.parse(n.content)
- }
- return n
- })
- this.worksheetInfo = res.data
- this.workOrderType = res.data?.workOrderType
-
- this.equiCode = res.data?.repairInfo?.equiCode
-
-
- if(this.workOrderType.code == 10) {
- this.planRepair = res.data?.planRepair
- this.device = res.data.planRepairEqui
- let districtManName = res.data?.planRepair.districtManName.split(',')
- this.worksheetInfo.repairInfo = {
- repairsPerson: districtManName[0]
- }
-
- } else {
- this.getDevice()
- }
-
- }
- })
- },
- changeChartsTab (index) {
- this.pickTabIndex = index
- },
- // 跳转备品备件
- handlbpbj () {
- uni.navigateTo({
- url: `/pages/maintain_service/sparepart/sparepart?workOrderId=${this.worksheetInfo.workOrderId}&sourceId=${this.worksheetInfo.id}&sourceCode=${this.worksheetInfo.workOrderCode}`
- })
- },
- // 查看备品备件 详情
- handCkbpbj () {
- uni.navigateTo({
- url: `/pages/maintain_service/sparepart/sparepartDetail?applyOrder=${this.worksheetInfo.applyOrder}`
- })
- },
- // 跳转报工
- handlbg () {
- uni.navigateTo({
- url: `/pages/maintain_service/submitted_ministry/submitted_ministry?workOrderCode=${this.workOrderCode}&equiCode=${this.equiCode}`
- })
- },
-
- // 保修须知
- handleNotice() {
- this.noticeShow = true
- },
-
- agree() {
-
- this.noticeShow = false
- this.handleExecute()
- },
-
- // 执行工单
- handleExecute () {
- post(this.apiUrl + '/workOrder/repairExecute', {
- workOrderCode: this.worksheetInfo.workOrderCode
- }).then(res => {
- uni.showToast({
- icon: 'success',
- title: '操作成功!',
- duration: 2000
- })
- this.getInfo()
- })
- },
- // 转派
- handlZp () {
- let id = this.worksheetInfo.id
- this.$refs.Assign.open(id)
- },
- // 备件使用明细
- handlbjsymx (workOrderCode) {
- this.$refs.PopSparePart.open('备件使用明细', null, workOrderCode)
- },
- // 获取设备信息
- getDevice () {
- try {
- let par = {
- code: this.worksheetInfo.repairInfo.equiCode
- }
- get(this.apiUrl + '/asset/detail', par).then(res => {
- if (res.success) {
- this.device = res.data
- }
- })
- } catch (e) {
- //TODO handle the exception
- }
- },
- // 查看图片
- clickImg (urls, indexUrl) {
- urls = urls.map(n => {
- return this.apiUrl + n
- })
- wx.previewImage({
- urls: urls, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
- current: this.apiUrl + indexUrl, // 当前显示图片的http链接,默认是第一个
- success: function (res) {},
- fail: function (res) {},
- complete: function (res) {}
- })
- },
-
- // 计算实际工时
- timeInterval(dt1, dt2) {
- if (!dt1 || !dt2) {
- return "";
- }
- if (typeof dt1 == "string") {
- dt1 = new Date(dt1.replace(/-/, "/"));
- dt2 = new Date(dt2.replace(/-/, "/"));
- }
- var res = dt2 - dt1;
- if (isNaN(res)) throw Error("invalid dates arguments");
- let re = res / (1000 * 60 * 60);
-
- var h = parseInt(re);
- var m = parseInt((re - h) * 60);
- let result = "";
- if (h) {
- result += `${h} 小时`;
- }
- if (m) {
- result += `${m} 分钟`;
- }
- return result;
- }
-
- }
- }
- </script>
- <style lang="scss" scoped>
- .img-wrap {
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- .img {
- width: 80px;
- height: 60px;
- margin: 5px;
- }
- }
- .tab-title {
- position: fixed;
- width: 100%;
- display: flex;
- justify-content: space-between;
- height: 82rpx;
- line-height: 82rpx;
- background-color: #ffffff;
- border-bottom: 1px solid #f2f2f2;
- z-index: 99;
- box-sizing: border-box;
- .tab-item {
- width: 50%;
- text-align: center;
- font-size: 32rpx;
- color: $uni-text-color-grey;
- }
- .tab-item.active {
- color: $j-primary-border-green;
- border-bottom: 1px solid $j-primary-border-green;
- }
- }
- .fixed {
- position: fixed;
- width: 100%;
- left: 0;
- }
- .add {
- bottom: 0;
- }
- .main {
- border-top: 10px solid #f0f0f0;
- margin-top: 42px;
- }
- .img-bar {
- padding: 10px 0;
- display: flex;
- .label {
- color: #999;
- text-align: right;
- max-width: 104px;
- font-size: 32rpx;
- padding: 0 15px;
- flex: 1;
- }
- .img-wrap {
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- .img {
- width: 80px;
- height: 60px;
- margin: 5px;
- }
- }
- }
- .kd-baseInfo {
- padding: 0 32rpx;
- font-size: 28rpx;
- .kd-cell {
- line-height: 90rpx;
- border-bottom: 1px dashed #dadada;
- word-break: break-all;
- .kd-label {
- display: inline-block;
- width: 8em;
- font-weight: bold;
- }
- .kd-label2{
- display: inline-block;
- width: 11em;
- font-weight: bold;
- }
- }
- }
- .wx-wrap {
- .item {
- padding: 20rpx;
- font-size: 28rpx;
- .bh-wrap {
- display: flex;
- margin-bottom: 10rpx;
- justify-content: space-between;
- .s1 {
- display: flex;
- align-items: center;
- .b1 {
- font-size: 28rpx;
- }
- }
- .s2 {
- font-size: 28rpx;
- }
- }
- .title-wrap {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px dashed #dadada;
- padding-bottom: 10rpx;
- }
- .bg-wrap-item {
- margin-top: 20rpx;
- .value-wrap {
- .text {
- color: #7f7f7f;
- }
- .img-wrap {
- margin-top: 20rpx;
- display: flex;
- .img {
- width: 140rpx;
- height: 140rpx;
- & + .img {
- margin-left: 10rpx;
- }
- }
- }
- }
- }
- }
- }
- .title-md {
- font-weight: bold;
- }
- .zxpg-wrap {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-top: 100rpx;
- .btns {
- font-size: 32rpx;
- width: 420rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- }
- .zx-btn {
- background-color: rgba(21, 122, 44, 1);
- color: #ffffff;
- }
- .zp-btn {
- color: #169bd5;
- }
- .disabled {
- background-color: rgba(127, 127, 127, 1);
- }
- }
- .bjsymx {
- color: #4f7f00;
- padding: 20rpx 0;
- }
- .apply-box {
- width: 70%;
- margin: 10rpx auto;
- display: flex;
- align-items: center;
- justify-content: space-around;
- }
- </style>
|