人民医院前端

workOrderDetail.vue 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  1. <template>
  2. <page-meta :root-font-size="getFontSizeValue"></page-meta>
  3. <view class="wrapper">
  4. <view class="detailContent">
  5. <view class="contentTable" v-if="isconfirm==1">
  6. <view style="margin-left: 37px;font-size: 18px;color: #0055ff;font-weight: bold;">请对本次维修进行确认!</view>
  7. </view>
  8. <view class="contentTable" v-if="isconfirm==1">
  9. <view style="margin: 5px auto;font-size: 14px;">
  10. <text @click="confirmChange('1')" class="confirmbtns" style="margin-right: 25px;">确认完成</text>
  11. <text @click="confirmChange('0')" class="confirmbtns">需要返修</text>
  12. </view>
  13. </view>
  14. <view class="contentTable" style="margin-left: 37px;border-bottom: 1px solid #ccc;padding-bottom: 10px;">
  15. <uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
  16. <uni-forms-item v-show="result=='1'" label="服务态度" name="attitude">
  17. <htz-rate v-model="valiFormData.attitude" :type="2"></htz-rate>
  18. </uni-forms-item>
  19. <uni-forms-item v-show="result=='1'" label="维修质量" name="quality">
  20. <htz-rate v-model="valiFormData.quality" :type="2"></htz-rate>
  21. </uni-forms-item>
  22. <uni-forms-item v-show="result=='1'" label="完工时效" name="finishTime">
  23. <htz-rate v-model="valiFormData.finishTime" :type="2"></htz-rate>
  24. </uni-forms-item>
  25. <uni-forms-item v-show="result=='1'" label="评价内容" name="content">
  26. <uni-easyinput style="width: 200px;" type="textarea" v-model="valiFormData.content" placeholder="请输入评价内容(限100字)"
  27. maxlength="100" />
  28. </uni-forms-item>
  29. <uni-forms-item v-show="result=='0'" label="返修原因">
  30. <dictionaries-select :flag="flag" @post-select-dic="postSelectDic" style="width: 200px;"></dictionaries-select>
  31. </uni-forms-item>
  32. <uni-forms-item v-show="result=='0'" label="">
  33. <uni-easyinput style="width: 200px;margin-left: 80px;" type="textarea" maxlength="100" v-model="valiFormData.ReturnReason" placeholder="请输入其他返修原因"/>
  34. </uni-forms-item>
  35. <uni-forms-item v-show="result=='0' || result=='1'" label="" style="margin-left: 50%;width: 300%;">
  36. <button style="margin-right: 20px;" size="mini" @click="cancel">取消</button>
  37. <button type="primary" size="mini" @click="submit('valiForm')">确认</button>
  38. </uni-forms-item>
  39. </uni-forms>
  40. </view>
  41. <view class="contentTable">
  42. <text class="contentTitle">工单编号:</text>
  43. <text class="contentText">{{ detailContentData.F_WorkOrderCode }}</text>
  44. <!-- <text class="textState" v-show="detailContentData.StateName ">{{ detailContentData.StateName }}</text>
  45. <text class="textState fx" v-show="backState == 1">返修</text> -->
  46. </view>
  47. <view class="contentTable" v-show="detailContentData.StateName ">
  48. <text class="contentTitle">工单状态:</text>
  49. <text class="textState">{{ detailContentData.StateName }}</text>
  50. <text class="textState" v-show="detailContentData.F_EmergencyTypes=='紧急'" style="color: #ff0000;border: 1px solid #ff0000;text-align: center;">紧急</text>
  51. <text class="textState" v-show="detailContentData.F_ReplayCount>0" style="color:#ddb642;border:1px solid #ddb642;text-align: center;">延期 {{detailContentData.F_ReplayCount}}</text>
  52. <text class="textState" v-show="detailContentData.ishangup=='是'" style="color:#4fa0f4;border:1px solid #4fa0f4;text-align: center;">挂起</text>
  53. <text class="textState" v-if="detailContentData.F_IsBack == 1" style="color: #3478f6;border: 1px solid #3478f6;text-align: center;">退单</text>
  54. <text class="textState" v-show="detailContentData.GapTime && detailContentData.GapTime.indexOf('超时')>=0" style="color:#880000;border:1px solid #880000;text-align: center;">超期</text>
  55. <text class="textState" v-show="detailContentData.F_TransferCount && detailContentData.F_TransferCount>1" style="color:#55aa7f;border:1px solid #55aa7f;text-align: center;" >转 {{detailContentData.F_TransferCount-1}}</text>
  56. <text class="textState fx" v-show="backState == 1">返修</text>
  57. </view>
  58. <view class="contentTable">
  59. <text class="contentTitle">工单类型:</text>
  60. <text
  61. class="contentText">{{ $mHelper.findParents(orderTypeList,detailContentData.F_WorkOrderCategory)}}</text>
  62. </view>
  63. <view class="contentTable" v-if="typeName.indexOf('设备类')>=0">
  64. <text class="contentTitle">设备资产编码:</text>
  65. <text class="contentText">{{ detailContentData.F_DeviceEncode }}</text>
  66. </view>
  67. <view class="contentTable">
  68. <text class="contentTitle">上报科室:</text>
  69. <text
  70. class="contentText">{{ $mHelper.findParents(departList,detailContentData.F_ApplicationDept)}}</text>
  71. </view>
  72. <view class="contentTable">
  73. <text class="contentTitle">科室电话:</text>
  74. <text class="contentText">{{ detailContentData.F_DeptPhone }}
  75. <uni-icons v-show="detailContentData.F_DeptPhone&&clickbefore==0" class="frContentText" type="eye" size="30" @click="clickEye"></uni-icons>
  76. </text>
  77. </view>
  78. <view class="contentTable">
  79. <text class="contentTitle">科室位置:</text>
  80. <text class="contentText">{{ detailContentData.F_LocationNew }}</text>
  81. </view>
  82. <view class="contentTable">
  83. <text class="contentTitle">上报时间:</text>
  84. <text class="contentText">{{ detailContentData.F_CreateTime }}</text>
  85. </view>
  86. <view class="contentTable">
  87. <text class="contentTitle">报工位置:</text>
  88. <text class="contentText">{{ detailContentData.F_PlaceOfRepair }}</text>
  89. </view>
  90. <view class="contentTable">
  91. <text class="contentTitle">申请人:</text>
  92. <text class="contentText">{{ detailContentData.applicantname}}</text>
  93. </view>
  94. <view class="contentTable">
  95. <text class="contentTitle">申请人电话:</text>
  96. <text class="contentText" style="margin-top: -5px;">{{ detailContentData.F_Applicantsphone }}<uni-icons v-show="detailContentData.F_Applicantsphone&&clickbefore==0" class="frContentText" type="eye" size="30" @click="clickEye"></uni-icons> <uni-icons @click="callHandle(detailContentData.F_ApplicantsphoneShow)" class="frContentText" type="phone" size="30" v-if="detailContentData.F_Applicantsphone"></uni-icons></text>
  97. </view>
  98. <view class="contentTable">
  99. <text class="contentTitle">联系电话:</text>
  100. <text class="contentText" style="margin-top: -5px;">{{ detailContentData.F_Phone }}<uni-icons v-show="detailContentData.F_Phone&&clickbefore==0" class="frContentText" type="eye" size="30" @click="clickEye"></uni-icons> <uni-icons @click="callHandle(detailContentData.F_PhoneShow)" class="frContentText" type="phone" size="30" v-if="detailContentData.F_Phone"></uni-icons></text>
  101. </view>
  102. <view class="contentTable">
  103. <view class="contentTitle">报修内容:</view>
  104. <view class="contentText">{{ detailContentData.F_Content }}</view>
  105. </view>
  106. <view class="contentTable">
  107. <text class="contentTitle">维修科室:</text>
  108. <text
  109. class="contentText">{{ $mHelper.findParents(departList,detailContentData.F_MaintenanceDept) }}</text>
  110. </view>
  111. <view class="contentTable">
  112. <text class="contentTitle">维修人员:</text>
  113. <text class="contentText">{{ detailContentData.MaintenancerName}}</text>
  114. </view>
  115. <view class="contentTable">
  116. <text class="contentTitle">联系方式:</text>
  117. <text class="contentText" style="margin-top: -5px;">{{ detailContentData.MaintenancerPhone }}<uni-icons v-show="detailContentData.MaintenancerPhone&&clickbefore==0" class="frContentText" type="eye" size="30" @click="clickEye"></uni-icons> <uni-icons @click="callHandle(detailContentData.MaintenancerPhoneShow)" class="frContentText" type="phone" size="30" v-if="detailContentData.MaintenancerPhone"></uni-icons></text>
  118. </view>
  119. <view class="contentTable">
  120. <text class="contentTitle">超时时限:</text>
  121. <text class="contentText">{{ detailContentData.GapTime }}</text>
  122. </view>
  123. <view class="contentTable">
  124. <text class="contentTitle">紧急程度:</text>
  125. <text class="contentText">{{ detailContentData.F_EmergencyTypes }}</text>
  126. </view>
  127. <view class="contentTable">
  128. <text class="contentTitle">接单时间:</text>
  129. <text class="contentText">{{ detailContentData.F_AcceptTime }}</text>
  130. </view>
  131. <view class="contentTable">
  132. <text class="contentTitle">挂起时间:</text>
  133. <text class="contentText">{{ detailContentData.F_ExceptFinishTime }}</text>
  134. </view>
  135. <view class="contentTable">
  136. <text class="contentTitle">完成时间:</text>
  137. <text class="contentText">{{ detailContentData.F_Endtime }}</text>
  138. </view>
  139. <view class="contentTable">
  140. <text class="contentTitle">完成时长:</text>
  141. <text class="contentText">{{ detailContentData.SpendTime }}</text>
  142. </view>
  143. <view class="contentTable" v-show="backState == 1">
  144. <text class="contentTitle">返修内容:</text>
  145. <text class="contentText">{{ backCon }}</text>
  146. </view>
  147. <view class="contentTable">
  148. <text class="contentTitle">图<span class="place"></span>片:</text>
  149. <view class="contentText" style="margin-top: 10px;">
  150. <uni-file-picker readonly :value="getFileData(detailContentData.FileUrl)" :imageStyles="imageStyles" file-mediatype="image" />
  151. </view>
  152. </view>
  153. <view class="contentTable" v-show="detailContentData.TransferFileUrl">
  154. <text class="contentTitle">转组长附件:</text>
  155. <view class="contentText" style="margin-top: 10px;">
  156. <uni-file-picker readonly :value="getFileData(detailContentData.TransferFileUrl)" :imageStyles="imageStyles" file-mediatype="image" />
  157. </view>
  158. </view>
  159. </view>
  160. <yiLine>
  161. <view></view>
  162. </yiLine>
  163. <view class="operationButton" v-show="equipmentCon && equipmentCon.length != 0">
  164. <view>
  165. <text class="operationButtonTitle">耗材信息</text>
  166. <table class="equipmentInfo">
  167. <thead style="background-color: #fafafa;">
  168. <tr class="trCon">
  169. <td class="tdCon">耗材名称</td>
  170. <td class="tdCon">单价</td>
  171. <td class="tdCon">数量</td>
  172. <td class="tdCon">总价</td>
  173. </tr>
  174. </thead>
  175. <tbody>
  176. <tr class="trCon" v-for="item in equipmentCon">
  177. <td class="tdCon" v-if="!item.F_EquipNumber">{{item.F_EquipName}}</td>
  178. <td class="tdCon" v-if="item.F_EquipNumber">{{item.F_EquipName}}({{item.F_EquipNumber}})</td>
  179. <td class="tdCon">{{item.F_EquipPrice}}</td>
  180. <td class="tdCon">{{item.F_EquipAmount}}</td>
  181. <td class="tdCon">{{item.F_EquipAmount*item.F_EquipPrice}}</td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. </view>
  186. </view>
  187. <view class="operationButton" v-show="orderButtonData && orderButtonData.length != 0">
  188. <!-- <view class="operationButton"> -->
  189. <view>
  190. <text class="operationButtonTitle">操作</text>
  191. <buttonsComponents class="buttons" :order-button-data="orderButtonData" :wid="workorderid" :typeName="$mHelper.findParents(orderTypeList,detailContentData.F_WorkOrderCategory)"
  192. :orderType="detailContentData.F_WorkOrderCategory" :departid="departid" :applicationDept="applicationDept" :firstType="$mHelper.stateComm(3)"
  193. :maintenancer="detailContentData.MaintenancerName" />
  194. </view>
  195. </view>
  196. <yiLine>
  197. <view></view>
  198. </yiLine>
  199. <view style="background-color: #fff;padding: 17px 0px;">
  200. <view class="segmentedControlWrapper">
  201. <uni-segmented-control :current="segmenter.current" :values="segmenter.items"
  202. @clickItem="onClickSegmentedControl" styleType="text" activeColor="#007aff" />
  203. </view>
  204. <view class="handleProcess">
  205. <view v-show="current == 0">
  206. <view class="detailContent showType" v-for="item in handleProcessListData" :key=item.F_Id>
  207. <view class="contentTable">
  208. <text class="contentTitle">处理部门:</text>
  209. <text class="contentText">{{ $mHelper.findParents(departList,item.F_MaintenanceDept) }}</text>
  210. </view>
  211. <view class="contentTable">
  212. <text class="contentTitle">处理人员:</text>
  213. <text
  214. class="contentText">{{ item.username }}</text>
  215. </view>
  216. <view class="contentTable">
  217. <text class="contentTitle">维修时间:</text>
  218. <text class="contentText">{{ item.F_ProcessingTime }}</text>
  219. </view>
  220. <view class="contentTable">
  221. <text class="contentTitle">完成状态:</text>
  222. <text class="contentText">{{ item.dealtype }}</text>
  223. </view>
  224. <view class="contentTable">
  225. <text class="contentTitle">处理结果:</text>
  226. <text class="contentText" v-html="item.F_Result"></text>
  227. </view>
  228. <view class="contentTable">
  229. <text class="contentTitle">处理方式:</text>
  230. <text class="contentText">{{ item.F_FinishType }}</text>
  231. </view>
  232. <view class="contentTable">
  233. <text class="contentTitle">异常原因:</text>
  234. <text class="contentText">{{ item.F_ExceptionTypeName }}</text>
  235. </view>
  236. <view class="contentTable" v-if="item.FileUrl && item.FileUrl.length > 0">
  237. <text class="contentTitle">维修前附件:</text>
  238. <uni-file-picker readonly :value="getFileData(item.FileUrl)" :imageStyles="imageStyles"
  239. file-mediatype="image" />
  240. </view>
  241. <view class="contentTable" v-if="detailContentData.PictureUrl && detailContentData.PictureUrl.length > 0">
  242. <text class="contentTitle">维修后附件:</text>
  243. <uni-file-picker readonly :value="getFileData(detailContentData.PictureUrl)" :imageStyles="imageStyles"
  244. file-mediatype="image" />
  245. </view>
  246. </view>
  247. <view class="contentTable noCon" v-show="!handleProcessListData || handleProcessListData.length == 0">
  248. 暂时无相关记录
  249. </view>
  250. </view>
  251. <view v-show="current == 1">
  252. <view class="detailContent showType" v-for="item in cooperationDate" :key=item.F_Id >
  253. <view class="contentTable">
  254. <text class="contentTitle">工单编号:</text>
  255. <text class="contentText">{{ item.F_WorkOrderCode }}</text>
  256. </view>
  257. <view class="contentTable">
  258. <text class="contentTitle">协作方式:</text>
  259. <text class="contentText">{{ item.Mode }}</text>
  260. </view>
  261. <view class="contentTable">
  262. <text class="contentTitle">接单部门:</text>
  263. <text class="contentText">{{ $mHelper.findParents(departList,item.F_MaintenanceDept)}}</text>
  264. </view>
  265. <view class="contentTable">
  266. <text class="contentTitle">状<span class="place"></span>态:</text>
  267. <text class="contentText">{{ item.StateName }}</text>
  268. </view>
  269. <view class="contentTable">
  270. <text class="contentTitle">内<span class="place"></span>容:</text>
  271. <text class="contentText">{{ item.F_Content }}</text>
  272. </view>
  273. <view class="contentTable">
  274. <text class="contentTitle">创建时间:</text>
  275. <text class="contentText">{{ item.F_CreateTime }}</text>
  276. </view>
  277. </view>
  278. <view class="contentTable noCon" v-show="!cooperationDate || cooperationDate.length == 0">
  279. 暂时无相关记录
  280. </view>
  281. </view>
  282. <view v-show="current == 2">
  283. <uni-steps :options="orderProcessDate" :steteName='"gdlc"' v-show="orderProcessDate && orderProcessDate.length > 0" />
  284. <view class="contentTable noCon" v-show="!orderProcessDate || orderProcessDate.length == 0">
  285. 暂时无相关记录
  286. </view>
  287. </view>
  288. <view v-show="current == 3">
  289. <uni-steps :options="maintenanceRecords" :steteName='"wxjl"' v-show="maintenanceRecords && maintenanceRecords.length > 0" />
  290. <view class="contentTable noCon" v-show="!maintenanceRecords || maintenanceRecords.length == 0">
  291. 暂时无相关记录
  292. </view>
  293. </view>
  294. <view v-show="current == 4">
  295. <view class="detailContent showType" v-for="item in evaluateDate" :key=item.F_Id>
  296. <view class="contentTable">
  297. <text class="contentTitle">服务态度:</text>
  298. <htz-rate v-model="item.F_Attitude" :readonly='true' :size="30" :type="2"></htz-rate>
  299. <text class="contentTitle">{{ item.F_Attitude | getEvaluateFilters }}</text>
  300. </view>
  301. <view class="contentTable">
  302. <text class="contentTitle">维修质量:</text>
  303. <htz-rate v-model="item.F_Quality" :size="30" :type="2"></htz-rate>
  304. <text class="contentTitle">{{ item.F_Quality | getEvaluateFilters }}</text>
  305. </view>
  306. <view class="contentTable">
  307. <text class="contentTitle">完工时效:</text>
  308. <htz-rate v-model="item.F_Efficiency" :size="30" :type="2"></htz-rate>
  309. <text class="contentTitle">{{ item.F_Efficiency | getEvaluateFilters }}</text>
  310. </view>
  311. <view class="contentTable">
  312. <text class="contentTitle">文字评价:</text>
  313. <text class="contentText">{{ item.F_EvaluateContent }}</text>
  314. </view>
  315. </view>
  316. <view class="contentTable noCon" v-show="!evaluateDate || evaluateDate.length == 0 ||isdealman==detailContentData.F_Maintenancer">
  317. 暂时无相关记录
  318. </view>
  319. </view>
  320. </view>
  321. </view>
  322. </view>
  323. </template>
  324. <script>
  325. import yiLine from "@/components/yi-line/yi-line.vue"
  326. import buttonsComponents from "pages/myTask/workOrderDetail/button/button"
  327. import pageData from "@/pages/myTask/repairList/addRepair/pageData.js"
  328. import uniSteps from "@/pages/components/steps/index.vue"
  329. import htzRate from '@/pages/components/htz-rate/htz-rate.vue'
  330. import dictionariesSelect from '@/pages/components/dictionariesSelect/dictionariesSelect.vue' //upload
  331. import { encrypt,decrypt } from "@/utils/secretKey"
  332. const segmenterData = {
  333. 0: ["处理结果", "协作工单","工单流程", "维修记录", "评价"],
  334. 1: ["处理结果", "工单流程", "维修记录", "评价"]
  335. }
  336. export default {
  337. components: {
  338. yiLine,
  339. buttonsComponents,
  340. uniSteps,
  341. htzRate,
  342. dictionariesSelect
  343. },
  344. filters: {
  345. getEvaluateFilters(state) {
  346. const data = {
  347. 1: '差',
  348. 2: '差',
  349. 3: '良',
  350. 4: '优',
  351. 5: '优',
  352. }
  353. return data[state]
  354. }
  355. },
  356. data() {
  357. return {
  358. clickbefore:0,
  359. isdealman:uni.getStorageSync('userCode'),//处理人
  360. getFontSizeValue:'1rem',
  361. active: 1,
  362. current: 0,
  363. typeName: '',
  364. listtype:"",
  365. workorderid: "", // 工单id
  366. sms_id: '', // 消息id
  367. tap: '', //工单切换
  368. roleCode: "", //角色
  369. departList: [], //部门数据
  370. userCodeList: [], //用户信息
  371. detailContentData: {}, // 详情内容
  372. orderButtonData: [],
  373. departid: '',
  374. applicationDept: '',
  375. handleProcessListData: [], // 办理过程
  376. cooperationDate: [], // 协作工单
  377. orderProcessDate: [], // 工单流程
  378. maintenanceRecords: [], // 维修记录
  379. evaluateDate: [], // 评价工单
  380. workOrderButton: [], // 工单按钮权限
  381. equipmentCon:[], // 耗材数量
  382. backState: 0, // 返修的状态,是返修1,不是为0
  383. backCon: '', // 返修的内容
  384. orderTypeList: [],
  385. segmenter: {
  386. current: 0,
  387. items: ["0", "1", "2", "3", "4"],
  388. type: "",
  389. },
  390. imageStyles: {
  391. width: 64,
  392. height: 64,
  393. border: {
  394. radius: '20%'
  395. }
  396. },
  397. isDisplay: {
  398. displaySegmentedControl: false, // 分段器
  399. },
  400. result:'',
  401. isconfirm:0,
  402. flag:'FXYY',
  403. // 校验规则
  404. rules: {
  405. },
  406. valiFormData:{
  407. attitude: 0, // 服务态度
  408. quality: 0, //维修质量
  409. finishTime: 0, // 完工时效
  410. content: '', // 评价内容
  411. key:'',
  412. value:'',
  413. ReturnReason:''
  414. }
  415. }
  416. },
  417. onShow(){
  418. const pages = getCurrentPages();
  419. const currentPage = pages[pages.length - 1];
  420. const routeParams = currentPage.options;
  421. // let fullPath = `${currentPage.route}`;
  422. // console.log(fullPath)
  423. // if(fullPath === '/pages/myTask/workOrderDetail/workOrderDetail'){
  424. // if (Object.keys(routeParams).length > 0) {
  425. // fullPath += '?';
  426. // for (const key in routeParams) {
  427. // fullPath += `${key}=${routeParams[key]}&`;
  428. // }
  429. // fullPath = fullPath.slice(0, -1); // 去除最后一个多余的 '&'
  430. // }
  431. // uni.reLaunch({
  432. // url:fullPath
  433. // });
  434. // }
  435. // console.log(fullPath);
  436. console.log(routeParams)
  437. this.init(routeParams)
  438. },
  439. onLoad(optioin) {
  440. console.log(optioin,'1111111111111')
  441. // 页面
  442. uni.$on("updateDetail", (res) => {
  443. console.log('updateDetail')
  444. this.init(optioin)
  445. })
  446. // this.init(optioin)
  447. },
  448. methods: {
  449. async init(optioin){
  450. await this.getGongDanType()
  451. this.getFontSizeValue = uni.getStorageSync('fontSizeValue')+'rem'
  452. this.workorderid = optioin.wid
  453. this.sms_id = optioin.sms_id
  454. this.listtype = optioin.listtype
  455. this.getDetail(0)
  456. this.getDetail(3)
  457. this.getDetail(1)
  458. this.getDetail(4)
  459. if(this.sms_id) {
  460. this.getButtons()
  461. }else if(optioin.buttons) {
  462. console.log(JSON.parse(optioin.buttons))
  463. this.orderButtonData = []
  464. JSON.parse(optioin.buttons).forEach(v => {
  465. let btn = this.$mButtonConfig[v.key];
  466. if (btn != undefined) {
  467. this.orderButtonData.push(btn);
  468. }
  469. //判断有没有返回按钮有的话显示维修确认页面
  470. if(v.key == "repairconfirmnew"){
  471. this.isconfirm = 1
  472. }
  473. })
  474. }
  475. // pageData.getDet((res, data) => {
  476. // this.departList = data
  477. // })
  478. this.departList = JSON.parse(uni.getStorageSync('deptTreeData'))
  479. // pageData.getApplicant('', (res) => {
  480. // this.userCodeList = res
  481. // })
  482. if(this.sms_id) {
  483. this.isDisplay.displaySegmentedControl = true
  484. this.segmenter.type = 0
  485. this.segmenter.items = ["处理结果", "协作工单","工单流程", "维修记录", "评价"]
  486. this.getDetail(2)
  487. } else {
  488. this.isDisplay.displaySegmentedControl = true
  489. this.segmenter.type = optioin.segmenter
  490. this.segmenter.items = segmenterData[optioin.segmenter]
  491. this.getDetail(2)
  492. }
  493. this.roleCode = uni.getStorageSync("roleCode")
  494. },
  495. clickEye(){
  496. this.detailContentData.F_DeptPhone = decrypt(this.detailContentData.F_DeptPhoneShow)
  497. this.detailContentData.F_Applicantsphone = decrypt(this.detailContentData.F_ApplicantsphoneShow)
  498. this.detailContentData.MaintenancerPhone = decrypt(this.detailContentData.MaintenancerPhoneShow)
  499. this.detailContentData.F_Phone = decrypt(this.detailContentData.F_PhoneShow)
  500. this.clickbefore = 1
  501. // const params = {
  502. // workordercode:this.detailContentData.F_WorkOrderCode,
  503. // type:3000
  504. // }
  505. // this.$http.get("WorkCommon/GetApplicantPhone",params).then((res)=>{
  506. // this.detailContentData.F_Applicantsphone = res
  507. // this.clickbefore = 1
  508. // })
  509. },
  510. confirmChange(num){
  511. this.result = num
  512. },
  513. postSelectDic(e) {
  514. this.valiFormData.key = Number(e.split(',')[0])
  515. this.valiFormData.value = e.split(',')[1]
  516. },
  517. cancel(){
  518. this.result = ''
  519. },
  520. submit(ref, state) {
  521. this.disabledButton = true
  522. if(this.result==1){
  523. this.valiFormData.key = ""
  524. this.valiFormData.value = ""
  525. this.valiFormData.ReturnReason = ""
  526. if(this.valiFormData.attitude == 0 || this.valiFormData.quality == 0 || this.valiFormData.finishTime == 0){
  527. this.$mHelper.toast('请选择星级评价')
  528. this.disabledButton = false
  529. return
  530. }
  531. if (this.valiFormData.attitude <= 3 || this.valiFormData.quality <= 3 || this.valiFormData.finishTime <= 3) {
  532. if (!this.valiFormData.content) {
  533. this.$mHelper.toast('请输入评价内容')
  534. this.disabledButton = false
  535. return
  536. }
  537. }
  538. }else{
  539. this.valiFormData.attitude = 0
  540. this.valiFormData.quality = 0
  541. this.valiFormData.finishTime = 0
  542. this.valiFormData.content = ""
  543. if(!this.valiFormData.value){
  544. this.$mHelper.toast('请选择原因')
  545. this.disabledButton = false
  546. return
  547. }
  548. if(this.valiFormData.value == '其他'){
  549. if(!this.valiFormData.ReturnReason){
  550. this.$mHelper.toast('请输入其他原因')
  551. this.disabledButton = false
  552. return
  553. }
  554. }
  555. }
  556. this.$refs[ref].validate().then(res => {
  557. const params = {
  558. workordercode: this.workorderid,
  559. confirmtype: this.result,
  560. Attitude: this.valiFormData.attitude,
  561. Quality: this.valiFormData.quality,
  562. Efficiency: this.valiFormData.finishTime,
  563. EvaluateContent: this.valiFormData.content,
  564. key: this.valiFormData.key,
  565. value: this.valiFormData.value,
  566. ReturnReason: this.valiFormData.ReturnReason
  567. }
  568. this.$mHelper.httpPost("FaultRepair/ConfirmEquipsAfter", params, 1, res => this.disabledButton =
  569. res)
  570. }).catch(err => {
  571. this.disabledButton = false
  572. console.log('err', err);
  573. })
  574. },
  575. async getGongDanType(){
  576. let dataOrderType = []
  577. const params = {
  578. pid:0,
  579. flag:1
  580. }
  581. const res = await this.$http.get("GongDanType/GetALLData",params)
  582. if (res.state.toLowerCase() ==="success") this.orderTypeList = res.data
  583. },
  584. callHandle(phone){
  585. if(!phone) {
  586. this.$mHelper.toast('无号码信息')
  587. return
  588. }
  589. uni.makePhoneCall({
  590. phoneNumber:decrypt(phone) //仅为示例
  591. })
  592. },
  593. getButtons() {
  594. this.orderButtonData = []
  595. const params = {
  596. SMS_Id: this.sms_id
  597. }
  598. this.$http.get("InternalMessages/GetButtons",params).then((res)=>{
  599. if(res.state.toLowerCase() ==="success"){
  600. console.log(res.rows[0].Buttons,'res.rows[0].Buttonsres.rows[0].Buttons')
  601. res.rows[0].Buttons.forEach(v => {
  602. let btn = this.$mButtonConfig[v.key];
  603. if (btn != undefined) {
  604. this.orderButtonData.push(btn);
  605. }
  606. //判断有没有返回按钮有的话显示维修确认页面
  607. if(v.key == "repairconfirmnew"){
  608. this.isconfirm = 1
  609. }
  610. })
  611. }
  612. })
  613. },
  614. getFileData(fileData) {
  615. let newFile = []
  616. if (fileData && fileData.length > 0) {
  617. fileData.forEach((element, index) => {
  618. const obj = {}
  619. obj.url = element.F_FileUrl
  620. obj.extname = element.F_FileType.split('.')[1]
  621. obj.name = element.F_FileName
  622. newFile.push(obj);
  623. });
  624. }
  625. return newFile
  626. },
  627. getDetail(type) {
  628. uni.showLoading({
  629. title: '加载中'
  630. });
  631. const params = {
  632. WorkOrderCode: this.workorderid,
  633. type: type,
  634. listtype: this.listtype
  635. }
  636. this.$http.get("FaultRepair/GetWorkOrder", params).then((response) => {
  637. if (response.state.toLowerCase() === "success") {
  638. uni.hideLoading();
  639. if (type == 0) {
  640. this.detailContentData = response.data[0]
  641. this.applicationDept = this.detailContentData.F_ApplicationDept.trim()
  642. this.departid = this.detailContentData.F_MaintenanceDept.trim()
  643. this.typeName = this.$mHelper.findParents(this.orderTypeList,this.detailContentData.F_WorkOrderCategory)
  644. } else if (type == 1) {
  645. this.handleProcessListData = response.data
  646. } else if (type == 2) {
  647. if(response.data.data.length == 0) {
  648. this.segmenter.items = segmenterData[1]
  649. this.segmenter.type = '1'
  650. }
  651. this.cooperationDate = response.data.data
  652. } else if (type == 3) {
  653. this.orderProcessDate = response.data
  654. } else if (type == 4) {
  655. this.maintenanceRecords = response.data
  656. if(response.data.length> 0 && response.data[0].Equips) {
  657. this.equipmentCon = response.data[0].Equips
  658. console.log(this.equipmentCon.length)
  659. }
  660. } else if (type == 5) {
  661. this.evaluateDate = response.data
  662. } else if (type == 6) {
  663. if (response.message == '不是返修') {
  664. this.backState = 0
  665. } else if (response.message == '是返修') {
  666. this.backState = 1
  667. this.backCon = response.data
  668. }
  669. }
  670. }
  671. }).catch((e) => {
  672. console.log(e);
  673. })
  674. },
  675. onClickSegmentedControl(e) {
  676. this.current = e.currentIndex
  677. if(this.segmenter.type == '0') {
  678. switch (String(e.currentIndex)) {
  679. case "0":
  680. this.tap = 1
  681. break
  682. case "1":
  683. this.tap = 2
  684. break
  685. case "2":
  686. this.tap = 3
  687. break
  688. case "3":
  689. this.tap = 4
  690. break
  691. case "4":
  692. this.tap = 5
  693. break
  694. }
  695. }else{
  696. switch (String(e.currentIndex)) {
  697. case "0":
  698. this.tap = 1
  699. this.current = e.currentIndex
  700. break
  701. case "1":
  702. this.tap = 3
  703. this.current = e.currentIndex + 1
  704. break
  705. case "2":
  706. this.tap = 4
  707. this.current = e.currentIndex + 1
  708. break
  709. case "3":
  710. this.tap = 5
  711. this.current = e.currentIndex + 1
  712. break
  713. }
  714. }
  715. this.getDetail(this.tap)
  716. },
  717. },
  718. }
  719. </script>
  720. <style lang="scss">
  721. .confirmbtns{
  722. border:1px solid #0055ff;padding: 3px 7px;border-radius: 5px;
  723. }
  724. .noCon{
  725. height: 200px;
  726. text-align: center;
  727. // font-size: 14px;
  728. color: #525252;
  729. }
  730. /deep/.segmented-control__text{
  731. font-size: 1rem !important;
  732. }
  733. /deep/ .set2-test{
  734. font-size: 1rem !important;
  735. }
  736. /deep/.set-2 .set-view .setTitle{
  737. font-size: 1rem !important;
  738. }
  739. /deep/.set-2 .set-view .setCon{
  740. font-size: 1rem !important;
  741. }
  742. .wrapper {
  743. // background-color: #fff;
  744. // height: 100vh;
  745. // padding: 10px 20px 0 20px;
  746. .showType{
  747. background-color: #fff;
  748. padding: 10px 13px;
  749. border-radius: 10px;
  750. box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.13);
  751. margin-bottom: 25px;
  752. }
  753. .detailContent {
  754. // margin: 0 0 15px 0;
  755. padding: 17px;
  756. background-color: #fff;
  757. .contentTable {
  758. margin: 0 0 10px 0;
  759. display: flex;
  760. .contentTitle {
  761. // font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑';
  762. font-weight: 700;
  763. // text-align-last: justify;
  764. font-style: normal;
  765. // font-size: 14px;
  766. color: #555555;
  767. width: 34%;
  768. display: inline-block;
  769. text-align: right;
  770. }
  771. .place{
  772. display: inline-block;
  773. width: 32px;
  774. }
  775. .frContentText{
  776. font-size: 25px !important;
  777. color: #1e90ff !important;
  778. margin-left: 15px !important;
  779. }
  780. .contentText {
  781. width: 66%;
  782. color: #525252;
  783. // font-size: 14px;
  784. margin-left: 10px;
  785. }
  786. .textState {
  787. // position: absolute;
  788. // right: 15px;
  789. // font-size: 12px;
  790. border: 1px solid #52C41A;
  791. padding: 2px 5px;
  792. color: #52C41A;
  793. background-color: rgba(195, 239, 161, 0.2);
  794. border-radius: 5px;
  795. margin-left: 10px;
  796. }
  797. .fx {
  798. // right: 70px;
  799. border: 1px solid #2d6116;
  800. color: #2d6116;
  801. background-color: rgba(255, 110, 84, 0.2);
  802. margin-left: 20px;
  803. }
  804. }
  805. }
  806. .operationButton {
  807. margin: 5px 0;
  808. padding: 17px;
  809. background-color: #fff;
  810. .operationButtonTitle {
  811. font-weight: 700;
  812. }
  813. .buttons {
  814. margin: 15px 0 0 0;
  815. }
  816. }
  817. .equipmentInfo{
  818. width: 100%;
  819. margin-top: 15px;
  820. border: 1px solid rgb(229, 229, 229);
  821. box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.05);
  822. margin-bottom: 20px;
  823. border-radius: 5px;
  824. .trCon {
  825. width: 100%;
  826. // font-size: 14px;
  827. .tdCon {
  828. display: inline-block;
  829. padding: 10px 0px;
  830. color: rgb(102, 102, 102);
  831. width: 20%;
  832. padding-right: 5px;
  833. text-align: center;
  834. }
  835. }
  836. }
  837. .handleProcess {
  838. margin: 15px 0;
  839. .handleProcessTitle {
  840. font-weight: 700;
  841. }
  842. .handleProcessContent {
  843. margin: 8px 0 0 0;
  844. .handleProcessContentTime text {
  845. // font-size: 14px;
  846. color: #73d13d;
  847. }
  848. .handleProcessContentText text {
  849. // font-size: 14px;
  850. color: #525252;
  851. }
  852. }
  853. }
  854. }
  855. </style>