detailDialog.vue 6.7 KB

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