index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <zj-page-container>
  3. <zj-page-fill class="neibuview">
  4. <zj-form-container v-if="!detailId" key="completeDetail">
  5. <zj-form-module title="完工明细">
  6. <zj-table :columns="completeDetailColumns" :table-data="completeDetailData" />
  7. </zj-form-module>
  8. </zj-form-container>
  9. <zj-form-container v-else key="details">
  10. <zj-form-module title="维修信息" :form-data="formData" :form-items="repairInfo" />
  11. <zj-form-module title="采集图片" :form-data="formData" :form-items="INSTALL_pgOrderProductImgs" />
  12. <zj-form-module title="故障图片" :form-data="formData" :form-items="BUG_pgOrderProductImgs" />
  13. </zj-form-container>
  14. </zj-page-fill>
  15. <div v-if="detailId" style="box-sizing: border-box;padding: 16px;">
  16. <el-button @click="close" size="mini">关闭</el-button>
  17. </div>
  18. </zj-page-container>
  19. </template>
  20. <script>
  21. import { changeOrderGetOrderProduct, changeOrderProductDetail } from "@/api/workOrderPool.js";
  22. import ImageUpload from '@/components/file-upload'
  23. export default {
  24. components: {
  25. ImageUpload
  26. },
  27. props: {
  28. id: {
  29. type: [String, Number],
  30. default: null,
  31. }
  32. },
  33. data() {
  34. return {
  35. completeDetailData: [],
  36. detailId: "",
  37. formData: {
  38. bugRemark: "",
  39. detailRemark: "",
  40. isDefend: "",
  41. pgOrderProductDetails: []
  42. }
  43. }
  44. },
  45. computed: {
  46. completeDetailColumns() {
  47. return [
  48. {
  49. columnAttributes: {
  50. label: '操作',
  51. prop: '',
  52. width: 60
  53. },
  54. render: (h, { row, column, index }) => {
  55. return <div style="padding-left:10px">
  56. <el-button type="text" onClick={() => {
  57. this.detailId = row.id
  58. }}>查看</el-button>
  59. </div>
  60. }
  61. },
  62. {
  63. columnAttributes: {
  64. label: '品牌名称',
  65. prop: 'brandName',
  66. }
  67. },
  68. {
  69. columnAttributes: {
  70. label: '产品大类',
  71. prop: 'mainName',
  72. }
  73. },
  74. {
  75. columnAttributes: {
  76. label: '产品小类',
  77. prop: 'smallName',
  78. }
  79. },
  80. {
  81. columnAttributes: {
  82. label: '机型名称',
  83. prop: 'productName',
  84. }
  85. },
  86. {
  87. columnAttributes: {
  88. label: '负责工程师',
  89. prop: 'workerName',
  90. }
  91. },
  92. {
  93. columnAttributes: {
  94. label: '联系电话',
  95. prop: 'workerMobile',
  96. }
  97. },
  98. {
  99. columnAttributes: {
  100. label: '状态',
  101. prop: 'status',
  102. }
  103. },
  104. {
  105. columnAttributes: {
  106. label: '采集时间',
  107. prop: 'giveTime',
  108. }
  109. },
  110. {
  111. columnAttributes: {
  112. label: '采集地址',
  113. prop: 'sumbitAddress',
  114. width: 260
  115. }
  116. },
  117. {
  118. columnAttributes: {
  119. label: '最后采集图片时 (总部结算--GPS定位地址)',
  120. prop: 'giveAddress',
  121. width: 260
  122. }
  123. },
  124. ]
  125. },
  126. repairInfo() {
  127. return [
  128. {
  129. name: 'el-input',
  130. md: 14,
  131. attributes: { disabled: true, placeholder: '' },
  132. formItemAttributes: { label: '故障现象', prop: 'bugRemark' },
  133. },
  134. {
  135. name: 'el-radio',
  136. options: [
  137. { label: '是', value: 'YES' },
  138. { label: '否', value: 'NO' },
  139. ],
  140. md: 10,
  141. attributes: { disabled: true, placeholder: '' },
  142. formItemAttributes: { label: '是否质保', prop: 'isDefend' },
  143. },
  144. {
  145. name: 'el-input',
  146. md: 24,
  147. attributes: { disabled: true, type: "textarea", placeholder: '' },
  148. formItemAttributes: { label: '备注', prop: 'detailRemark' },
  149. },
  150. ]
  151. },
  152. INSTALL_pgOrderProductImgs() {
  153. return [{
  154. md: 24,
  155. name: 'slot-component',
  156. formItemAttributes: {
  157. label: '',
  158. prop: '',
  159. 'label-width': '0px'
  160. },
  161. render: (h, { props, onInput }) => {
  162. return (
  163. <ImageUpload
  164. fileList={this.formData?.pgOrderProductDetails?.filter((item) => item.type === 'INSTALL').map((item) => ({ url: item.fileUrl, name: item.fileName }))}
  165. limit={1000}
  166. isEdit={false}
  167. viewOnline={false}
  168. download={false}
  169. showName={true}
  170. />
  171. )
  172. }
  173. },]
  174. },
  175. BUG_pgOrderProductImgs() {
  176. return [{
  177. md: 24,
  178. name: 'slot-component',
  179. formItemAttributes: {
  180. label: '',
  181. prop: '',
  182. 'label-width': '0px'
  183. },
  184. render: (h, { props, onInput }) => {
  185. return (
  186. <ImageUpload
  187. fileList={this.formData?.pgOrderProductDetails?.filter((item) => item.type === 'BUG').map((item) => ({ url: item.fileUrl, name: item.fileName }))}
  188. limit={1000}
  189. isEdit={false}
  190. viewOnline={false}
  191. download={false}
  192. showName={true}
  193. />
  194. )
  195. }
  196. },]
  197. },
  198. },
  199. watch: {
  200. id: {
  201. handler(newVal, oldVal) {
  202. if (this.id) {
  203. changeOrderGetOrderProduct({
  204. id: this.id
  205. }).then(res => {
  206. this.completeDetailData = res.data
  207. })
  208. }
  209. },
  210. deep: true,
  211. immediate: true,
  212. },
  213. detailId: {
  214. handler(newVal, oldVal) {
  215. if (this.detailId) {
  216. changeOrderProductDetail({
  217. id: this.detailId
  218. }).then(res => {
  219. this.formData = res.data
  220. console.log(res)
  221. })
  222. }
  223. },
  224. deep: true,
  225. },
  226. },
  227. methods: {
  228. close() {
  229. this.$data.formData = this.$options.data().formData
  230. this.detailId = ""
  231. },
  232. }
  233. }
  234. </script>
  235. <style lang="scss" scoped>
  236. .neibuview {
  237. box-sizing: border-box;
  238. padding-left: 16px;
  239. ::v-deep & > .zj-page-fill-scroll {
  240. box-sizing: border-box;
  241. padding-right: 16px;
  242. &>div:nth-child(1) {
  243. margin-top: 20px;
  244. }
  245. }
  246. }
  247. </style>