detailDialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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. :maxable="true"
  13. :resizable="true"
  14. :append-to-body="true"
  15. >
  16. <div class="switch">
  17. <div class="switch_left">
  18. <ul>
  19. <li
  20. v-for="item in tabOptions"
  21. :key="item.key"
  22. :class="{ active: activeComp == item.key }"
  23. @click="activeComp = item.key"
  24. >
  25. {{ item.name }}
  26. </li>
  27. </ul>
  28. </div>
  29. </div>
  30. <div v-if="activeComp == 'main'">
  31. <el-form ref="form" :model="form" label-width="120px" class="el-form-box">
  32. <headerTitle title="基本信息">
  33. <!-- <el-button
  34. size="small"
  35. type="primary"
  36. icon="el-icon-s-grid"
  37. class="ele-btn-icon"
  38. @click="exportTable"
  39. >
  40. 导出
  41. </el-button> -->
  42. </headerTitle>
  43. <el-row>
  44. <el-col :span="8">
  45. <el-form-item
  46. label="采购计划单名称:"
  47. class="form_item_label"
  48. prop="planName"
  49. >
  50. <el-input v-model="form.planName" disabled>
  51. <template slot="append" v-if="form.planName">
  52. <el-button
  53. type="primary"
  54. @click="openPlanDetail(form)"
  55. title="查看详情"
  56. icon="el-icon-view"
  57. ></el-button>
  58. </template>
  59. </el-input>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="8">
  63. <el-form-item label="询价单名称:" prop="inquiryName">
  64. <el-input v-model="form.inquiryName" disabled></el-input>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="8">
  68. <el-form-item prop="acceptUnpack" label="是否接受拆单:">
  69. <el-select
  70. v-model="form.acceptUnpack"
  71. placeholder="请选择"
  72. disabled
  73. style="width: 100%"
  74. >
  75. <el-option label="接受" :value="1"></el-option>
  76. <el-option label="不接受" :value="0"></el-option>
  77. </el-select>
  78. </el-form-item>
  79. </el-col>
  80. </el-row>
  81. <el-row>
  82. <el-col :span="8">
  83. <el-form-item prop="remark" label="备注:">
  84. <el-input
  85. type="textarea"
  86. v-model="form.remark"
  87. disabled
  88. ></el-input>
  89. </el-form-item>
  90. </el-col>
  91. <el-col :span="8">
  92. <el-form-item prop="askFile" label="附件:">
  93. <fileMain v-model="form.files" type="view"></fileMain>
  94. </el-form-item>
  95. </el-col>
  96. </el-row>
  97. </el-form>
  98. <headerTitle title="物品清单" style="margin-top: 15px"></headerTitle>
  99. <ele-pro-table
  100. ref="table"
  101. :needPage="false"
  102. :columns="columns"
  103. :datasource="form.detailList"
  104. row-key="id"
  105. maxHeight="500px"
  106. @columns-change="handleColumnChange"
  107. :cache-key="cacheKeyUrl"
  108. >
  109. <template v-slot:files="{ row }">
  110. <fileMain v-model="row.files" type="view"></fileMain>
  111. </template>
  112. </ele-pro-table>
  113. <headerTitle title="报价清单" style="margin-top: 15px"></headerTitle>
  114. <inquiryTable
  115. :radio="form.winnerId"
  116. v-for="item in form.supplierList"
  117. :key="item.supplierId"
  118. style="margin-top: 15px"
  119. status="Detail"
  120. :obj="item"
  121. ></inquiryTable>
  122. </div>
  123. <bpmDetail
  124. v-if="activeComp === 'bpm' && form.processInstanceId"
  125. :id="form.processInstanceId"
  126. ></bpmDetail>
  127. <div slot="footer" class="footer">
  128. <el-button @click="cancel">返回</el-button>
  129. </div>
  130. <planDetaillog ref="planDetaillogRef" :isModal="false"></planDetaillog>
  131. </ele-modal>
  132. </template>
  133. <script>
  134. import { getpurchaseinquiry } from '@/api/purchasingManage/inquiryManage';
  135. import { getFile } from '@/api/system/file';
  136. import dictMixins from '@/mixins/dictMixins';
  137. import { copyObj } from '@/utils/util';
  138. import inquiryTable from './inquiryTable.vue';
  139. import planDetaillog from '../../../purchasingManage/purchasePlanManage/components/detailDialog.vue';
  140. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  141. // import fileMain from '@/components/addDoc/index.vue';
  142. import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
  143. import { lbjtList } from '@/enum/dict.js';
  144. import tabMixins from '@/mixins/tableColumnsMixin';
  145. export default {
  146. mixins: [dictMixins,tabMixins],
  147. components: {
  148. // fileMain,
  149. inquiryTable,
  150. planDetaillog,
  151. bpmDetail
  152. },
  153. props: {
  154. isModal: {
  155. default: true
  156. }
  157. },
  158. data() {
  159. return {
  160. cacheKeyUrl:"eom-purchasingManage-inventoryTableDetail",
  161. activeComp: 'main',
  162. tabOptions: [
  163. { key: 'main', name: '核价单详情' },
  164. { key: 'bpm', name: '流程详情' }
  165. ],
  166. visible: false,
  167. title: '详情',
  168. row: {},
  169. form: {},
  170. detailData: {},
  171. inventoryList: [],
  172. columns: [
  173. {
  174. width: 45,
  175. type: 'index',
  176. columnKey: 'index',
  177. align: 'center',
  178. fixed: 'left'
  179. },
  180. {
  181. minWidth: 100,
  182. label: '状态',
  183. fixed: 'left',
  184. formatter: (row, column) => {
  185. return row.isInquiry == 1
  186. ? '部分核价'
  187. : row.isInquiry == 2
  188. ? '全部核价完成'
  189. : row.isInquiry == 3
  190. ? '核价中'
  191. : '未核价';
  192. },
  193. align: 'center'
  194. },
  195. {
  196. minWidth: 100,
  197. prop: 'productCategoryName',
  198. label: '分类',
  199. slot: 'productCategoryName',
  200. align: 'center',
  201. showOverflowTooltip: true
  202. },
  203. {
  204. minWidth: 120,
  205. prop: 'productCode',
  206. label: '编码',
  207. slot: 'productCode',
  208. showOverflowTooltip: true,
  209. align: 'center'
  210. },
  211. {
  212. minWidth: 120,
  213. prop: 'productName',
  214. label: '名称',
  215. slot: 'productName',
  216. showOverflowTooltip: true,
  217. align: 'center'
  218. },
  219. {
  220. minWidth: 200,
  221. prop: 'supplierName',
  222. label: '供应商',
  223. showOverflowTooltip: true,
  224. align: 'center'
  225. },
  226. {
  227. minWidth: 80,
  228. prop: 'productBrand',
  229. label: '牌号',
  230. slot: 'productBrand',
  231. showOverflowTooltip: true,
  232. align: 'center'
  233. },
  234. {
  235. minWidth: 80,
  236. prop: 'totalCount',
  237. label: '数量',
  238. slot: 'totalCount',
  239. showOverflowTooltip: true,
  240. align: 'center'
  241. },
  242. {
  243. width: 150,
  244. prop: 'inquiryNum',
  245. label: '已核价数量',
  246. align: 'center'
  247. },
  248. {
  249. width: 120,
  250. prop: 'totalWeight',
  251. label: '重量',
  252. slot: 'totalWeight',
  253. align: 'center'
  254. },
  255. {
  256. minWidth: 220,
  257. prop: 'taskName',
  258. label: '工序',
  259. slot: 'taskName',
  260. align: 'center'
  261. },
  262. {
  263. width: 110,
  264. prop: 'batchNo',
  265. label: '批次号',
  266. slot: 'batchNo',
  267. align: 'center'
  268. },
  269. {
  270. prop: 'provenance',
  271. label: '产地',
  272. slot: 'provenance',
  273. align: 'center',
  274. minWidth: 200,
  275. showOverflowTooltip: true,
  276. formatter: (row, column) => {
  277. return row.provenance && row.provenance.length
  278. ? row.provenance
  279. .map((item) => this.getDictValue('产地', item))
  280. .join(',')
  281. : '';
  282. }
  283. },
  284. {
  285. minWidth: 80,
  286. prop: 'measuringUnit',
  287. label: '单位',
  288. slot: 'measuringUnit',
  289. showOverflowTooltip: true,
  290. align: 'center'
  291. },
  292. {
  293. minWidth: 120,
  294. prop: 'modelType',
  295. label: '型号',
  296. slot: 'modelType',
  297. showOverflowTooltip: true,
  298. align: 'center'
  299. },
  300. {
  301. minWidth: 120,
  302. prop: 'specification',
  303. label: '规格',
  304. slot: 'specification',
  305. showOverflowTooltip: true,
  306. align: 'center'
  307. },
  308. // {
  309. // width: 130,
  310. // prop: 'modelType',
  311. // label: '品牌',
  312. // slot: 'modelType'
  313. // },
  314. {
  315. minWidth: 170,
  316. prop: 'expectReceiveDate',
  317. label: '到货日期',
  318. slot: 'expectReceiveDate',
  319. showOverflowTooltip: true,
  320. align: 'center'
  321. },
  322. {
  323. width: 120,
  324. prop: 'produceType',
  325. align: 'center',
  326. label: '属性类型',
  327. showOverflowTooltip: true,
  328. formatter: (row, column) => {
  329. if (row.produceType) {
  330. return row.produceType
  331. .map((item) => {
  332. return lbjtList[item];
  333. })
  334. .toString();
  335. }
  336. }
  337. },
  338. {
  339. minWidth: 120,
  340. prop: 'packingSpecification',
  341. align: 'center',
  342. label: '包装规格',
  343. showOverflowTooltip: true
  344. },
  345. {
  346. minWidth: 140,
  347. prop: 'files',
  348. label: '附件',
  349. slot: 'files',
  350. align: 'center'
  351. },
  352. {
  353. minWidth: 220,
  354. prop: 'remark',
  355. label: '备注',
  356. slot: 'remark',
  357. showOverflowTooltip: true,
  358. align: 'center'
  359. }
  360. ]
  361. };
  362. },
  363. created() {
  364. this.requestDict('产地');
  365. this.requestDict('质保期单位');
  366. this.requestDict('生产类型');
  367. this.requestDict('结算方式');
  368. },
  369. methods: {
  370. // //导出
  371. // async exportTable() {
  372. // this.loading = true;
  373. // const response = await getExport(this.detailId);
  374. // },
  375. async open(row) {
  376. this.visible = true;
  377. this.getInquiryData(row.id);
  378. this.detailId = row.id;
  379. },
  380. cancel() {
  381. this.$nextTick(() => {
  382. // 关闭后,销毁所有的表单数据
  383. (this.form = {}),
  384. (this.otherForm = copyObj(this.otherFormDef)),
  385. (this.tableBankData = []);
  386. this.tableLinkData = [];
  387. this.visible = false;
  388. });
  389. },
  390. downloadFile(file) {
  391. getFile({ objectName: file.storePath }, file.name);
  392. },
  393. async getInquiryData(id) {
  394. this.loading = true;
  395. const data = await getpurchaseinquiry(id);
  396. this.loading = false;
  397. if (data) {
  398. let categoryIds = data.detailList.map((item) => item.productId);
  399. let supplierObj = await contactQueryByCategoryIdsAPI({ categoryIds });
  400. data.detailList.forEach((item) => {
  401. if (supplierObj[item.productId]) {
  402. item.supplierName = supplierObj[item.productId]
  403. .filter((val) => item.supplierIds.includes(val.id))
  404. .map((val1) => val1.name)
  405. .toString();
  406. }
  407. });
  408. this.form = data;
  409. if (data.files && data.files.length > 0) {
  410. this.form.files = data.files[0];
  411. } else {
  412. this.form.files = null;
  413. }
  414. }
  415. // await this.getDetailData(data.requirementId);
  416. },
  417. //查看详情
  418. openPlanDetail(row) {
  419. this.$refs.planDetaillogRef.open(row);
  420. }
  421. // //获取需求详情
  422. // async getDetailData(id) {
  423. // this.loading = true;
  424. // let data = await getDetail(id);
  425. // this.loading = false;
  426. // if (data) {
  427. // this.$nextTick(() => {
  428. // this.inventoryList = copyObj(data.detailList);
  429. // });
  430. // }
  431. // }
  432. }
  433. };
  434. </script>
  435. <style scoped lang="scss">
  436. .ele-dialog-form {
  437. .el-form-item {
  438. margin-bottom: 10px;
  439. }
  440. }
  441. .headbox {
  442. display: flex;
  443. justify-content: space-between;
  444. align-items: center;
  445. .amount {
  446. font-size: 14px;
  447. font-weight: bold;
  448. }
  449. }
  450. </style>