detailDialog.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  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. :append-to-body="true"
  9. :close-on-click-modal="false"
  10. :maxable="true"
  11. :resizable="true"
  12. width="70%"
  13. @close="cancel"
  14. >
  15. <div class="switch">
  16. <div class="switch_left">
  17. <ul>
  18. <li
  19. v-for="item in tabOptions"
  20. :key="item.key"
  21. :class="{ active: activeComp == item.key }"
  22. @click="activeComp = item.key"
  23. >
  24. {{ item.name }}
  25. </li>
  26. </ul>
  27. </div>
  28. </div>
  29. <div v-show="activeComp === 'main'">
  30. <el-form
  31. ref="form"
  32. :model="form"
  33. :rules="rules"
  34. label-width="120px"
  35. class="el-form-box"
  36. >
  37. <headerTitle title="基本信息">
  38. <el-button
  39. size="small"
  40. type="primary"
  41. icon="el-icon-view"
  42. class="ele-btn-icon"
  43. @click="previewModal"
  44. >
  45. 预览
  46. </el-button>
  47. <el-button
  48. size="small"
  49. type="primary"
  50. icon="el-icon-s-grid"
  51. class="ele-btn-icon"
  52. @click="exportTable"
  53. >
  54. 导出
  55. </el-button>
  56. </headerTitle>
  57. <el-row gutter="12">
  58. <el-col :span="8">
  59. <el-form-item label="关联商机名称" prop="opportunityName">
  60. <el-input
  61. v-model="detailData.opportunityName"
  62. disabled
  63. ></el-input>
  64. </el-form-item>
  65. <el-form-item label="询价方名称" prop="contactName">
  66. <el-input v-model="form.contactName" disabled></el-input>
  67. </el-form-item>
  68. <el-form-item label="询价方联系人" prop="contactLinkName">
  69. <el-input v-model="form.contactLinkName" disabled></el-input>
  70. </el-form-item>
  71. <el-form-item label="询价方电话" prop="contactTel">
  72. <el-input v-model="form.contactTel" disabled></el-input>
  73. </el-form-item>
  74. <el-form-item label="询价方传真" prop="contactFax">
  75. <el-input v-model="form.contactFax" disabled></el-input>
  76. </el-form-item>
  77. <el-form-item label="询价方Email" prop="contactEmail">
  78. <el-input v-model="form.contactEmail" disabled></el-input>
  79. </el-form-item>
  80. <el-form-item label="询价方地址" prop="contactAddress">
  81. <el-input v-model="form.contactAddress" disabled></el-input>
  82. </el-form-item>
  83. <el-form-item label="创建人" prop="createUserName">
  84. <el-input v-model="form.createUserName" disabled></el-input>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. <el-form-item label="报价方名称" prop="quoteName">
  89. <el-input v-model="form.quoteName" disabled></el-input>
  90. </el-form-item>
  91. <el-form-item label="报价方联系人" prop="quoteLinkName">
  92. <el-input v-model="form.quoteLinkName" disabled></el-input>
  93. </el-form-item>
  94. <el-form-item prop="quoteTel" label="报价方联系电话">
  95. <el-input v-model="form.quoteTel" disabled></el-input>
  96. </el-form-item>
  97. <el-form-item prop="quoteFax" label="报价方传真">
  98. <el-input v-model="form.quoteFax" disabled></el-input>
  99. </el-form-item>
  100. <el-form-item label="报价方Email" prop="quoteEmail">
  101. <el-input v-model="form.quoteEmail" disabled></el-input>
  102. </el-form-item>
  103. <el-form-item label="报价方地址" prop="quoteAddress">
  104. <el-input v-model="form.quoteAddress" disabled></el-input>
  105. </el-form-item>
  106. <el-form-item prop="askFile" label="附件">
  107. <fileMain v-model="form.askFile" type="view"></fileMain>
  108. </el-form-item>
  109. <el-form-item label="创建时间" prop="createTime">
  110. <el-input v-model="form.createTime" disabled></el-input>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="8">
  114. <el-form-item label="总价" prop="totalPrice">
  115. <el-input v-model="form.totalPrice" disabled></el-input>
  116. </el-form-item>
  117. <el-form-item prop="totalCount" label="总数量">
  118. <el-input v-model="form.totalCount" disabled></el-input>
  119. </el-form-item>
  120. <el-form-item prop="totalWeight" label=" 总重">
  121. <el-input v-model="form.totalWeight" disabled></el-input>
  122. </el-form-item>
  123. <el-form-item label="结算方式" prop="payWay">
  124. <el-input v-model="form.settlementModeName" disabled></el-input>
  125. </el-form-item>
  126. <el-form-item label="是否接受拆单" prop="acceptUnpack">
  127. <el-select
  128. v-model="form.acceptUnpack"
  129. placeholder="请选择"
  130. style="width: 100%"
  131. disabled
  132. >
  133. <el-option
  134. v-for="item in acceptUnpackoptions"
  135. :key="item.value"
  136. :label="item.label"
  137. :value="item.value"
  138. >
  139. </el-option>
  140. </el-select>
  141. </el-form-item>
  142. </el-col>
  143. </el-row>
  144. <headerTitle title="报价单物品清单"></headerTitle>
  145. <inventoryTabledetail
  146. :isCustomerMark="false"
  147. ref="inventoryTabledetailRef"
  148. :isDiscount="false"
  149. :cacheKeyUrl="cacheKeyUrl"
  150. ></inventoryTabledetail>
  151. </el-form>
  152. </div>
  153. <bpmDetail
  154. v-if="activeComp === 'bpm' && form.processInstanceId"
  155. :id="form.processInstanceId"
  156. ></bpmDetail>
  157. <div slot="footer" class="footer">
  158. <el-button @click="cancel">返回</el-button>
  159. </div>
  160. <ele-modal
  161. custom-class="ele-dialog-form long-dialog-form"
  162. :centered="true"
  163. v-if="previewvisible"
  164. :visible.sync="previewvisible"
  165. title="报价单预览"
  166. :append-to-body="true"
  167. :close-on-click-modal="false"
  168. :maxable="true"
  169. :resizable="true"
  170. width="60%"
  171. @close="previewvisible = false"
  172. >
  173. <div class="quotation-preview">
  174. <!-- 1. 报价单标题 -->
  175. <div class="quotation-title">报价单</div>
  176. <!-- 2. 询价方&报价方信息表格 -->
  177. <table class="info-table">
  178. <tbody>
  179. <tr>
  180. <td class="label">询价方(公司名称):</td>
  181. <td>{{ detailData.opportunityName || form.contactName }}</td>
  182. <td class="label">报价方(公司名称):</td>
  183. <td>{{ form.quoteName }}</td>
  184. </tr>
  185. <tr>
  186. <td class="label">联系人:</td>
  187. <td>{{ form.contactLinkName }}</td>
  188. <td class="label">授权议价人:</td>
  189. <td>{{ form.quoteLinkName }}</td>
  190. </tr>
  191. <tr>
  192. <td class="label">电 话:</td>
  193. <td>{{ form.contactTel }}</td>
  194. <td class="label">电 话:</td>
  195. <td>{{ form.quoteTel }}</td>
  196. </tr>
  197. <tr>
  198. <td class="label">传 真:</td>
  199. <td>{{ form.contactFax }}</td>
  200. <td class="label">传 真:</td>
  201. <td>{{ form.quoteFax }}</td>
  202. </tr>
  203. <tr>
  204. <td class="label">E-mail:</td>
  205. <td>{{ form.contactEmail }}</td>
  206. <td class="label">E-mail:</td>
  207. <td>{{ form.quoteEmail }}</td>
  208. </tr>
  209. <tr>
  210. <td class="label">地 址:</td>
  211. <td>{{ form.contactAddress }}</td>
  212. <td class="label">地 址:</td>
  213. <td>{{ form.quoteAddress }}</td>
  214. </tr>
  215. </tbody>
  216. </table>
  217. <!-- 3. 物品清单表格 -->
  218. <div class="inventory-table-wrap">
  219. <table class="inventory-table">
  220. <thead>
  221. <tr>
  222. <th>序号</th>
  223. <th>物料编码</th>
  224. <th>名称</th>
  225. <th>型号</th>
  226. <th>数量</th>
  227. <th>单位</th>
  228. <th>单价(元)</th>
  229. <th>总价(元)</th>
  230. <th>技术答疑人</th>
  231. <th>技术参数(g/cm³)</th>
  232. <th>质保期(月)</th>
  233. <th>交期(天)</th>
  234. <th>备注</th>
  235. </tr>
  236. </thead>
  237. <tbody>
  238. <tr v-for="(item, idx) in inventoryTableData" :key="idx">
  239. <td>{{ idx + 1 }}</td>
  240. <td>{{ item.productCode }}</td>
  241. <td>{{ item.productName }}</td>
  242. <td>{{ item.modelType }}</td>
  243. <td>{{ item.totalCount }}</td>
  244. <td>{{ item.measuringUnit }}</td>
  245. <td>{{ item.singlePrice }}</td>
  246. <td>{{ item.totalPrice }}</td>
  247. <td>{{ item.technicalAnswerName }}</td>
  248. <td>{{ item.technicalParams }}</td>
  249. <td
  250. >{{ item.guaranteePeriod
  251. }}{{ item.guaranteePeriodUnitName }}</td
  252. >
  253. <td>{{ item.deliveryDays }}</td>
  254. <td>{{ item.remark }}</td>
  255. </tr>
  256. </tbody>
  257. </table>
  258. </div>
  259. <!-- 4. 合计 -->
  260. <div class="total-amount">合计:{{ form.totalPrice || '0.00' }}</div>
  261. <!-- 5. 备注 -->
  262. <div class="quotation-remark">
  263. 备注:1、以上报价为含《增值税票价、含运费》;2、交货期:双方协商;3、报价有效期
  264. 30 天
  265. </div>
  266. <!-- 6. 交货期/付款方式/拆单 -->
  267. <table class="footer-info-table">
  268. <tbody>
  269. <tr>
  270. <td class="label">*交货期</td>
  271. <td>{{ form.deliveryDate || '协商确定' }}</td>
  272. <td class="label">付款方式</td>
  273. <td>{{ form.settlementModeName || '协商确定' }}</td>
  274. <td class="label">*是否接受拆单</td>
  275. <td>{{ form.acceptUnpack == '1' ? '是' : '否' }}</td>
  276. </tr>
  277. </tbody>
  278. </table>
  279. <!-- 7. 报价说明 -->
  280. <div class="quote-description">
  281. 报价为含税(%)含运费/保险在内的到厂交货价。
  282. </div>
  283. <!-- 8. 报价单位&日期&保存期限 -->
  284. <div class="quote-footer">
  285. 报价单位:盖章处
  286. <span class="quote-date"
  287. >日期:{{ form.createTime.split(' ')[0] }}</span
  288. >
  289. <span class="save-term">保存期限:3年</span>
  290. </div>
  291. </div>
  292. <div slot="footer" class="footer">
  293. <el-button
  294. size="small"
  295. type="primary"
  296. icon="el-icon-s-grid"
  297. class="ele-btn-icon"
  298. @click="exportTable"
  299. >
  300. 导出
  301. </el-button>
  302. <el-button @click="previewvisible = false">返回</el-button>
  303. </div>
  304. </ele-modal>
  305. </ele-modal>
  306. </template>
  307. <script>
  308. import { getDetail, exportByPathId } from '@/api/saleManage/quotation';
  309. import { getFile } from '@/api/system/file';
  310. import dictMixins from '@/mixins/dictMixins';
  311. import { copyObj } from '@/utils/util';
  312. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  313. import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
  314. import { acceptUnpackoptions } from '@/enum/dict';
  315. // import fileMain from '@/components/addDoc/index.vue';
  316. export default {
  317. mixins: [dictMixins],
  318. components: {
  319. bpmDetail,
  320. inventoryTabledetail
  321. // fileMain
  322. },
  323. data() {
  324. return {
  325. fullscreen: false,
  326. cacheKeyUrl: 'eos-saleManage-quotation-inventoryTableDetails',
  327. activeComp: 'main',
  328. tabOptions: [
  329. { key: 'main', name: '报价详情' },
  330. { key: 'bpm', name: '流程详情' }
  331. ],
  332. visible: false,
  333. detailId: '',
  334. title: '详情',
  335. row: {},
  336. activeName: 'base',
  337. form: {},
  338. rules: {},
  339. detailData: {},
  340. acceptUnpackoptions,
  341. previewvisible: false,
  342. inventoryTableData: [],
  343. competAnalysisListcolumns: [
  344. {
  345. width: 45,
  346. type: 'index',
  347. columnKey: 'index',
  348. align: 'center',
  349. fixed: 'left'
  350. },
  351. {
  352. width: 200,
  353. prop: 'productName',
  354. label: '名称',
  355. slot: 'productName'
  356. },
  357. {
  358. width: 120,
  359. prop: 'productCode',
  360. label: '编码',
  361. slot: 'productCode'
  362. },
  363. {
  364. width: 200,
  365. prop: 'productCategoryName',
  366. label: '类型',
  367. slot: 'productCategoryName'
  368. },
  369. {
  370. width: 160,
  371. prop: 'productBrand',
  372. label: '牌号',
  373. slot: 'productBrand'
  374. },
  375. {
  376. width: 120,
  377. prop: 'modelType',
  378. label: '型号',
  379. slot: 'modelType'
  380. },
  381. {
  382. width: 120,
  383. prop: 'specification',
  384. label: '规格',
  385. slot: 'specification'
  386. },
  387. {
  388. width: 160,
  389. prop: 'singlePrice',
  390. label: '单价',
  391. slot: 'singlePrice'
  392. },
  393. {
  394. width: 120,
  395. prop: 'totalCount',
  396. label: '数量',
  397. slot: 'totalCount'
  398. },
  399. {
  400. width: 120,
  401. prop: 'totalPrice',
  402. label: '销售总金额',
  403. slot: 'totalPrice',
  404. formatter: (_row, _column, cellValue) => {
  405. return _row.totalPrice + '元';
  406. }
  407. },
  408. {
  409. width: 120,
  410. prop: 'measuringUnit',
  411. label: '计量单位',
  412. slot: 'measuringUnit'
  413. },
  414. {
  415. width: 120,
  416. prop: 'deliveryDays',
  417. label: '交期(天)',
  418. slot: 'deliveryDays'
  419. },
  420. {
  421. width: 200,
  422. prop: 'guaranteePeriod',
  423. label: '有效期',
  424. slot: 'guaranteePeriod',
  425. formatter: (_row, _column, cellValue) => {
  426. return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
  427. }
  428. },
  429. // {
  430. // width: 120,
  431. // prop: 'guaranteePeriodUnitCode',
  432. // label: '',
  433. // slot: 'guaranteePeriodUnitCode'
  434. // },
  435. {
  436. width: 240,
  437. prop: 'customerReqFiles',
  438. label: '客户需求',
  439. slot: 'customerReqFiles'
  440. },
  441. {
  442. width: 120,
  443. prop: 'technicalAnswerName',
  444. label: '技术答疑人',
  445. slot: 'technicalAnswerName'
  446. },
  447. {
  448. width: 220,
  449. prop: 'technicalParams',
  450. label: '技术参数',
  451. slot: 'technicalParams'
  452. },
  453. {
  454. width: 240,
  455. prop: 'technicalDrawings',
  456. label: '技术图纸',
  457. slot: 'technicalDrawings',
  458. formatter: (_row, _column, cellValue) => {
  459. return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
  460. }
  461. },
  462. {
  463. width: 220,
  464. prop: 'remark',
  465. label: '备注',
  466. slot: 'remark'
  467. }
  468. ]
  469. };
  470. },
  471. methods: {
  472. //导出
  473. async exportTable() {
  474. const response = await exportByPathId(this.detailId);
  475. },
  476. previewModal() {
  477. this.previewvisible = true;
  478. this.inventoryTableData =
  479. this.$refs.inventoryTabledetailRef.form.datasource;
  480. },
  481. async open(row) {
  482. this.form = row;
  483. this.visible = true;
  484. this.getDetailData(row.id);
  485. this.detailId = row.id;
  486. },
  487. cancel() {
  488. this.$nextTick(() => {
  489. // 关闭后,销毁所有的表单数据
  490. (this.form = copyObj(this.formDef)),
  491. (this.otherForm = copyObj(this.otherFormDef)),
  492. (this.tableBankData = []);
  493. this.tableLinkData = [];
  494. this.visible = false;
  495. });
  496. },
  497. downloadFile(file) {
  498. getFile({ objectName: file.storePath }, file.name);
  499. },
  500. async getDetailData(id) {
  501. this.loading = true;
  502. const data = await getDetail(id);
  503. this.loading = false;
  504. if (data) {
  505. this.detailData = data;
  506. this.$nextTick(() => {
  507. this.$refs.inventoryTabledetailRef &&
  508. this.$refs.inventoryTabledetailRef.putTableValue(data);
  509. });
  510. }
  511. }
  512. }
  513. };
  514. </script>
  515. <style scoped lang="scss">
  516. .ele-dialog-form {
  517. .el-form-item {
  518. margin-bottom: 10px;
  519. }
  520. }
  521. .headbox {
  522. display: flex;
  523. justify-content: space-between;
  524. align-items: center;
  525. .amount {
  526. font-size: 14px;
  527. font-weight: bold;
  528. }
  529. }
  530. </style>
  531. <style scoped lang="scss">
  532. .quotation-preview {
  533. font-family: 'Microsoft Yahei', sans-serif;
  534. // 标题
  535. .quotation-title {
  536. font-size: 24px;
  537. font-weight: bold;
  538. text-align: center;
  539. }
  540. // 信息表格(询价方、报价方)
  541. .info-table {
  542. width: 100%;
  543. border-collapse: collapse;
  544. font-size: 12px;
  545. th,
  546. td {
  547. border: 2px solid #2c2c2c;
  548. padding: 5px;
  549. text-align: left;
  550. }
  551. .label {
  552. font-weight: bold;
  553. }
  554. }
  555. // 物品清单表格
  556. .inventory-table-wrap {
  557. .inventory-table {
  558. width: 100%;
  559. border-collapse: collapse;
  560. th {
  561. font-weight: bold;
  562. border: 2px solid #2c2c2c;
  563. border-top: none;
  564. padding: 5px;
  565. text-align: center;
  566. }
  567. td {
  568. border: 2px solid #2c2c2c;
  569. border-top: none;
  570. padding: 5px;
  571. text-align: center;
  572. }
  573. }
  574. }
  575. // 合计
  576. .total-amount {
  577. text-align: center;
  578. padding: 5px;
  579. border: 2px solid #2c2c2c;
  580. border-top: none;
  581. font-weight: bold;
  582. }
  583. // 备注
  584. .quotation-remark {
  585. line-height: 1.5;
  586. text-align: center;
  587. border: 2px solid #2c2c2c;
  588. border-top: none;
  589. padding: 5px;
  590. }
  591. // 底部信息表格(交货期、付款方式等)
  592. .footer-info-table {
  593. width: 100%;
  594. border-collapse: collapse;
  595. .label {
  596. font-weight: bold;
  597. }
  598. td {
  599. border: 2px solid #2c2c2c;
  600. border-top: none;
  601. padding: 5px;
  602. text-align: center;
  603. }
  604. }
  605. // 报价说明
  606. .quote-description {
  607. line-height: 1.5;
  608. border: 2px solid #2c2c2c;
  609. border-top: none;
  610. padding: 5px;
  611. text-align: center;
  612. }
  613. // 报价单位、日期、保存期限
  614. .quote-footer {
  615. display: flex;
  616. justify-content: flex-end;
  617. align-items: center;
  618. margin-top: 24px;
  619. .seal-area {
  620. border: 1px solid #000;
  621. padding: 4px 12px;
  622. margin-right: 24px;
  623. }
  624. .quote-date,
  625. .save-term {
  626. margin-left: 24px;
  627. }
  628. }
  629. }
  630. </style>