taskForm.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="">
  3. <view class="basic_info">
  4. <view class="info_header">
  5. <view class="info_title">基本信息</view>
  6. <u-gap height="4" bgColor="#1890FF"></u-gap>
  7. </view>
  8. <view class="info_content">
  9. <u-row>
  10. <u-col span="4">
  11. <view class="label">计划单号:</view>
  12. </u-col>
  13. <u-col span="8">
  14. <view class="value">{{infoData.code}}121212</view>
  15. </u-col>
  16. </u-row>
  17. <u-row>
  18. <u-col span="4">
  19. <view class="label">来源计划配置单:</view>
  20. </u-col>
  21. <u-col span="8">
  22. <view class="value">{{infoData.planConfigCode}}</view>
  23. </u-col>
  24. </u-row>
  25. <u-row>
  26. <u-col span="4">
  27. <view class="label">完成时长:</view>
  28. </u-col>
  29. <u-col span="8">
  30. <view class="value" v-if="infoData.duration">{{infoData.duration}}分钟</view>
  31. </u-col>
  32. </u-row>
  33. <u-row>
  34. <u-col span="4">
  35. <view class="label">周期:</view>
  36. </u-col>
  37. <u-col span="8">
  38. <view class="value" v-if="infoData.ruleInfo">
  39. {{ infoData.ruleInfo.cycleValue}}
  40. <!-- {{getDictValue('巡点检周期', infoData.ruleInfo.cycleType)}} -->
  41. </view>
  42. </u-col>
  43. </u-row>
  44. <u-row>
  45. <u-col span="4">
  46. <view class="label">规则名称:</view>
  47. </u-col>
  48. <u-col span="8">
  49. <view class="value">{{ infoData.name}}</view>
  50. </u-col>
  51. </u-row>
  52. <u-row>
  53. <u-col span="4">
  54. <view class="label">创建人:</view>
  55. </u-col>
  56. <u-col span="8">
  57. <view class="value">{{ infoData.createUserName}}</view>
  58. </u-col>
  59. </u-row>
  60. <u-row>
  61. <u-col span="4">
  62. <view class="label">创建时间:</view>
  63. </u-col>
  64. <u-col span="8">
  65. <view class="value">{{ infoData.createTime}}</view>
  66. </u-col>
  67. </u-row>
  68. <u-row>
  69. <u-col span="4">
  70. <view class="label">备注:</view>
  71. </u-col>
  72. <u-col span="8">
  73. <view class="value">{{ infoData.remark}}</view>
  74. </u-col>
  75. </u-row>
  76. </view>
  77. <view class="info_header">
  78. <view class="info_title">量具设备</view>
  79. <u-gap height="4" bgColor="#1890FF"></u-gap>
  80. </view>
  81. <view class="card_box" v-for="(item,index) in infoData.planDeviceList">
  82. <view class="card_title">设备{{index + 1}}</view>
  83. <u-row>
  84. <u-col span="3">
  85. <view class="label">设备编码:</view>
  86. </u-col>
  87. <u-col span="9">
  88. <view class="value">{{item.substance.code}}</view>
  89. </u-col>
  90. </u-row>
  91. <u-row>
  92. <u-col span="3">
  93. <view class="label">设备编号:</view>
  94. </u-col>
  95. <u-col span="9">
  96. <view class="value">{{item.substance.codeNumber}}</view>
  97. </u-col>
  98. </u-row>
  99. <u-row>
  100. <u-col span="3">
  101. <view class="label">设备名称:</view>
  102. </u-col>
  103. <u-col span="9">
  104. <view class="value">{{item.substance.name}}</view>
  105. </u-col>
  106. </u-row>
  107. <u-row>
  108. <u-col span="3">
  109. <view class="label">设备型号:</view>
  110. </u-col>
  111. <u-col span="9">
  112. <view class="value">{{item.substance.model}}</view>
  113. </u-col>
  114. </u-row>
  115. <u-row>
  116. <u-col span="3">
  117. <view class="label">是否遗失:</view>
  118. </u-col>
  119. <u-col span="9">
  120. <view class="value">
  121. <u-radio-group v-if="taskDefinitionKey === 'user_submit'" size="30" iconSize="20"
  122. v-model="item.isLose" placement="row" @change="">
  123. <u-radio :customStyle="{marginRight: '15px'}" v-for="(Item, Index) in option"
  124. :key="Index" :label="Item.label" :name="Item.value">
  125. </u-radio>
  126. </u-radio-group>
  127. <span
  128. v-else>{{item.isLose != null? option.filter((i) => i.value == item.isLose)[0].label: ''}}</span>
  129. </view>
  130. </u-col>
  131. </u-row>
  132. <u-row>
  133. <u-col span="3">
  134. <view class="label">质检:</view>
  135. </u-col>
  136. <u-col span="9">
  137. <view class="value">
  138. <u-radio-group
  139. v-if="(taskDefinitionKey === 'leader_check' &&infoData.logList.length == 1) ||taskDefinitionKey === 'user_receive'"
  140. size="30" iconSize="20" v-model="item.qualityStatus" placement="row"
  141. @change="qualityChange">
  142. <u-radio :customStyle="{marginRight: '15px'}" v-for="(Item, Index) in statusOption"
  143. :key="Index" :label="Item.label" :name="Item.value">
  144. </u-radio>
  145. </u-radio-group>
  146. <span
  147. v-else>{{item.qualityStatus != null? statusOption.filter((i) => i.value == item.qualityStatus)[0].label: ''}}</span>
  148. </view>
  149. </u-col>
  150. </u-row>
  151. </view>
  152. </view>
  153. </view>
  154. </template>
  155. <script>
  156. import {
  157. processById,
  158. getList
  159. } from '@/api/wt/index.js'
  160. export default {
  161. props: {
  162. businessId: {
  163. default: ''
  164. },
  165. taskDefinitionKey: {
  166. default: ''
  167. }
  168. },
  169. data() {
  170. return {
  171. infoData: {}, // 量具送检信息
  172. statusOption: [{
  173. value: 0,
  174. label: '正常'
  175. },
  176. {
  177. value: 1,
  178. label: '异常'
  179. }
  180. ],
  181. option: [{
  182. value: 0,
  183. label: '否'
  184. },
  185. {
  186. value: 1,
  187. label: '是'
  188. }
  189. ],
  190. }
  191. },
  192. created() {
  193. this.getData()
  194. },
  195. methods: {
  196. qualityChange(e) { // 质检切换
  197. // console.log(e,6666666666666666666)
  198. },
  199. getData() {
  200. let type = '';
  201. switch (this.taskDefinitionKey) {
  202. case 'user_submit':
  203. type = 1;
  204. break;
  205. case 'team_leader_submit':
  206. type = 2;
  207. break;
  208. case 'leader_approve':
  209. type = 3;
  210. break;
  211. case 'leader_check':
  212. type = 3;
  213. break;
  214. case 'team_leader_receive_send':
  215. type = 2;
  216. break;
  217. case 'user_receive':
  218. type = 1;
  219. break;
  220. }
  221. processById({
  222. id: this.businessId,
  223. type
  224. }).then(async (data) => {
  225. this.infoData = data;
  226. if (this.taskDefinitionKey == 'leader_check') {
  227. this.infoData.planDeviceList = this.infoData.planDeviceList.map(
  228. (item) => {
  229. return {
  230. ...item,
  231. qualityStatus: 0
  232. };
  233. }
  234. );
  235. }
  236. });
  237. },
  238. async getTableValue() {
  239. return this.infoData;
  240. }
  241. }
  242. }
  243. </script>
  244. <style lang="scss">
  245. .basic_info {
  246. box-sizing: border-box;
  247. padding: 0 20rpx;
  248. }
  249. .info_title {
  250. position: relative;
  251. padding: 16rpx 50rpx;
  252. font-size: 36rpx;
  253. color: #606266;
  254. }
  255. .info_title::after {
  256. content: '';
  257. position: absolute;
  258. top: 16rpx;
  259. left: 0px;
  260. width: 16rpx;
  261. height: 50rpx;
  262. background: #1890FF;
  263. }
  264. .info_content {
  265. .label {
  266. padding: 20rpx 0;
  267. text-align: right;
  268. font-size: 28rpx;
  269. font-weight: 700;
  270. color: #6e6e6e;
  271. }
  272. .value {
  273. padding: 20rpx 0;
  274. font-size: 28rpx;
  275. color: #606266;
  276. }
  277. }
  278. .card_box {
  279. box-sizing: border-box;
  280. padding: 20rpx;
  281. margin: 20rpx;
  282. width: calc(100% - 20rpx);
  283. border-radius: 20rpx;
  284. box-shadow: 0 0 12rpx -6rpx #000;
  285. .card_title {
  286. font-size: 32rpx;
  287. font-weight: 700;
  288. color: #666;
  289. }
  290. .label {
  291. padding: 18rpx 0;
  292. text-align: right;
  293. font-size: 28rpx;
  294. font-weight: 700;
  295. color: #6e6e6e;
  296. }
  297. .value {
  298. padding: 18rpx 0;
  299. font-size: 28rpx;
  300. color: #606266;
  301. }
  302. }
  303. </style>