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

232 lines
4.2 KiB

5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
3 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 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="statusId_dictText"
  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', 'permissionStatusList']),
  120. columns(){
  121. let list = JSON.parse(JSON.stringify(this.permissionStatusList))
  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. for (let k in data) {
  147. if(!data[k] || data[k] == 'null'){
  148. data[k] = ''
  149. }
  150. }
  151. this.$api('updateTemplate', data, res => {
  152. if(res.code == 200){
  153. uni.showToast({
  154. title: '保存成功',
  155. icon: 'none'
  156. })
  157. setTimeout(uni.navigateBack, 1000, -1)
  158. }
  159. })
  160. },
  161. confirm(e){
  162. this.detail.statusId = e.value[0].statusId
  163. this.detail.statusDescribe = e.value[0].statusId_dictText
  164. },
  165. }
  166. }
  167. </script>
  168. <style scoped lang="scss">
  169. .page {
  170. background-color: #fff;
  171. height: 100vh;
  172. font-size: 28rpx;
  173. .Box{
  174. margin-top: 40rpx;
  175. .work-box {
  176. padding: 0rpx 30rpx;
  177. margin: 30rpx 0rpx;
  178. display: flex;
  179. align-items: center;
  180. .works {
  181. width: 150rpx;
  182. flex-shrink: 0;
  183. }
  184. .index {
  185. margin-top: 3rpx;
  186. }
  187. input{
  188. background-color: #eee;
  189. padding: 10rpx 20rpx;
  190. border-radius: 20rpx;
  191. width: 430rpx;
  192. }
  193. }
  194. }
  195. .working-procedure {
  196. text-align: center;
  197. margin-top: 150rpx;
  198. .working {
  199. margin: 25rpx 0rpx;
  200. color: rgb(83, 125, 180);
  201. }
  202. }
  203. .modify{
  204. text-align: center;
  205. margin-top: 150rpx;
  206. display: flex;
  207. align-items: center;
  208. justify-content: center;
  209. .modi{
  210. padding: 20rpx 60rpx;
  211. background-color:rgb(2 ,167, 240) ;
  212. border-radius: 15rpx;
  213. color: #fff;
  214. }
  215. }
  216. }
  217. </style>