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

226 lines
4.0 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
  1. <template>
  2. <!-- 工单详情 -->
  3. <view class="page">
  4. <navbar
  5. title="详情"
  6. leftClick
  7. @leftClick="$utils.navigateBack"
  8. />
  9. <view class="Box">
  10. <view class="work-box">
  11. <view class="works">
  12. 任务号
  13. </view>
  14. <view class="index">
  15. {{detail.taskNo}}
  16. </view>
  17. </view>
  18. <view class="work-box">
  19. <view class="works">
  20. 担当信息
  21. </view>
  22. <view class="index">
  23. {{detail.responsibler}}
  24. </view>
  25. </view>
  26. <view class="work-box">
  27. <view class="works">
  28. 机型信息
  29. </view>
  30. <view class="inde">
  31. {{detail.model}}
  32. </view>
  33. </view>
  34. <view class="work-box">
  35. <view class="works">
  36. 数量
  37. </view>
  38. <view class="index">
  39. <uv-number-box v-model="detail.number"></uv-number-box>
  40. </view>
  41. </view>
  42. <view class="work-box">
  43. <view class="works">
  44. 状态
  45. </view>
  46. <view class="index"
  47. @click="$refs.picker.open()">
  48. <input type="text"
  49. disabled
  50. v-model="detail.statusDescribe"/>
  51. </view>
  52. </view>
  53. <view class="work-box">
  54. <view class="works">
  55. 备注
  56. </view>
  57. <view class="index">
  58. <input type="text" v-model="detail.remark"/>
  59. </view>
  60. </view>
  61. <view class="work-box">
  62. <view class="works">
  63. 是否加急
  64. </view>
  65. <view class="index">
  66. <uv-radio-group v-model="detail.isEmergency">
  67. <uv-radio
  68. :customStyle="{margin: '8px'}"
  69. v-for="(item, index) in radiolist"
  70. :key="index"
  71. :label="item.name"
  72. :name="item.id">
  73. </uv-radio>
  74. </uv-radio-group>
  75. </view>
  76. </view>
  77. </view>
  78. <uv-picker ref="picker"
  79. :columns="columns"
  80. keyName="name"
  81. @confirm="confirm"></uv-picker>
  82. <view class="modify">
  83. <view class="modi"
  84. @click="submit">
  85. 保存
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. import { mapState } from 'vuex'
  92. export default {
  93. data() {
  94. return {
  95. id : 0,
  96. detail : {
  97. },
  98. radiolist : [
  99. {
  100. name : '不加急',
  101. id : '0',
  102. },
  103. {
  104. name : '加急',
  105. id : '1',
  106. },
  107. ],
  108. }
  109. },
  110. onLoad(args) {
  111. this.id = args.id
  112. },
  113. onShow() {
  114. if(this.id){
  115. this.querydetail()
  116. }
  117. },
  118. computed : {
  119. ...mapState(['workDetail', 'statusList']),
  120. columns(){
  121. let list = JSON.parse(JSON.stringify(this.statusList))
  122. list.splice(0, 1)
  123. return [
  124. list
  125. ]
  126. },
  127. },
  128. methods: {
  129. // 根据id获取工单详情
  130. querydetail(){
  131. this.$api('queryTemplateById', {
  132. templateId : this.id
  133. }, res =>{
  134. if(res.code == 200){
  135. delete res.result.workorderStepList
  136. this.detail = res.result
  137. }
  138. })
  139. },
  140. submit(){
  141. let data = JSON.parse(JSON.stringify(this.detail))
  142. delete data.updateBy
  143. delete data.updateTime
  144. delete data.createBy
  145. delete data.createTime
  146. this.$api('updateTemplate', data, res => {
  147. if(res.code == 200){
  148. uni.showToast({
  149. title: '保存成功',
  150. icon: 'none'
  151. })
  152. setTimeout(uni.navigateBack, 1000, -1)
  153. }
  154. })
  155. },
  156. confirm(e){
  157. this.detail.statusId = e.value[0].id
  158. this.detail.statusDescribe = e.value[0].name
  159. },
  160. }
  161. }
  162. </script>
  163. <style scoped lang="scss">
  164. .page {
  165. background-color: #fff;
  166. height: 100vh;
  167. font-size: 28rpx;
  168. .Box{
  169. margin-top: 40rpx;
  170. .work-box {
  171. padding: 0rpx 30rpx;
  172. margin: 30rpx 0rpx;
  173. display: flex;
  174. align-items: center;
  175. .works {
  176. width: 150rpx;
  177. flex-shrink: 0;
  178. }
  179. .index {
  180. margin-top: 3rpx;
  181. }
  182. input{
  183. background-color: #eee;
  184. padding: 10rpx 20rpx;
  185. border-radius: 20rpx;
  186. width: 430rpx;
  187. }
  188. }
  189. }
  190. .working-procedure {
  191. text-align: center;
  192. margin-top: 150rpx;
  193. .working {
  194. margin: 25rpx 0rpx;
  195. color: rgb(83, 125, 180);
  196. }
  197. }
  198. .modify{
  199. text-align: center;
  200. margin-top: 150rpx;
  201. display: flex;
  202. align-items: center;
  203. justify-content: center;
  204. .modi{
  205. padding: 20rpx 60rpx;
  206. background-color:rgb(2 ,167, 240) ;
  207. border-radius: 15rpx;
  208. color: #fff;
  209. }
  210. }
  211. }
  212. </style>