Nessuna descrizione

workOrderDetail.vue 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="wrapper">
  3. <view class="detailContent">
  4. <view class="contentTable">
  5. <text class="contentTitle">工单编号:</text>
  6. <text class="contentText">{{ detailContentData.F_WorkOrderId }}</text>
  7. </view>
  8. <view class="contentTable">
  9. <text class="contentTitle">标题:</text>
  10. <text class="contentText">{{ detailContentData.F_ComTitle }}</text>
  11. </view>
  12. <view class="contentTable">
  13. <text class="contentTitle">来电内容:</text>
  14. <text class="contentText">{{ detailContentData.F_ComContent }}</text>
  15. </view>
  16. <view class="contentTable">
  17. <text class="contentTitle">工单内容:</text>
  18. <text class="contentText">{{ detailContentData.F_Content == null ? detailContentData.F_ComContent : detailContentData.F_Content}}</text>
  19. </view>
  20. <view class="contentTable">
  21. <text class="contentTitle">来电人:</text>
  22. <text class="contentText">{{ detailContentData.F_CusName }}</text>
  23. </view>
  24. <view class="contentTable">
  25. <text class="contentTitle">来电号码:</text>
  26. <text class="contentText">{{ detailContentData.F_CusPhone }}</text>
  27. </view>
  28. <view class="contentTable">
  29. <text class="contentTitle">来源:</text>
  30. <text class="contentText">{{ detailContentData.SourceName }}</text>
  31. </view>
  32. </view>
  33. <yiLine>
  34. <view></view>
  35. </yiLine>
  36. <view class="operationButton">
  37. <view>
  38. <text class="operationButtonTitle">操作</text>
  39. <view class="buttons">
  40. <button class="mini-btn" type="default" size="mini" v-for="item in workOrderButton" @click="callBtnMethods(item.eventName)" :key="item.id">{{ item.text }}</button>
  41. <!-- <button class="mini-btn" type="default" size="mini" @click="editBtn">查看</button>
  42. <button class="mini-btn" type="default" size="mini" @click="editBtn">编辑</button> -->
  43. </view>
  44. </view>
  45. </view>
  46. <yiLine>
  47. <view></view>
  48. </yiLine>
  49. <view class="handleProcess">
  50. <view>
  51. <text class="handleProcessTitle">办理过程</text>
  52. <view class="handleProcessContent" v-for="item in handleProcessListData" :key=item.F_Id>
  53. <view class="handleProcessContentTime">
  54. <text>{{ item.F_CreateTime }}</text>
  55. </view>
  56. <view class="handleProcessContentText">
  57. <text>{{ item.F_Message }}</text>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import yiLine from "../../components/yi-line/yi-line.vue"
  66. const allButton = {
  67. 1: {
  68. id: 1,
  69. text: "查看",
  70. eventName: "viewBtn",
  71. }
  72. // 2: {
  73. // id: 2,
  74. // text: "编辑",
  75. // eventName: "editBtn",
  76. // }
  77. }
  78. export default {
  79. components: {
  80. yiLine,
  81. },
  82. data() {
  83. return {
  84. wid: "", // 工单id
  85. detailContentData: {}, // 详情内容
  86. handleProcessListData: [], // 办理过程
  87. workOrderButton: [], // 工单按钮权限
  88. }
  89. },
  90. onLoad(option) {
  91. this.wid = option.wid;
  92. // 获取详情
  93. this.getDetail("0");
  94. // 获取办理过程
  95. this.getDetail("9");
  96. },
  97. methods: {
  98. getDetail(type) {
  99. let params = {
  100. type: type,
  101. workorderid: this.wid,
  102. token: uni.getStorageSync("token"),
  103. }
  104. this.$http.get("/WorkOrder/GetWorkOrderNew", params).then((response) => {
  105. if (response.state.toLowerCase() === "success") {
  106. let data = response.data;
  107. if (type === "0") {
  108. this.detailContentData = data.data[0];
  109. let btnData = data.btndata;
  110. if (btnData.length > 0) {
  111. btnData.forEach((element, index) => {
  112. let btn = allButton[element.key];
  113. if (btn != undefined) {
  114. this.workOrderButton.push(btn);
  115. }
  116. });
  117. }
  118. } else if (type === "9") {
  119. this.handleProcessListData = data;
  120. }
  121. }
  122. }).catch((e) => {
  123. console.log(e);
  124. })
  125. },
  126. callBtnMethods(methodName) {
  127. this[methodName]();
  128. },
  129. viewBtn() {
  130. uni.navigateTo({
  131. url: "/pages/viewWorkOrder/viewWorkOrder?wid=" + this.wid,
  132. })
  133. },
  134. editBtn() {
  135. uni.navigateTo({
  136. url: "/pages/editWorkOrder/editWorkOrder?wid=" + this.wid,
  137. })
  138. },
  139. },
  140. }
  141. </script>
  142. <style lang="scss">
  143. .wrapper {
  144. padding: 10px 10px 0 10px;
  145. .detailContent {
  146. margin: 0 0 15px 0;
  147. .contentTable {
  148. margin: 0 0 5px 0;
  149. .contentTitle {
  150. font-weight: 700;
  151. font-size: 14px;
  152. }
  153. .contentText {
  154. color: #525252;
  155. font-size: 14px;
  156. }
  157. }
  158. }
  159. .operationButton {
  160. margin: 15px 0;
  161. .operationButtonTitle {
  162. font-weight: 700;
  163. }
  164. .buttons {
  165. margin: 10px 0 0 0;
  166. .mini-btn {
  167. margin-right: 3px;
  168. color: #fff;
  169. background: #1e90ff;
  170. }
  171. }
  172. }
  173. .handleProcess {
  174. margin: 15px 0;
  175. .handleProcessTitle {
  176. font-weight: 700;
  177. }
  178. .handleProcessContent {
  179. margin: 8px 0 0 0;
  180. .handleProcessContentTime text {
  181. font-size: 14px;
  182. color: #73d13d;
  183. }
  184. .handleProcessContentText text {
  185. font-size: 14px;
  186. color: #525252;
  187. }
  188. }
  189. }
  190. }
  191. </style>