DetailCheck.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
  3. <a-row :gutter="48" slot="extra">
  4. <a-col :md="48" :sm="48">
  5. <span class="table-page-search-submitButtons" style="float: right">
  6. <a-button v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="primary" @click="handleApprove()">验收</a-button>
  7. <a-button v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="danger" @click="handleReturn()">驳回</a-button>
  8. <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
  9. </span>
  10. </a-col>
  11. </a-row>
  12. <a-layout>
  13. <a-layout-content style="background-color: rgb(255, 255, 255)">
  14. <a-divider orientation="left">报修详情</a-divider>
  15. <detail-list title="" :col="3">
  16. <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
  17. <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
  18. <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
  19. <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
  20. <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
  21. <detail-list-item term="报修人">{{ model.userName }}</detail-list-item>
  22. <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
  23. <detail-list-item term="紧急等级"><badge :text="BaseTool.Object.getField(levelMap,model.level)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[model.applicationLevel]"/></detail-list-item>
  24. <detail-list-item term="报修时间">{{ model.applyTime }}</detail-list-item>
  25. <detail-list-item term="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></detail-list-item>
  26. </detail-list>
  27. <detail-list title="" :col="1">
  28. <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
  29. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  30. </detail-list>
  31. <detail-list title="维修图片:" :col="6">
  32. <upload-image-detail :images-list="model.repairFileList"/>
  33. </detail-list>
  34. <a-divider orientation="left">维修详情</a-divider>
  35. <detail-list title="" :col="3">
  36. <detail-list-item term="故障类别">{{ model.repairErrorTypeName }}</detail-list-item>
  37. <detail-list-item term="维修开始时间">{{ model.repairStartTime }}</detail-list-item>
  38. <detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
  39. <detail-list-item term="维修耗时">{{ model.repairMinutes }}</detail-list-item>
  40. <detail-list-item term="维修人员">{{ model.repairUserName }}</detail-list-item>
  41. <!--<detail-list-item term="维修次数">{{ model.repairTimes }}</detail-list-item>-->
  42. </detail-list>
  43. <detail-list title="" :col="1">
  44. <detail-list-item term="维修描述">{{ model.repairContent }}</detail-list-item>
  45. </detail-list>
  46. <detail-list title="维修图片:" :col="6">
  47. <upload-image-detail :images-list="model.repairFileList"/>
  48. </detail-list>
  49. <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
  50. <detail-list v-for="item in dispatchList" title="" :col="3">
  51. <detail-list-item term="转派人">{{ item.username }}</detail-list-item>
  52. <detail-list-item term="转派时间">{{ item.time }}</detail-list-item>
  53. <detail-list-item term="转派备注">{{ item.remark }}</detail-list-item>
  54. </detail-list>
  55. <a-divider orientation="left">验收详情</a-divider>
  56. <detail-list title="" :col="3">
  57. <detail-list-item term="验收开始时间">{{ model.checkStartTime }}</detail-list-item>
  58. <detail-list-item term="验收结束时间">{{ model.checkEndTime }}</detail-list-item>
  59. <detail-list-item term="验收人员">{{ model.checkUserName }}</detail-list-item>
  60. <detail-list-item term="验收描述">{{ model.checkContent }}</detail-list-item>
  61. </detail-list>
  62. <detail-list title="验收图片:" :col="6">
  63. <upload-image-detail :images-list="model.checkFileList"/>
  64. </detail-list>
  65. </a-layout-content>
  66. <a-layout-sider style="background-color: rgb(255, 255, 255)">
  67. <div style="margin-top: 30px;margin-left: 30px;">
  68. <a-steps progress-dot :current="6" direction="vertical" >
  69. <a-step title="报修时间:" :description="''+model.applyTime?model.applyTime:''" />
  70. <a-step title="维修开始时间:" :description="''+model.repairStartTime?model.repairStartTime:''" />
  71. <a-step title="维修结束时间:" :description="''+model.repairEndTime?model.repairEndTime:''" />
  72. <a-step title="验收开始时间:" :description="''+model.checkStartTime?model.checkStartTime:''" />
  73. <a-step title="验收结束时间:" :description="''+model.checkEndTime?model.checkEndTime:''" />
  74. </a-steps>
  75. </div>
  76. </a-layout-sider>
  77. </a-layout>
  78. <title-divider title="维修项目" width="90px"></title-divider>
  79. <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">
  80. </div>
  81. <a-table
  82. :data-source="data"
  83. :columns="columns"
  84. tableLayout="auto"
  85. rowKey="id">
  86. </a-table>
  87. <title-divider title="配件清单" width="90px"></title-divider>
  88. <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">
  89. </div>
  90. <a-table
  91. :data-source="dataSpare"
  92. :columns="columnsSpare"
  93. tableLayout="auto"
  94. rowKey="id">
  95. </a-table>
  96. <!--<q-tabs :activeKey="activeKey" @change="changeTab">
  97. <q-tab-pane key="a" tab="配件更换">
  98. <spare-part-used-select-table :type="1" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
  99. </q-tab-pane>
  100. <q-tab-pane key="b" tab="备件领用">
  101. <spare-pick-form-select-table :type="1" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
  102. </q-tab-pane>
  103. </q-tabs>
  104. <finish-form ref="finishForm" @ok="handleOk" />
  105. <dispatch-form ref="dispatchForm" @ok="handleCancel" />-->
  106. <check-form ref="checkForm" @ok="handleOk" />
  107. </a-card>
  108. </template>
  109. <script>
  110. import DetailList from '@/components/tools/DetailList'
  111. import { fetchRepairApplicationForm, approve, receive } from '@/api/repair/application-form'
  112. import CheckForm from './CheckForm'
  113. import FinishForm from './FinishForm'
  114. import DispatchForm from './DispatchForm'
  115. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  116. import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
  117. import { selectSparePartUsedListByRepairId } from '@/api/sqarepartmanage/sparepartused'
  118. import { selectRepairProjectListByRepairId } from '@/api/repair/repairprojectrelation'
  119. const DetailListItem = DetailList.Item
  120. export default {
  121. name: 'RepairApplicationFormDetail',
  122. components: {
  123. CheckForm,
  124. DetailList,
  125. DetailListItem,
  126. FinishForm,
  127. DispatchForm,
  128. SparePartUsedSelectTable,
  129. SparePickFormSelectTable
  130. },
  131. data () {
  132. return {
  133. confirmLoading: false,
  134. mdl: {},
  135. modalTitle: null,
  136. needStopMap: {},
  137. dispatchList: [],
  138. activeKey: 'a',
  139. visible: false,
  140. // 下拉框map
  141. sourceMap: {},
  142. descripitionMap: {},
  143. levelMap: {},
  144. statusMap: {},
  145. repairProjectMap: {},
  146. repairTechnologyMap: {},
  147. data: [],
  148. dataSpare: [],
  149. // 表头
  150. columns: [
  151. {
  152. title: '序号',
  153. dataIndex: 'index',
  154. customRender: (text, record, index) => {
  155. return `${index + 1}`
  156. }
  157. },
  158. {
  159. title: '编码',
  160. dataIndex: 'no'
  161. },
  162. {
  163. title: '名称',
  164. dataIndex: 'name'
  165. },
  166. {
  167. title: '维修类别',
  168. dataIndex: 'type',
  169. customRender: (text, record, index) => {
  170. return this.BaseTool.Object.getField(this.repairProjectMap, text)
  171. }
  172. },
  173. {
  174. title: '维修工艺',
  175. dataIndex: 'technology',
  176. customRender: (text, record, index) => {
  177. return this.BaseTool.Object.getField(this.repairTechnologyMap, text)
  178. }
  179. },
  180. {
  181. title: '标准工时',
  182. dataIndex: 'standardHours'
  183. },
  184. {
  185. title: '标准费用',
  186. dataIndex: 'standardMoney'
  187. },
  188. {
  189. title: '考核工时',
  190. dataIndex: 'checkHours'
  191. }
  192. ],
  193. columnsSpare: [
  194. {
  195. title: '序号',
  196. dataIndex: 'index',
  197. customRender: (text, record, index) => {
  198. return `${index + 1}`
  199. }
  200. },
  201. {
  202. title: '备件名称',
  203. dataIndex: 'spareId',
  204. customRender: (text, record, index) => {
  205. return record.spareName
  206. }
  207. },
  208. {
  209. title: '数量',
  210. dataIndex: 'num'
  211. },
  212. {
  213. title: '价格',
  214. dataIndex: 'price'
  215. },
  216. {
  217. title: '总价',
  218. dataIndex: 'totalPrice'
  219. }
  220. ],
  221. model: {
  222. 'id': null,
  223. 'sbId': null,
  224. 'partId': null,
  225. 'repairUserId': null,
  226. 'needStop': null,
  227. 'no': null,
  228. 'source': null,
  229. 'applyTime': null,
  230. 'level': null,
  231. 'content': null,
  232. 'status': null,
  233. 'remark': null,
  234. 'updateTime': null,
  235. 'createdUserId': null,
  236. 'updateUserId': null,
  237. 'createdUserName': null,
  238. 'sbName': null,
  239. 'partName': null,
  240. 'updateUserName': null,
  241. 'repairFormVO': null,
  242. 'repairCheckVO': null
  243. }
  244. }
  245. },
  246. created () {
  247. // 下拉框map
  248. this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  249. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  250. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  251. this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
  252. this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
  253. this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  254. this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
  255. this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
  256. this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIRE_ACTION)
  257. },
  258. methods: {
  259. base (record) {
  260. this.visible = true
  261. this.modalTitle = '详情'
  262. this.model = record
  263. this.dispatchList = JSON.parse(record.repairDispatchList)
  264. selectRepairProjectListByRepairId({ id: record.id }).then(res => {
  265. this.data = res.data
  266. })
  267. selectSparePartUsedListByRepairId({ id: record.id }).then(res => {
  268. this.dataSpare = res.data
  269. })
  270. },
  271. handleCancel () {
  272. this.visible = false
  273. this.confirmLoading = false
  274. this.$emit('ok')
  275. },
  276. receive () {
  277. receive(this.model).then(() => {
  278. this.$message.info('任务接收成功,请及时维修')
  279. this.handleOk()
  280. })
  281. },
  282. handleApprove () {
  283. approve(this.model).then(() => {
  284. this.$message.info('操作成功')
  285. this.handleOk()
  286. })
  287. },
  288. handleReturn () {
  289. console.log('11111')
  290. const modal = this.$refs.checkForm
  291. modal.base(this.model)
  292. },
  293. handleOk () {
  294. fetchRepairApplicationForm({ id: this.model.id }).then(res => {
  295. this.model = res.data
  296. this.dispatchList = JSON.parse(this.model.repairDispatchList)
  297. })
  298. },
  299. handleFinish () {
  300. const modal = this.$refs.finishForm
  301. modal.base(this.model)
  302. },
  303. handleDispatch () {
  304. const modal = this.$refs.dispatchForm
  305. modal.base(this.model)
  306. },
  307. changeTab (activeKey) {
  308. this.activeKey = activeKey
  309. if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  310. const modal = this.$refs.sparePartUsedSelectTable
  311. modal.handleOk()
  312. return
  313. }
  314. if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
  315. const modal = this.$refs.sparePickFormSelectTable
  316. modal.handleOk()
  317. }
  318. }
  319. }
  320. }
  321. </script>