工单小程序2024-11-20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

236 lines
4.8 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <!-- 工单详情 -->
  3. <view class="page">
  4. <navbar
  5. title="详情"
  6. leftClick
  7. @leftClick="$utils.navigateBack"
  8. />
  9. <view class="collect"
  10. @click="addCollection">
  11. <uv-icon
  12. size="60rpx"
  13. v-if="collectonFlag"
  14. color="rgb(83, 125, 180)"
  15. name="star-fill"></uv-icon>
  16. <uv-icon
  17. size="60rpx"
  18. v-else
  19. name="star"></uv-icon>
  20. </view>
  21. <view class="Box">
  22. <view class="work-box">
  23. <view class="works">
  24. 任务号
  25. </view>
  26. <view class="index">
  27. {{TemplateById.taskNo}}
  28. </view>
  29. </view>
  30. <view class="work-box">
  31. <view class="works">
  32. 担当信息
  33. </view>
  34. <view class="index">
  35. {{TemplateById.responsibler}}
  36. </view>
  37. </view>
  38. <view class="work-box">
  39. <view class="works">
  40. 机型信息
  41. </view>
  42. <view class="inde">
  43. {{TemplateById.model}}
  44. </view>
  45. </view>
  46. <view class="work-box">
  47. <view class="works">
  48. 数量
  49. </view>
  50. <view class="index">
  51. {{TemplateById.number}}
  52. </view>
  53. </view>
  54. <view class="work-box">
  55. <view class="works">
  56. 状态
  57. </view>
  58. <view class="index">
  59. {{TemplateById.statusDescribe}}
  60. </view>
  61. </view>
  62. <view class="work-box">
  63. <view class="works">
  64. 备注
  65. </view>
  66. <view class="index">
  67. {{TemplateById.remark}}
  68. </view>
  69. </view>
  70. </view>
  71. <view class="working-procedure">
  72. <view class="working"
  73. v-for="(item, index) in TemplateById.workorderStepList"
  74. :key="index"
  75. @click="clickStep(item, index)" >
  76. {{ item.name }}
  77. </view>
  78. <!-- <view class="working"
  79. @click="$utils.navigateTo('/pages_order/order/ProcessCardTo?id=' + id)">
  80. 中试压缩机试作工序卡2
  81. </view>
  82. <view class="working"
  83. @click="$utils.navigateTo('/pages_order/order/ProcessCardThree?id=' + id)">
  84. 中试压缩机试作工序卡3
  85. </view>
  86. <view class="working"
  87. @click="$utils.navigateTo('/pages_order/order/ProcessCardFour?id=' + id)">
  88. 中试压缩机试作工序卡4(总成)
  89. </view> -->
  90. </view>
  91. <view class="modify">
  92. <view class="modi"
  93. v-if="isPermission('修改')"
  94. @click="$utils.navigateTo('/pages_order/order/ModifyWorkOrder?id=' + id)">
  95. 修改
  96. </view>
  97. <!-- <view class="modi"
  98. v-if="TemplateById.collectonFlag"
  99. @click="addCollection">
  100. 收藏
  101. </view>
  102. <view class="modi a"
  103. v-else
  104. @click="addCollection">
  105. 取消收藏
  106. </view> -->
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. import { mapState } from 'vuex'
  112. export default {
  113. data() {
  114. return {
  115. id : 0,
  116. TemplateById : {
  117. workorderStepList : [],
  118. collectonFlag : false,
  119. },
  120. }
  121. },
  122. onLoad(args) {
  123. this.id = args.id
  124. },
  125. onShow() {
  126. if(this.id){
  127. this.queryTemplateById()
  128. }
  129. },
  130. computed : {
  131. ...mapState(['workDetail']),
  132. },
  133. methods: {
  134. // 根据id获取工单详情
  135. queryTemplateById(){
  136. this.$api('queryTemplateById', {
  137. templateId : this.id
  138. }, res =>{
  139. if(res.code == 200){
  140. this.TemplateById = res.result
  141. }
  142. })
  143. },
  144. clickStep(item, index){
  145. let urls = [
  146. `/pages_order/order/ProcessCardOne?id=${this.id}&index=${index}&name=${item.name}`,
  147. `/pages_order/order/ProcessCardTo?id=${this.id}&index=${index}&name=${item.name}`,
  148. `/pages_order/order/ProcessCardThree?id=${this.id}&index=${index}&name=${item.name}`,
  149. `/pages_order/order/ProcessCardFour?id=${this.id}&index=${index}&name=${item.name}`,
  150. ]
  151. this.$utils.navigateTo(urls[index])
  152. },
  153. //收藏信息-添加收藏
  154. addCollection(){
  155. this.$api('addCollection', {
  156. templateId : this.id
  157. }, res => {
  158. this.queryTemplateById()
  159. if(res.code == 200){
  160. uni.showToast({
  161. title: this.TemplateById.collectonFlag ? '收藏成功' : '取消成功',
  162. icon: 'none'
  163. })
  164. this.TemplateById.collectonFlag = !this.TemplateById.collectonFlag
  165. }
  166. })
  167. },
  168. }
  169. }
  170. </script>
  171. <style scoped lang="scss">
  172. .page {
  173. background-color: #fff;
  174. height: 100vh;
  175. font-size: 28rpx;
  176. width: 100%;
  177. position: relative;
  178. .collect{
  179. position: absolute;
  180. right: 20rpx;
  181. margin-top: 20rpx;
  182. }
  183. .Box{
  184. margin-top: 40rpx;
  185. .work-box {
  186. padding: 0rpx 30rpx;
  187. margin: 20rpx 0rpx;
  188. display: flex;
  189. .works {
  190. width: 150rpx;
  191. flex-shrink: 0;
  192. }
  193. .index {
  194. margin-top: 3rpx;
  195. }
  196. }
  197. }
  198. .working-procedure {
  199. text-align: center;
  200. margin-top: 150rpx;
  201. .working {
  202. margin: 25rpx 0rpx;
  203. color: rgb(83, 125, 180);
  204. }
  205. }
  206. .modify{
  207. text-align: center;
  208. margin-top: 150rpx;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. gap: 30rpx;
  213. .modi{
  214. padding: 20rpx 60rpx;
  215. border-radius: 15rpx;
  216. background-color: $uni-color;
  217. color: #fff;
  218. }
  219. .a{
  220. background-color: #fff;
  221. border: 1rpx solid $uni-color;
  222. color: $uni-color;
  223. }
  224. }
  225. }
  226. </style>