detailDialog.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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. : row.isInquiry == 2
  177. ? '全部核价完成'
  178. : '未核价';
  179. },
  180. align: 'center'
  181. },
  182. {
  183. minWidth: 100,
  184. prop: 'productCategoryName',
  185. label: '分类',
  186. slot: 'productCategoryName',
  187. align: 'center',
  188. showOverflowTooltip: true,
  189. },
  190. {
  191. minWidth: 120,
  192. prop: 'productCode',
  193. label: '编码',
  194. slot: 'productCode',
  195. showOverflowTooltip: true,
  196. align: 'center',
  197. },
  198. {
  199. minWidth: 120,
  200. prop: 'productName',
  201. label: '名称',
  202. slot: 'productName',
  203. showOverflowTooltip: true,
  204. align: 'center',
  205. },
  206. {
  207. minWidth: 80,
  208. prop: 'productBrand',
  209. label: '牌号',
  210. slot: 'productBrand',
  211. showOverflowTooltip: true,
  212. align: 'center',
  213. },
  214. {
  215. minWidth: 80,
  216. prop: 'totalCount',
  217. label: '数量',
  218. slot: 'totalCount',
  219. showOverflowTooltip: true,
  220. align: 'center',
  221. },
  222. {
  223. width: 150,
  224. prop: 'inquiryNum',
  225. label: '已核价数量',
  226. align: 'center'
  227. },
  228. {
  229. width: 120,
  230. prop: 'totalWeight',
  231. label: '重量',
  232. slot: 'totalWeight',
  233. align: 'center'
  234. },
  235. {
  236. minWidth: 220,
  237. prop: 'taskName',
  238. label: '工序',
  239. slot: 'taskName',
  240. align: 'center'
  241. },
  242. {
  243. width: 110,
  244. prop: 'batchNo',
  245. label: '批次号',
  246. slot: 'batchNo',
  247. align: 'center'
  248. },
  249. {
  250. prop: 'provenance',
  251. label: '产地',
  252. slot: 'provenance',
  253. align: 'center',
  254. minWidth: 200,
  255. showOverflowTooltip: true,
  256. formatter: (row, column) => {
  257. return row.provenance && row.provenance.length
  258. ? row.provenance
  259. .map((item) => this.getDictValue('产地', item ))
  260. .join(',')
  261. : '';
  262. }
  263. },
  264. {
  265. minWidth: 80,
  266. prop: 'measuringUnit',
  267. label: '单位',
  268. slot: 'measuringUnit',
  269. showOverflowTooltip: true,
  270. align: 'center',
  271. },
  272. {
  273. minWidth: 120,
  274. prop: 'modelType',
  275. label: '型号',
  276. slot: 'modelType',
  277. showOverflowTooltip: true,
  278. align: 'center',
  279. },
  280. {
  281. minWidth: 120,
  282. prop: 'specification',
  283. label: '规格',
  284. slot: 'specification',
  285. showOverflowTooltip: true,
  286. align: 'center',
  287. },
  288. // {
  289. // width: 130,
  290. // prop: 'modelType',
  291. // label: '品牌',
  292. // slot: 'modelType'
  293. // },
  294. {
  295. minWidth: 170,
  296. prop: 'expectReceiveDate',
  297. label: '到货日期',
  298. slot: 'expectReceiveDate',
  299. showOverflowTooltip: true,
  300. align: 'center',
  301. },
  302. {
  303. minWidth: 140,
  304. prop: 'files',
  305. label: '附件',
  306. slot: 'files',
  307. align: 'center',
  308. },
  309. {
  310. minWidth: 220,
  311. prop: 'remark',
  312. label: '备注',
  313. slot: 'remark',
  314. showOverflowTooltip: true,
  315. align: 'center',
  316. }
  317. ]
  318. };
  319. },
  320. created(){
  321. this.requestDict('产地');
  322. },
  323. methods: {
  324. // //导出
  325. // async exportTable() {
  326. // this.loading = true;
  327. // const response = await getExport(this.detailId);
  328. // },
  329. async open(row) {
  330. this.visible = true;
  331. this.getInquiryData(row.id);
  332. this.detailId = row.id;
  333. },
  334. cancel() {
  335. this.$nextTick(() => {
  336. // 关闭后,销毁所有的表单数据
  337. (this.form = {}),
  338. (this.otherForm = copyObj(this.otherFormDef)),
  339. (this.tableBankData = []);
  340. this.tableLinkData = [];
  341. this.visible = false;
  342. });
  343. },
  344. downloadFile(file) {
  345. getFile({ objectName: file.storePath }, file.name);
  346. },
  347. async getInquiryData(id) {
  348. this.loading = true;
  349. const data = await getpurchaseinquiry(id);
  350. this.loading = false;
  351. if (data) {
  352. this.form = data;
  353. if (data.files && data.files.length > 0) {
  354. this.form.files = data.files[0];
  355. } else {
  356. this.form.files = null;
  357. }
  358. }
  359. // await this.getDetailData(data.requirementId);
  360. },
  361. //查看详情
  362. openPlanDetail(row) {
  363. this.$refs.planDetaillogRef.open(row);
  364. }
  365. // //获取需求详情
  366. // async getDetailData(id) {
  367. // this.loading = true;
  368. // let data = await getDetail(id);
  369. // this.loading = false;
  370. // if (data) {
  371. // this.$nextTick(() => {
  372. // this.inventoryList = copyObj(data.detailList);
  373. // });
  374. // }
  375. // }
  376. }
  377. };
  378. </script>
  379. <style scoped lang="scss">
  380. .ele-dialog-form {
  381. .el-form-item {
  382. margin-bottom: 10px;
  383. }
  384. }
  385. .headbox {
  386. display: flex;
  387. justify-content: space-between;
  388. align-items: center;
  389. .amount {
  390. font-size: 14px;
  391. font-weight: bold;
  392. }
  393. }
  394. </style>