detailDialog.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. v-if="visible"
  6. :visible.sync="visible"
  7. :title="title"
  8. :close-on-click-modal="false"
  9. :model="isModal"
  10. width="70%"
  11. @close="cancel"
  12. >
  13. <div class="switch">
  14. <div class="switch_left">
  15. <ul>
  16. <li
  17. v-for="item in tabOptions"
  18. :key="item.key"
  19. :class="{ active: activeComp == item.key }"
  20. @click="activeComp = item.key"
  21. >
  22. {{ item.name }}
  23. </li>
  24. </ul>
  25. </div>
  26. </div>
  27. <div v-if="activeComp == 'main'">
  28. <el-form ref="form" :model="form" label-width="120px" class="el-form-box">
  29. <headerTitle title="基本信息">
  30. <!-- <el-button
  31. size="small"
  32. type="primary"
  33. icon="el-icon-s-grid"
  34. class="ele-btn-icon"
  35. @click="exportTable"
  36. >
  37. 导出
  38. </el-button> -->
  39. </headerTitle>
  40. <el-row>
  41. <el-col :span="8">
  42. <el-form-item label="采购计划单名称:" class="form_item_label" prop="planName">
  43. <el-input v-model="form.planName" disabled>
  44. <template slot="append" v-if="form.planName">
  45. <el-button type="primary" @click="openPlanDetail(form)" title="查看详情" icon="el-icon-view"></el-button>
  46. </template>
  47. </el-input>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="8">
  51. <el-form-item label="询价单名称:" prop="inquiryName">
  52. <el-input v-model="form.inquiryName" disabled></el-input>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="8">
  56. <el-form-item prop="acceptUnpack" label="是否接受拆单:">
  57. <el-select v-model="form.acceptUnpack" placeholder="请选择" disabled style="width: 100%">
  58. <el-option label="接受" :value="1"></el-option>
  59. <el-option label="不接受" :value="0"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. </el-col>
  63. </el-row>
  64. <el-row>
  65. <el-col :span="8">
  66. <el-form-item prop="remark" label="备注:">
  67. <el-input type="textarea" v-model="form.remark" disabled></el-input>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="8">
  71. <el-form-item prop="askFile" label="附件:">
  72. <fileMain v-model="form.files" type="view"></fileMain>
  73. <!-- <el-link-->
  74. <!-- v-if="form.files && form.files !== ''"-->
  75. <!-- type="primary"-->
  76. <!-- :underline="false"-->
  77. <!-- @click="downloadFile(form.files)">-->
  78. <!-- {{ form.files.name }}</el-link>-->
  79. </el-form-item>
  80. </el-col>
  81. </el-row>
  82. </el-form>
  83. <headerTitle title="产品清单" style="margin-top: 15px"></headerTitle>
  84. <ele-pro-table
  85. ref="table"
  86. :needPage="false"
  87. :columns="columns"
  88. :toolkit="[]"
  89. :datasource="form.detailList"
  90. row-key="id"
  91. >
  92. <template v-slot:files="{ row }">
  93. <fileMain v-model="row.files" type="view"></fileMain>
  94. <!-- <div v-if="row.files && row.files?.length">-->
  95. <!-- <el-link-->
  96. <!-- v-for="link in row.files"-->
  97. <!-- :key="link.id"-->
  98. <!-- type="primary"-->
  99. <!-- :underline="false"-->
  100. <!-- @click="downloadFile(link)"-->
  101. <!-- >-->
  102. <!-- {{ link.name }}</el-link-->
  103. <!-- >-->
  104. <!-- </div>-->
  105. </template>
  106. </ele-pro-table>
  107. <headerTitle title="报价清单" style="margin-top: 15px"></headerTitle>
  108. <inquiryTable
  109. :radio="form.winnerId"
  110. v-for="item in form.supplierList"
  111. :key="item.supplierId"
  112. style="margin-top: 15px"
  113. status="Detail"
  114. :obj="item"
  115. ></inquiryTable>
  116. </div>
  117. <bpmDetail
  118. v-if="activeComp === 'bpm' && form.processInstanceId"
  119. :id="form.processInstanceId"
  120. ></bpmDetail>
  121. <div slot="footer" class="footer">
  122. <el-button @click="cancel">返回</el-button>
  123. </div>
  124. <planDetaillog ref="planDetaillogRef" :isModal="false"></planDetaillog>
  125. </ele-modal>
  126. </template>
  127. <script>
  128. import { getpurchaseinquiry } from '@/api/purchasingManage/inquiryManage';
  129. import { getFile } from '@/api/system/file';
  130. import dictMixins from '@/mixins/dictMixins';
  131. import { copyObj } from '@/utils/util';
  132. import inquiryTable from './inquiryTable.vue';
  133. import planDetaillog from '../../../purchasingManage/purchasePlanManage/components/detailDialog.vue';
  134. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  135. import fileMain from "@/components/addDoc/index.vue";
  136. export default {
  137. mixins: [dictMixins],
  138. components: {
  139. fileMain,
  140. inquiryTable,
  141. planDetaillog,bpmDetail
  142. },
  143. props: {
  144. isModal: {
  145. default: true
  146. }
  147. },
  148. data() {
  149. return {
  150. activeComp: 'main',
  151. tabOptions: [
  152. { key: 'main', name: '核价单详情' },
  153. { key: 'bpm', name: '流程详情' }
  154. ],
  155. visible: false,
  156. title: '详情',
  157. row: {},
  158. form: {},
  159. detailData: {},
  160. inventoryList: [],
  161. columns: [
  162. {
  163. width: 45,
  164. type: 'index',
  165. columnKey: 'index',
  166. align: 'center',
  167. fixed: 'left'
  168. },
  169. {
  170. minWidth: 100,
  171. label: '状态',
  172. fixed: 'left',
  173. formatter: (row, column) => {
  174. return row.isInquiry==1?'已核价':'未核价'
  175. },
  176. align: 'center'
  177. },
  178. {
  179. minWidth: 100,
  180. prop: 'productCategoryName',
  181. label: '分类',
  182. slot: 'productCategoryName',
  183. align: 'center',
  184. showOverflowTooltip: true,
  185. },
  186. {
  187. minWidth: 120,
  188. prop: 'productCode',
  189. label: '编码',
  190. slot: 'productCode',
  191. showOverflowTooltip: true,
  192. align: 'center',
  193. },
  194. {
  195. minWidth: 120,
  196. prop: 'productName',
  197. label: '名称',
  198. slot: 'productName',
  199. showOverflowTooltip: true,
  200. align: 'center',
  201. },
  202. {
  203. minWidth: 80,
  204. prop: 'productBrand',
  205. label: '牌号',
  206. slot: 'productBrand',
  207. showOverflowTooltip: true,
  208. align: 'center',
  209. },
  210. {
  211. minWidth: 80,
  212. prop: 'totalCount',
  213. label: '数量',
  214. slot: 'totalCount',
  215. showOverflowTooltip: true,
  216. align: 'center',
  217. },
  218. {
  219. width: 120,
  220. prop: 'totalWeight',
  221. label: '重量',
  222. slot: 'totalWeight',
  223. align: 'center'
  224. },
  225. {
  226. minWidth: 80,
  227. prop: 'measuringUnit',
  228. label: '单位',
  229. slot: 'measuringUnit',
  230. showOverflowTooltip: true,
  231. align: 'center',
  232. },
  233. {
  234. minWidth: 120,
  235. prop: 'modelType',
  236. label: '型号',
  237. slot: 'modelType',
  238. showOverflowTooltip: true,
  239. align: 'center',
  240. },
  241. {
  242. minWidth: 120,
  243. prop: 'specification',
  244. label: '规格',
  245. slot: 'specification',
  246. showOverflowTooltip: true,
  247. align: 'center',
  248. },
  249. // {
  250. // width: 130,
  251. // prop: 'modelType',
  252. // label: '品牌',
  253. // slot: 'modelType'
  254. // },
  255. {
  256. minWidth: 170,
  257. prop: 'expectReceiveDate',
  258. label: '到货日期',
  259. slot: 'expectReceiveDate',
  260. showOverflowTooltip: true,
  261. align: 'center',
  262. },
  263. {
  264. minWidth: 140,
  265. prop: 'files',
  266. label: '附件',
  267. slot: 'files',
  268. align: 'center',
  269. },
  270. {
  271. minWidth: 220,
  272. prop: 'remark',
  273. label: '备注',
  274. slot: 'remark',
  275. showOverflowTooltip: true,
  276. align: 'center',
  277. }
  278. ]
  279. };
  280. },
  281. methods: {
  282. // //导出
  283. // async exportTable() {
  284. // this.loading = true;
  285. // const response = await getExport(this.detailId);
  286. // },
  287. async open(row) {
  288. this.visible = true;
  289. this.getInquiryData(row.id);
  290. this.detailId = row.id;
  291. },
  292. cancel() {
  293. this.$nextTick(() => {
  294. // 关闭后,销毁所有的表单数据
  295. (this.form = {}),
  296. (this.otherForm = copyObj(this.otherFormDef)),
  297. (this.tableBankData = []);
  298. this.tableLinkData = [];
  299. this.visible = false;
  300. });
  301. },
  302. downloadFile(file) {
  303. getFile({ objectName: file.storePath }, file.name);
  304. },
  305. async getInquiryData(id) {
  306. this.loading = true;
  307. const data = await getpurchaseinquiry(id);
  308. this.loading = false;
  309. if (data) {
  310. this.form = data;
  311. if (data.files && data.files.length > 0) {
  312. this.form.files = data.files[0];
  313. } else {
  314. this.form.files = null;
  315. }
  316. }
  317. // await this.getDetailData(data.requirementId);
  318. },
  319. //查看详情
  320. openPlanDetail(row) {
  321. this.$refs.planDetaillogRef.open(row);
  322. }
  323. // //获取需求详情
  324. // async getDetailData(id) {
  325. // this.loading = true;
  326. // let data = await getDetail(id);
  327. // this.loading = false;
  328. // if (data) {
  329. // this.$nextTick(() => {
  330. // this.inventoryList = copyObj(data.detailList);
  331. // });
  332. // }
  333. // }
  334. }
  335. };
  336. </script>
  337. <style scoped lang="scss">
  338. .ele-dialog-form {
  339. .el-form-item {
  340. margin-bottom: 10px;
  341. }
  342. }
  343. .headbox {
  344. display: flex;
  345. justify-content: space-between;
  346. align-items: center;
  347. .amount {
  348. font-size: 14px;
  349. font-weight: bold;
  350. }
  351. }
  352. </style>