detailDialog.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form" label-width="120px">
  4. <headerTitle title="基本信息">
  5. <!-- <el-button
  6. size="small"
  7. type="primary"
  8. icon="el-icon-s-grid"
  9. class="ele-btn-icon"
  10. @click="exportTable"
  11. >
  12. 导出
  13. </el-button> -->
  14. </headerTitle>
  15. <el-row>
  16. <el-col :span="12" style="height: 40px">
  17. <el-form-item label="采购需求:" prop="requirementCode">
  18. <el-link
  19. type="primary"
  20. :underline="false"
  21. @click="openDetail(form)"
  22. >
  23. {{ form.requirementCode }}
  24. </el-link>
  25. <!-- {{ form.requirementCode }} -->
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="12">
  29. <el-form-item label="负责人:" prop="responsibleName">
  30. {{ detailData.responsibleName }}
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="12">
  34. <el-form-item label="需求来源类型:" prop="contactTel">
  35. {{ form.sourceType }}
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="12">
  39. <el-form-item label="需求部门:" prop="requireDeptName">
  40. {{ detailData.requireDeptName }}
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="12">
  44. <el-form-item label="需求人:" prop="requireUserName">
  45. {{ form.requireUserName }}
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="12">
  49. <el-form-item prop="remark" label="是否接受拆单:">
  50. {{
  51. form.acceptUnpack === 1
  52. ? '接受'
  53. : form.acceptUnpack === 1
  54. ? '不接受'
  55. : ''
  56. }}
  57. </el-form-item>
  58. </el-col>
  59. <!-- <el-col :span="12">
  60. <el-form-item
  61. label="用途"
  62. prop="requireUserName"
  63. style="margin-bottom: 22px"
  64. >
  65. {{ form.requireUserName }}
  66. </el-form-item>
  67. </el-col> -->
  68. <el-col :span="12">
  69. <el-form-item label="完结日期:" prop="receiveDate">
  70. {{ form.receiveDate }}
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="12">
  74. <el-form-item prop="remark" label="备注:">
  75. {{ form.remark }}
  76. </el-form-item>
  77. </el-col>
  78. <el-col :span="12">
  79. <el-form-item prop="askFile" label="附件:">
  80. <el-link
  81. v-if="form.files && form.files !== ''"
  82. type="primary"
  83. :underline="false"
  84. @click="downloadFile(form.files)"
  85. >
  86. {{ form.files.name }}</el-link
  87. >
  88. </el-form-item>
  89. </el-col>
  90. </el-row>
  91. </el-form>
  92. <headerTitle title="计划清单" style="margin-top: 15px"></headerTitle>
  93. <ele-pro-table
  94. ref="table"
  95. :needPage="false"
  96. :columns="columns"
  97. :toolkit="[]"
  98. :datasource="detailData.detailList"
  99. row-key="id"
  100. >
  101. </ele-pro-table>
  102. </div>
  103. </template>
  104. <script>
  105. import { getplanDetail } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
  106. import { getFile } from '@/api/system/file';
  107. import dictMixins from '@/mixins/dictMixins';
  108. import { copyObj } from '@/utils/util';
  109. export default {
  110. mixins: [dictMixins],
  111. components: {},
  112. props: {
  113. businessId: {
  114. default: ''
  115. }
  116. },
  117. data() {
  118. return {
  119. visible: false,
  120. detailId: '',
  121. title: '详情',
  122. row: {},
  123. form: {},
  124. detailData: {},
  125. columns: [
  126. {
  127. width: 45,
  128. type: 'index',
  129. columnKey: 'index',
  130. align: 'center',
  131. fixed: 'left'
  132. },
  133. {
  134. width: 150,
  135. prop: 'productCategoryName',
  136. label: '分类',
  137. slot: 'productCategoryName'
  138. },
  139. {
  140. width: 140,
  141. prop: 'productCode',
  142. label: '编码',
  143. slot: 'productCode'
  144. },
  145. {
  146. width: 240,
  147. prop: 'productName',
  148. label: '名称',
  149. slot: 'productName'
  150. },
  151. {
  152. width: 150,
  153. prop: 'productBrand',
  154. label: '牌号',
  155. slot: 'productBrand'
  156. },
  157. {
  158. width: 80,
  159. prop: 'totalCount',
  160. label: '数量',
  161. slot: 'totalCount'
  162. },
  163. {
  164. width: 100,
  165. prop: 'measuringUnit',
  166. label: '单位',
  167. slot: 'measuringUnit'
  168. },
  169. {
  170. width: 130,
  171. prop: 'modelType',
  172. label: '型号',
  173. slot: 'modelType'
  174. },
  175. {
  176. width: 120,
  177. prop: 'specification',
  178. label: '规格',
  179. slot: 'specification'
  180. },
  181. // {
  182. // width: 130,
  183. // prop: 'modelType',
  184. // label: '品牌',
  185. // slot: 'modelType'
  186. // },
  187. {
  188. width: 170,
  189. prop: 'receiveDate',
  190. label: '到货日期',
  191. slot: 'receiveDate'
  192. },
  193. {
  194. width: 140,
  195. prop: 'files',
  196. label: '附件',
  197. slot: 'files'
  198. },
  199. {
  200. width: 220,
  201. prop: 'remark',
  202. label: '备注',
  203. slot: 'remark'
  204. }
  205. ]
  206. };
  207. },
  208. created() {
  209. this.getPlanData(this.businessId);
  210. },
  211. methods: {
  212. downloadFile(file) {
  213. getFile({ objectName: file.storePath }, file.name);
  214. },
  215. async getPlanData(id) {
  216. this.loading = true;
  217. const data = await getplanDetail(id);
  218. this.loading = false;
  219. if (data) {
  220. this.detailData = data;
  221. this.form = data;
  222. if (data.files && data.files.length > 0) {
  223. this.form.files = data.files[0];
  224. } else {
  225. this.form.files = null;
  226. }
  227. }
  228. },
  229. //查看详情
  230. openDetail(row) {
  231. console.log(row);
  232. this.$refs.contactDetailDialogRef.open(row);
  233. }
  234. }
  235. };
  236. </script>
  237. <style scoped lang="scss">
  238. .ele-dialog-form {
  239. .el-form-item {
  240. margin-bottom: 10px;
  241. }
  242. }
  243. .headbox {
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. .amount {
  248. font-size: 14px;
  249. font-weight: bold;
  250. }
  251. }
  252. </style>