detailDialog.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <ele-modal custom-class="ele-dialog-form long-dialog-form" :visible.sync="visibleDialog" title="报工"
  3. :close-on-click-modal="false" width="55%" append-to-body @close="handleClose" :maxable="true">
  4. <el-tabs type="border-card" v-model="tabsActiveName">
  5. <el-tab-pane label="工单信息" name="workInfo">
  6. <el-row class="repair_row">
  7. <el-col :span="8" class="repair_column">
  8. <span>工单编号:</span>
  9. <span>{{ addForm.code || '' }}</span>
  10. </el-col>
  11. <el-col :span="8" class="repair_column">
  12. <span>执行部门:</span>
  13. <span>{{ addForm.executeGroupName || '' }}</span>
  14. </el-col>
  15. <el-col :span="8" class="repair_column">
  16. <span>执行人:</span>
  17. <span>{{ addForm.executeUserName || '' }}</span>
  18. </el-col>
  19. </el-row>
  20. <el-row class="repair_row">
  21. <el-col :span="8" class="repair_column">
  22. <span>计划单号:</span>
  23. <span>{{ addForm.planCode || '' }}</span>
  24. </el-col>
  25. <el-col :span="8" class="repair_column">
  26. <span>计划名称:</span>
  27. <span>{{ addForm.planName || '' }}</span>
  28. </el-col>
  29. <el-col :span="8" class="repair_column">
  30. <span>计划完成时间:</span>
  31. <span>{{ addForm.planFinishTime || '' }}</span>
  32. </el-col>
  33. </el-row>
  34. </el-tab-pane>
  35. <el-tab-pane label="需求单信息" name="demandInfo">
  36. <div class="marginBto">
  37. <div>
  38. <span class="name">发货单编码:{{ contractInfo.orderCode }}</span>
  39. <span>客户名称:{{ contractInfo?.name }}</span>
  40. <span>客户编码:{{ contractInfo?.code }}</span>
  41. <span>客户代号:{{ contractInfo?.serialNo }}</span>
  42. <span>业务员:{{ contractInfo?.salesmanName }}</span>
  43. <span>客户级别:{{ getDictValue('供应商级别', contractInfo.level + '') }}</span>
  44. </div>
  45. </div>
  46. <ele-pro-table ref="tableRef" :columns="columnsDetail" :datasource="productDetailList" height="200"
  47. :needPage="false" class="marginBto">
  48. <template v-slot:attachmentsArray="{ row }">
  49. <fileMain v-model="row.attachmentsArray" type='view'></fileMain>
  50. </template>
  51. </ele-pro-table>
  52. </el-tab-pane>
  53. <el-tab-pane label="备品备件清单" name="sparePartsApply">
  54. <spareParts ref="refs" :detailList="detailList"></spareParts>
  55. </el-tab-pane>
  56. </el-tabs>
  57. </ele-modal>
  58. </template>
  59. <script>
  60. import fileMain from '@/components/addDoc/index.vue';
  61. import spareParts from '../../components/sparePartsList.vue';
  62. import { getSalesWorkOrderById } from '@/api/salesServiceManagement/index'
  63. import { contactDetail } from "@/api/saleManage/contact";
  64. import { mapGetters } from 'vuex';
  65. export default {
  66. props: {
  67. },
  68. components: {
  69. fileMain,
  70. spareParts
  71. },
  72. watch: {},
  73. computed: {
  74. ...mapGetters(['getDictValue']),
  75. },
  76. data() {
  77. return {
  78. title: '',
  79. visibleDialog: false,
  80. tabsActiveName: 'workInfo',
  81. addForm: {
  82. time: [],
  83. attachments: '',
  84. reason: '',
  85. },
  86. detailList: [],
  87. contractInfo: {},
  88. productDetailList: [],
  89. columnsDetail: [
  90. {
  91. columnKey: 'index',
  92. label: '序号',
  93. type: 'index',
  94. width: 55,
  95. align: 'center',
  96. showOverflowTooltip: true
  97. },
  98. {
  99. prop: 'categoryCode',
  100. label: '编码',
  101. align: 'center',
  102. showOverflowTooltip: true,
  103. },
  104. {
  105. prop: 'categoryName',
  106. label: '名称',
  107. align: 'center',
  108. showOverflowTooltip: true,
  109. },
  110. {
  111. prop: 'batchNo',
  112. label: '批次号',
  113. align: 'center',
  114. showOverflowTooltip: true,
  115. },
  116. {
  117. prop: 'barcodes',
  118. label: '发货条码',
  119. align: 'center',
  120. showOverflowTooltip: true,
  121. },
  122. {
  123. prop: 'measureQuantity',
  124. label: '计量数量',
  125. align: 'center',
  126. showOverflowTooltip: true,
  127. },
  128. {
  129. prop: 'materielDesignation',
  130. label: '物料代号',
  131. align: 'center',
  132. showOverflowTooltip: true,
  133. },
  134. {
  135. prop: 'engrave',
  136. label: '刻码',
  137. align: 'center',
  138. showOverflowTooltip: true,
  139. },
  140. {
  141. prop: 'type',
  142. label: '问题类型',
  143. align: 'center',
  144. showOverflowTooltip: true,
  145. width: 120,
  146. formatter: (_row, _column, cellValue) => {
  147. return cellValue == 1 ? '维修' : cellValue == 2 ? '保养' : cellValue == 3 ? '安装' : '';
  148. }
  149. },
  150. {
  151. prop: 'typeDescribe',
  152. slot: 'typeDescribe',
  153. label: '问题描述',
  154. align: 'center',
  155. showOverflowTooltip: true,
  156. width: 300
  157. },
  158. {
  159. prop: 'attachmentsArray',
  160. slot: 'attachmentsArray',
  161. label: '附件',
  162. align: 'center',
  163. width: 120
  164. }
  165. ],
  166. }
  167. },
  168. created() {
  169. },
  170. methods: {
  171. handleDetail(row) {
  172. this.$refs.edit.open(this.addForm, 'work');
  173. },
  174. async getDetail(row) {
  175. const res = await getSalesWorkOrderById(row.id)
  176. res?.sparePartsApplyVO.map((item) => {
  177. item.repairCode = res.code;
  178. item.repairName = res.name;
  179. return {
  180. ...item
  181. }
  182. })
  183. this.detailList = res.sparePartsApplyVO || [];
  184. //需求单信息
  185. await this.getContactDetail(res?.afterSalesDemandVO.contactId);
  186. this.productDetailList = res?.afterSalesDemandVO.productDetail || [];
  187. },
  188. async getContactDetail(id) {
  189. const res = await contactDetail(id)
  190. this.contractInfo = res?.base;
  191. },
  192. open(row) {
  193. this.addForm = row;
  194. this.tabsActiveName = 'workInfo';
  195. this.visibleDialog = true;
  196. this.getDetail(row);
  197. },
  198. handleClose() {
  199. this.tabsActiveName = '';
  200. this.visibleDialog = false;
  201. },
  202. }
  203. };
  204. </script>
  205. <style lang="scss" scoped>
  206. .repair_row {
  207. margin-bottom: 15px;
  208. .repair_column {
  209. display: flex;
  210. >span {
  211. &:first-child {
  212. font-weight: 700;
  213. text-align: right;
  214. width: 120px;
  215. }
  216. }
  217. }
  218. }
  219. </style>
  220. <style lang="scss" scoped>
  221. .marginBto {
  222. margin-bottom: 10px;
  223. span {
  224. margin-left: 50px;
  225. }
  226. .name {
  227. font-weight: 800;
  228. color: #40a9ff;
  229. }
  230. }
  231. </style>