detailDialog.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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. <fileMain v-model="form.files" type="view"></fileMain>
  75. <!-- <el-link-->
  76. <!-- v-if="form.files && form.files !== ''"-->
  77. <!-- type="primary"-->
  78. <!-- :underline="false"-->
  79. <!-- @click="downloadFile(form.files)"-->
  80. <!-- >-->
  81. <!-- {{ form.files.name }}</el-link-->
  82. <!-- >-->
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. </el-form>
  87. <headerTitle title="需求清单"></headerTitle>
  88. <ele-pro-table
  89. ref="table"
  90. :needPage="false"
  91. :columns="columns"
  92. :toolkit="[]"
  93. :datasource="detailData.detailList"
  94. row-key="id"
  95. >
  96. <template v-slot:files="{ row }">
  97. <fileMain v-model="row.files" type="view"></fileMain>
  98. <!-- <div v-if="row.files && row.files?.length">-->
  99. <!-- <el-link-->
  100. <!-- v-for="link in row.files"-->
  101. <!-- :key="link.id"-->
  102. <!-- type="primary"-->
  103. <!-- :underline="false"-->
  104. <!-- @click="downloadFile(link)"-->
  105. <!-- >-->
  106. <!-- {{ link.name }}</el-link-->
  107. <!-- >-->
  108. <!-- </div>-->
  109. </template>
  110. </ele-pro-table>
  111. <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
  112. </div>
  113. </template>
  114. <script>
  115. import { getDetail } from '@/api/bpm/components/purchasingManage/purchaseNeedManage';
  116. import { getFile } from '@/api/system/file';
  117. import dictMixins from '@/mixins/dictMixins';
  118. import timeDialog from '@/components/timeDialog/index.vue';
  119. import fileMain from "@/components/addDoc/index.vue";
  120. export default {
  121. props: {
  122. businessId: {
  123. default: ''
  124. }
  125. },
  126. mixins: [dictMixins],
  127. components: {
  128. fileMain,
  129. timeDialog
  130. },
  131. data() {
  132. return {
  133. visible: false,
  134. title: '详情',
  135. row: {},
  136. form: {},
  137. detailData: {},
  138. columns: [
  139. {
  140. width: 45,
  141. type: 'index',
  142. columnKey: 'index',
  143. align: 'center',
  144. fixed: 'left'
  145. },
  146. {
  147. width: 150,
  148. prop: 'productCategoryName',
  149. label: '分类',
  150. slot: 'productCategoryName',
  151. align: 'center'
  152. },
  153. {
  154. width: 140,
  155. prop: 'productCode',
  156. label: '编码',
  157. slot: 'productCode',
  158. align: 'center'
  159. },
  160. {
  161. width: 240,
  162. prop: 'productName',
  163. label: '名称',
  164. slot: 'productName',
  165. align: 'center'
  166. },
  167. {
  168. width: 150,
  169. prop: 'productBrand',
  170. label: '牌号',
  171. slot: 'productBrand',
  172. align: 'center'
  173. },
  174. {
  175. width: 80,
  176. prop: 'totalCount',
  177. label: '数量',
  178. slot: 'totalCount',
  179. align: 'center'
  180. },
  181. {
  182. minWidth: 120,
  183. prop: 'taskName',
  184. label: '工序',
  185. slot: 'taskName',
  186. align: 'center'
  187. },
  188. {
  189. width: 110,
  190. prop: 'batchNo',
  191. label: '批次号',
  192. slot: 'batchNo',
  193. align: 'center'
  194. },
  195. {
  196. prop: 'provenance',
  197. label: '产地',
  198. slot: 'provenance',
  199. align: 'center',
  200. minWidth: 200,
  201. showOverflowTooltip: true,
  202. formatter: (row, column) => {
  203. return row.provenance && row.provenance.length
  204. ? row.provenance
  205. .map((item) => this.getDictValue('产地', item ))
  206. .join(',')
  207. : '';
  208. }
  209. },
  210. {
  211. width: 100,
  212. prop: 'measuringUnit',
  213. label: '单位',
  214. slot: 'measuringUnit',
  215. align: 'center'
  216. },
  217. {
  218. width: 130,
  219. prop: 'modelType',
  220. label: '型号',
  221. slot: 'modelType',
  222. align: 'center'
  223. },
  224. {
  225. width: 120,
  226. prop: 'specification',
  227. label: '规格',
  228. slot: 'specification',
  229. align: 'center'
  230. },
  231. {
  232. width: 130,
  233. prop: 'brand',
  234. label: '品牌',
  235. slot: 'brand',
  236. align: 'center'
  237. },
  238. {
  239. width: 150,
  240. prop: 'arrivalWay',
  241. label: ' 到货方式',
  242. formatter: (row, column, cellValue) => {
  243. return cellValue == 1 ? '一次性到货' : '分批到货';
  244. },
  245. align: 'center'
  246. },
  247. {
  248. width: 170,
  249. prop: 'expectReceiveDate',
  250. label: '到货日期',
  251. slot: 'expectReceiveDate',
  252. align: 'center'
  253. },
  254. {
  255. width: 160,
  256. prop: 'technicalDrawings',
  257. label: '图纸附件',
  258. slot: 'technicalDrawings',
  259. align: 'center'
  260. },
  261. {
  262. width: 140,
  263. prop: 'files',
  264. label: '附件',
  265. slot: 'files',
  266. align: 'center'
  267. },
  268. {
  269. width: 220,
  270. prop: 'remark',
  271. label: '备注',
  272. slot: 'remark',
  273. align: 'center'
  274. }
  275. ]
  276. };
  277. },
  278. created() {
  279. this.requestDict('产地');
  280. this.getDetailData(this.businessId);
  281. },
  282. methods: {
  283. downloadFile(file) {
  284. getFile({ objectName: file.storePath }, file.name);
  285. },
  286. handleMethod(row) {
  287. this.$refs.timeDialogRef.open(row);
  288. },
  289. async getDetailData(id) {
  290. this.loading = true;
  291. const data = await getDetail(id);
  292. this.loading = false;
  293. if (data) {
  294. this.form = data;
  295. this.detailData = data;
  296. if (data.files && data.files.length > 0) {
  297. this.form.files = data.files[0];
  298. } else {
  299. this.form.files = null;
  300. }
  301. }
  302. }
  303. }
  304. };
  305. </script>
  306. <style scoped lang="scss">
  307. .ele-dialog-form {
  308. .el-form-item {
  309. margin-bottom: 10px;
  310. }
  311. }
  312. .headbox {
  313. display: flex;
  314. justify-content: space-between;
  315. align-items: center;
  316. .amount {
  317. font-size: 14px;
  318. font-weight: bold;
  319. }
  320. }
  321. </style>