工单小程序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.

237 lines
4.8 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 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="TemplateById.collectonFlag"
  14. color="#169bd5"
  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. this.$store.commit('getUserInfo')
  130. },
  131. computed : {
  132. ...mapState(['workDetail']),
  133. },
  134. methods: {
  135. // 根据id获取工单详情
  136. queryTemplateById(){
  137. this.$api('queryTemplateById', {
  138. templateId : this.id
  139. }, res =>{
  140. if(res.code == 200){
  141. this.TemplateById = res.result
  142. }
  143. })
  144. },
  145. clickStep(item, index){
  146. let urls = [
  147. `/pages_order/order/ProcessCardOne?id=${this.id}&index=${index}&name=${item.name}`,
  148. `/pages_order/order/ProcessCardTo?id=${this.id}&index=${index}&name=${item.name}`,
  149. `/pages_order/order/ProcessCardThree?id=${this.id}&index=${index}&name=${item.name}`,
  150. `/pages_order/order/ProcessCardFour?id=${this.id}&index=${index}&name=${item.name}`,
  151. ]
  152. this.$utils.navigateTo(urls[index])
  153. },
  154. //收藏信息-添加收藏
  155. addCollection(){
  156. this.$api('addCollection', {
  157. templateId : this.id
  158. }, res => {
  159. this.queryTemplateById()
  160. if(res.code == 200){
  161. uni.showToast({
  162. title: this.TemplateById.collectonFlag ? '收藏成功' : '取消成功',
  163. icon: 'none'
  164. })
  165. this.TemplateById.collectonFlag = !this.TemplateById.collectonFlag
  166. }
  167. })
  168. },
  169. }
  170. }
  171. </script>
  172. <style scoped lang="scss">
  173. .page {
  174. background-color: #fff;
  175. height: 100vh;
  176. font-size: 28rpx;
  177. width: 100%;
  178. position: relative;
  179. .collect{
  180. position: absolute;
  181. right: 20rpx;
  182. margin-top: 20rpx;
  183. }
  184. .Box{
  185. margin-top: 40rpx;
  186. .work-box {
  187. padding: 0rpx 30rpx;
  188. margin: 20rpx 0rpx;
  189. display: flex;
  190. .works {
  191. width: 150rpx;
  192. flex-shrink: 0;
  193. }
  194. .index {
  195. margin-top: 3rpx;
  196. }
  197. }
  198. }
  199. .working-procedure {
  200. text-align: center;
  201. margin-top: 150rpx;
  202. .working {
  203. margin: 25rpx 0rpx;
  204. color: rgb(83, 125, 180);
  205. }
  206. }
  207. .modify{
  208. text-align: center;
  209. margin-top: 150rpx;
  210. display: flex;
  211. align-items: center;
  212. justify-content: center;
  213. gap: 30rpx;
  214. .modi{
  215. padding: 20rpx 60rpx;
  216. border-radius: 15rpx;
  217. background-color: $uni-color;
  218. color: #fff;
  219. }
  220. .a{
  221. background-color: #fff;
  222. border: 1rpx solid $uni-color;
  223. color: $uni-color;
  224. }
  225. }
  226. }
  227. </style>