fault-handle.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="home">
  3. <view class="device-info">
  4. <i class="iconfont icon-shebei"></i>设备故障信息
  5. </view>
  6. <view class="info-area">
  7. <u--form
  8. labelPosition="left"
  9. :model="model1"
  10. ref="form1"
  11. :labelWidth="100"
  12. labelAlign="center"
  13. >
  14. <u-form-item
  15. label="设备编码"
  16. prop="assetBarCode"
  17. borderBottom
  18. ref="item2"
  19. >
  20. {{model1.assetBarCode}}
  21. </u-form-item>
  22. <u-form-item
  23. label="上报时间"
  24. prop="reportDate"
  25. borderBottom
  26. ref="item1"
  27. >
  28. {{model1.reportDate}}
  29. </u-form-item>
  30. <u-form-item
  31. label="联系电话"
  32. prop="tel"
  33. borderBottom
  34. ref="item2"
  35. >
  36. {{model1.tel}}
  37. </u-form-item>
  38. <u-form-item
  39. label="处理状态"
  40. prop="processState"
  41. borderBottom
  42. ref="item2"
  43. >
  44. {{model1.processState==='0'?'未处理':'已处理'}}
  45. </u-form-item>
  46. </u--form>
  47. </view>
  48. <view class="type-head">
  49. <i class="iconfont icon-dingwei"></i>故障现象
  50. </view>
  51. <view class="type-area">
  52. <u--textarea
  53. border="none"
  54. v-model="model1.faultPhenomenon"
  55. autoHeight
  56. disabled
  57. maxlength="-1">
  58. </u--textarea>
  59. </view>
  60. <view class="type-head">
  61. <i class="iconfont icon-dingwei"></i>处理结果
  62. </view>
  63. <view class="type-area">
  64. <u--textarea
  65. border="none"
  66. v-model="model1.processResult"
  67. placeholder="请输入处理结果"
  68. :disabled="model1.processState==='0'?false:true"
  69. autoHeight
  70. maxlength="-1"></u--textarea>
  71. </view>
  72. <view v-if="model1.processState==='0'?true:false">
  73. <view class="type-head">
  74. <i class="iconfont icon-dingwei"></i>设备状态反馈
  75. </view>
  76. <view class="type-area">
  77. <u-radio-group
  78. v-model="radiovalue1"
  79. placement="row"
  80. >
  81. <u-radio
  82. :customStyle="{margin: '8px 8px 8px 0' }"
  83. v-for="(item, index) in radiolist1"
  84. :key="index"
  85. :label="item.name"
  86. :name="item.name"
  87. >
  88. </u-radio>
  89. </u-radio-group>
  90. </view>
  91. </view>
  92. <view class="btn-area" v-if="model1.processState==='0'?true:false">
  93. <u-button color="#000" size="small" @click="toSaveProcess">保存</u-button>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import { getFaultDetail,handleFaultReport } from '@/api/asset.js'
  99. export default {
  100. data() {
  101. return {
  102. id:null,
  103. model1:{
  104. assetBarCode: "00170000488047",
  105. createBy: null,
  106. createTime: null,
  107. faultPhenomenon: "aaaaaaa",
  108. id: "1640988534091284485",
  109. params:{},
  110. processResult: null,
  111. processState: "0",
  112. remark: null,
  113. reportDate: "2023-03-31 10:27:09",
  114. searchValue: null,
  115. tel: "15788998899",
  116. updateBy: null,
  117. updateTime: null,
  118. userId: "1"
  119. },
  120. radiolist1: [
  121. {
  122. name: '正常',
  123. disabled: false
  124. },
  125. {
  126. name: '报废',
  127. disabled: false
  128. }
  129. ],
  130. radiovalue1: '正常',
  131. };
  132. },
  133. methods:{
  134. init(id){
  135. getFaultDetail(id).then(res=>{
  136. this.model1 = res
  137. })
  138. },
  139. toSaveProcess(){
  140. // uni.showLoading({
  141. // title: "正在保存中",
  142. // mask: true,
  143. // });
  144. let fault = this.model1.processResult
  145. if(fault==""){
  146. uni.$u.toast("请填写故障处理结果")
  147. return;
  148. }
  149. let data = {
  150. tbFaultReportId:this.model1.id,
  151. processResult:this.model1.processResult,
  152. feedbackStatus:this.radiovalue1==="正常"?1:0
  153. }
  154. handleFaultReport(data).then(res=>{
  155. this.model1 = res
  156. })
  157. }
  158. },
  159. onLoad:function(option){
  160. this.id = option.id
  161. this.init(option.id)
  162. }
  163. }
  164. </script>
  165. <style lang="scss">
  166. page{
  167. background-color: #eae9e9;
  168. }
  169. .home{
  170. // padding: 20rpx 0;
  171. }
  172. .device-info,.type-head{
  173. display: flex;
  174. align-items: center;
  175. padding:20rpx;
  176. .iconfont{
  177. font-size: 40rpx;
  178. margin-right: 10rpx;
  179. }
  180. }
  181. .info-area,.type-area{
  182. background-color: #fff;
  183. }
  184. .type-area{
  185. padding: 0 20rpx;
  186. /deep/.u-textarea--disabled{
  187. background-color: #fff !important;
  188. }
  189. }
  190. .btn-area{
  191. padding: 20rpx 20rpx 20rpx 500rpx;
  192. }
  193. </style>