detailDialog.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. <template>
  2. <ele-modal
  3. :modal="isModal"
  4. custom-class="ele-dialog-form long-dialog-form"
  5. :centered="true"
  6. v-if="visible"
  7. :visible.sync="visible"
  8. :append-to-body="true"
  9. :title="title"
  10. :close-on-click-modal="false"
  11. width="80%"
  12. @close="cancel"
  13. :maxable="true"
  14. :resizable="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="handleTag(item.key)"
  24. >
  25. {{ item.name }}
  26. </li>
  27. </ul>
  28. </div>
  29. </div>
  30. <div v-show="activeComp == 'main'">
  31. <el-form ref="form" :model="form" class="el-form-box" label-width="140px">
  32. <headerTitle title="基本信息"> </headerTitle>
  33. <el-row>
  34. <el-col :span="form?.sourceId ? 8 : 12">
  35. <el-form-item label="需求类型:" prop="sourceTypeName">
  36. <el-input v-model="form.sourceTypeName" disabled></el-input>
  37. </el-form-item>
  38. <el-form-item label="计划单名称:" prop="planName">
  39. <el-input v-model="form.planName" disabled></el-input>
  40. <!-- {{ form.requirementCode }} -->
  41. </el-form-item>
  42. <el-form-item label="需求部门:" prop="requireDeptName">
  43. <el-input v-model="form.requireDeptName" disabled></el-input>
  44. </el-form-item>
  45. <el-form-item prop="remark" label="是否接受拆单:">
  46. <el-select
  47. v-model="form.acceptUnpack"
  48. placeholder=" "
  49. disabled
  50. style="width: 100%"
  51. >
  52. <el-option label="接受" :value="1"></el-option>
  53. <el-option label="不接受" :value="0"></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item prop="isGenerateOrder" label="是否自动生成订单:">
  57. <el-select
  58. v-model="form.isGenerateOrder"
  59. placeholder=" "
  60. disabled
  61. style="width: 100%"
  62. >
  63. <el-option label="是" :value="1"></el-option>
  64. <el-option label="否" :value="0"></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item label="完结日期:" prop="receiveDate">
  68. <el-input v-model="form.receiveDate" disabled></el-input>
  69. </el-form-item>
  70. <el-form-item prop="files" label="附件:">
  71. <fileMain v-model="form.files" type="view"></fileMain>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="form?.sourceId ? 8 : 12">
  75. <el-form-item label="需求单名称:" prop="requirementCode">
  76. <el-input v-model="form.requirementName" disabled>
  77. <template slot="append" v-if="form?.requirementName">
  78. <el-button
  79. type="primary"
  80. @click="openDetail(form)"
  81. title="查看详情"
  82. icon="el-icon-view"
  83. ></el-button>
  84. </template>
  85. </el-input>
  86. </el-form-item>
  87. <el-form-item label="负责人:" prop="responsibleName">
  88. <el-input v-model="form.responsibleName" disabled></el-input>
  89. </el-form-item>
  90. <el-form-item label="需求人:" prop="requireUserName">
  91. <el-input v-model="form.requireUserName" disabled></el-input>
  92. </el-form-item>
  93. <el-form-item prop="remark" label="是否需要核价:">
  94. <el-select
  95. v-model="form.needInquiry"
  96. placeholder="请选择"
  97. disabled
  98. style="width: 100%"
  99. >
  100. <el-option label="是" :value="1"></el-option>
  101. <el-option label="否" :value="0"></el-option>
  102. </el-select>
  103. </el-form-item>
  104. <el-form-item prop="isGenerateContract" label="是否自动生成合同:">
  105. <el-select
  106. v-model="form.isGenerateContract"
  107. placeholder=" "
  108. disabled
  109. style="width: 100%"
  110. >
  111. <el-option label="是" :value="1"></el-option>
  112. <el-option label="否" :value="0"></el-option>
  113. </el-select>
  114. </el-form-item>
  115. <el-form-item prop="remark" label="备注:">
  116. <el-input v-model="form.remark" disabled></el-input>
  117. </el-form-item>
  118. </el-col>
  119. <el-col v-if="form?.sourceId" :span="8">
  120. <outsourcing ref="outsourcingRef"></outsourcing>
  121. </el-col>
  122. </el-row>
  123. </el-form>
  124. <headerTitle title="计划清单" style="margin-top: 15px"></headerTitle>
  125. <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
  126. <el-tab-pane label="物品清单" name="1">
  127. <ele-pro-table
  128. ref="table"
  129. :needPage="false"
  130. :columns="columns"
  131. @columns-change="handleColumnChange"
  132. :cache-key="cacheKeyUrl"
  133. :max-height="500"
  134. :datasource="detailData.detailList"
  135. row-key="id"
  136. >
  137. <template v-slot:expectReceiveDate="scope">
  138. <div v-if="scope.row.arrivalWay == 1">
  139. {{ scope.row.expectReceiveDate }}
  140. </div>
  141. <div v-if="scope.row.arrivalWay == 2">
  142. <el-link
  143. type="primary"
  144. :underline="false"
  145. @click.native="handleMethod(scope.row)"
  146. >
  147. 查看分批时间
  148. </el-link>
  149. </div>
  150. </template>
  151. <template v-slot:technicalDrawings="{ row }">
  152. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  153. </template>
  154. <template v-slot:files="{ row }">
  155. <fileMain v-model="row.files" type="view"></fileMain>
  156. </template>
  157. </ele-pro-table>
  158. </el-tab-pane>
  159. <el-tab-pane
  160. label="带料清单"
  161. name="2"
  162. v-if="orderSourceType.includes(form.sourceType)"
  163. >
  164. <ele-pro-table
  165. ref="table"
  166. :needPage="false"
  167. :columns="columns"
  168. :toolkit="[]"
  169. :max-height="500"
  170. :datasource="detailData.rawDetailList"
  171. row-key="id"
  172. >
  173. <template v-slot:expectReceiveDate="scope">
  174. <div v-if="scope.row.arrivalWay == 1">
  175. {{ scope.row.expectReceiveDate }}
  176. </div>
  177. <div v-if="scope.row.arrivalWay == 2">
  178. <el-link
  179. type="primary"
  180. :underline="false"
  181. @click.native="handleMethod(scope.row)"
  182. >
  183. {{ scope.row.expectReceiveDate }}
  184. </el-link>
  185. </div>
  186. </template>
  187. <template v-slot:technicalDrawings="{ row }">
  188. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  189. </template>
  190. <template v-slot:files="{ row }">
  191. <fileMain v-model="row.files" type="view"></fileMain>
  192. </template>
  193. </ele-pro-table>
  194. </el-tab-pane>
  195. <el-tab-pane
  196. label="产出清单"
  197. name="3"
  198. v-if="orderSourceType.includes(form.sourceType)"
  199. >
  200. <ele-pro-table
  201. ref="table"
  202. :needPage="false"
  203. :columns="columns"
  204. :max-height="500"
  205. :datasource="detailData.outputDetailList"
  206. row-key="id"
  207. >
  208. <template v-slot:expectReceiveDate="scope">
  209. <div v-if="scope.row.arrivalWay == 1">
  210. {{ scope.row.expectReceiveDate }}
  211. </div>
  212. <div v-if="scope.row.arrivalWay == 2">
  213. <el-link
  214. type="primary"
  215. :underline="false"
  216. @click.native="handleMethod(scope.row)"
  217. >
  218. {{ scope.row.expectReceiveDate }}
  219. </el-link>
  220. </div>
  221. </template>
  222. <template v-slot:technicalDrawings="{ row }">
  223. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  224. </template>
  225. <template v-slot:files="{ row }">
  226. <fileMain v-model="row.files" type="view"></fileMain>
  227. </template>
  228. </ele-pro-table>
  229. </el-tab-pane>
  230. </el-tabs>
  231. </div>
  232. <bpmDetail
  233. v-if="activeComp === 'bpm' && form.processInstanceId"
  234. :id="form.processInstanceId"
  235. ></bpmDetail>
  236. <div slot="footer" class="footer">
  237. <el-button @click="cancel">返回</el-button>
  238. </div>
  239. <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
  240. <detail-dialog
  241. ref="contactDetailDialogRef"
  242. :isModal="false"
  243. ></detail-dialog>
  244. <inquiryManageIndex
  245. v-if="activeComp === 'inquiryManage'"
  246. :purchasePlanId="form.id"
  247. :sonPurchasePlanIds="sonPurchasePlanList.map((item) => item.id)"
  248. ></inquiryManageIndex>
  249. <!--入库详情-->
  250. <innerBoundDetails
  251. v-if="
  252. activeComp == 'store' &&
  253. form.status == 2 &&
  254. ['3', '4', '5'].includes(form.sourceType)
  255. "
  256. ref="innerBoundDetailsRef"
  257. ></innerBoundDetails>
  258. </ele-modal>
  259. </template>
  260. <script>
  261. import { getplanDetail } from '@/api/purchasingManage/purchasePlanManage';
  262. import { getFile } from '@/api/system/file';
  263. import dictMixins from '@/mixins/dictMixins';
  264. import { copyObj } from '@/utils/util';
  265. import detailDialog from '../../../purchasingManage/purchaseNeedManage/components/detailDialog.vue';
  266. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  267. import timeDialog from '@/components/timeDialog/index.vue';
  268. // import fileMain from '@/components/addDoc/index.vue';
  269. import outsourcing from './outsourcing.vue';
  270. import { orderSourceType } from '@/enum/dict';
  271. import tabMixins from '@/mixins/tableColumnsMixin';
  272. import inquiryManageIndex from '@/views/purchasingManage/inquiryManage/index.vue';
  273. import innerBoundDetails from '@/BIZComponents/innerdetails.vue';
  274. import { levelList } from '@/enum/dict.js';
  275. export default {
  276. mixins: [dictMixins, tabMixins],
  277. components: {
  278. // fileMain,
  279. detailDialog,
  280. bpmDetail,
  281. timeDialog,
  282. outsourcing,
  283. inquiryManageIndex,
  284. innerBoundDetails
  285. },
  286. props: {
  287. isModal: {
  288. default: true
  289. }
  290. },
  291. data() {
  292. return {
  293. cacheKeyUrl:
  294. 'eos-purchasingManage-purchasePlanManage-inventoryTableDetail',
  295. orderSourceType,
  296. activeComp: 'main',
  297. tabOptions: [
  298. { key: 'main', name: '计划详情' },
  299. { key: 'bpm', name: '流程详情' },
  300. { key: 'inquiryManage', name: '核价清单' },
  301. { key: 'store', name: '入库详情' }
  302. ],
  303. activeName: '1',
  304. fullscreen: false,
  305. visible: false,
  306. detailId: '',
  307. title: '详情',
  308. row: {},
  309. form: {},
  310. sonPurchasePlanList: [],
  311. detailData: {},
  312. columns: [
  313. {
  314. width: 45,
  315. type: 'index',
  316. columnKey: 'index',
  317. align: 'center',
  318. fixed: 'left'
  319. },
  320. {
  321. width: 150,
  322. prop: 'productCategoryName',
  323. label: '分类',
  324. slot: 'productCategoryName',
  325. align: 'center'
  326. },
  327. {
  328. width: 140,
  329. prop: 'productCode',
  330. label: '编码',
  331. slot: 'productCode',
  332. align: 'center'
  333. },
  334. {
  335. width: 240,
  336. prop: 'productName',
  337. label: '名称',
  338. slot: 'productName',
  339. align: 'center'
  340. },
  341. {
  342. minWidth: 100,
  343. label: '状态',
  344. fixed: 'left',
  345. formatter: (row, column) => {
  346. return row.isInquiry == 1
  347. ? '部分核价'
  348. : row.isInquiry == 2
  349. ? '全部核价完成'
  350. : row.isInquiry == 3
  351. ? '核价中'
  352. : '未核价';
  353. },
  354. align: 'center'
  355. },
  356. {
  357. width: 110,
  358. prop: 'batchNo',
  359. label: '批次号',
  360. slot: 'batchNo',
  361. align: 'center'
  362. },
  363. {
  364. prop: 'provenance',
  365. label: '产地',
  366. slot: 'provenance',
  367. align: 'center',
  368. minWidth: 200,
  369. showOverflowTooltip: true,
  370. formatter: (row, column) => {
  371. return row.provenance && row.provenance.length
  372. ? row.provenance
  373. .map((item) => this.getDictValue('产地', item))
  374. .join(',')
  375. : '';
  376. }
  377. },
  378. {
  379. width: 150,
  380. prop: 'taskName',
  381. label: '工序',
  382. slot: 'taskName',
  383. align: 'center'
  384. },
  385. {
  386. width: 150,
  387. prop: 'productBrand',
  388. label: '牌号',
  389. slot: 'productBrand',
  390. align: 'center'
  391. },
  392. {
  393. width: 80,
  394. prop: 'totalCount',
  395. label: '数量',
  396. slot: 'totalCount',
  397. align: 'center'
  398. },
  399. {
  400. minWidth: 120,
  401. prop: 'goodsLevel',
  402. label: '物品级别',
  403. formatter: (_row, _column, cellValue) => {
  404. return levelList.find((item) => item.value == _row.goodsLevel)
  405. ?.label;
  406. },
  407. align: 'center'
  408. },
  409. {
  410. width: 200,
  411. prop: 'warehouseName',
  412. label: '入库仓库',
  413. align: 'center'
  414. },
  415. {
  416. width: 150,
  417. prop: 'reqTotalCount',
  418. label: '需求数量',
  419. align: 'center'
  420. },
  421. {
  422. width: 150,
  423. prop: 'inquiryNum',
  424. label: '已核价数量',
  425. align: 'center'
  426. },
  427. {
  428. width: 150,
  429. prop: 'splitTotalCount',
  430. label: '已拆分数量',
  431. align: 'center'
  432. },
  433. {
  434. width: 80,
  435. prop: 'doneTotalCount',
  436. label: '已采数量',
  437. align: 'center'
  438. },
  439. {
  440. width: 80,
  441. prop: 'waitTotalCount',
  442. label: '待采数量',
  443. align: 'center'
  444. },
  445. // {
  446. // width: 120,
  447. // prop: 'singleWeight',
  448. // label: '单重',
  449. // slot: 'singleWeight',
  450. // align: 'center'
  451. // },
  452. {
  453. width: 120,
  454. prop: 'totalWeight',
  455. label: '重量',
  456. slot: 'totalWeight',
  457. align: 'center'
  458. },
  459. {
  460. width: 150,
  461. prop: 'inquiryWeight',
  462. label: '已核价重量',
  463. align: 'center'
  464. },
  465. {
  466. width: 100,
  467. prop: 'measuringUnit',
  468. label: '单位',
  469. slot: 'measuringUnit',
  470. align: 'center'
  471. },
  472. {
  473. width: 130,
  474. prop: 'modelType',
  475. label: '型号',
  476. slot: 'modelType',
  477. align: 'center'
  478. },
  479. {
  480. width: 120,
  481. prop: 'specification',
  482. label: '规格',
  483. slot: 'specification',
  484. align: 'center'
  485. },
  486. // {
  487. // width: 130,
  488. // prop: 'modelType',
  489. // label: '品牌',
  490. // slot: 'modelType'
  491. // },
  492. {
  493. width: 150,
  494. prop: 'arrivalWay',
  495. label: '到货方式',
  496. formatter: (row, column, cellValue) => {
  497. return cellValue == 1 ? '一次性到货' : '分批到货';
  498. },
  499. align: 'center'
  500. },
  501. {
  502. width: 170,
  503. prop: 'receiveDate',
  504. label: '到货日期',
  505. slot: 'expectReceiveDate',
  506. align: 'center'
  507. },
  508. {
  509. width: 130,
  510. prop: 'supplierName',
  511. label: '供应商',
  512. slot: 'supplierName',
  513. headerSlot: 'headerSupplierName',
  514. align: 'center'
  515. },
  516. {
  517. width: 120,
  518. prop: 'packingSpecification',
  519. align: 'center',
  520. label: '包装规格',
  521. showOverflowTooltip: true
  522. },
  523. {
  524. width: 160,
  525. prop: 'technicalDrawings',
  526. label: '图纸附件',
  527. slot: 'technicalDrawings',
  528. align: 'center'
  529. },
  530. {
  531. width: 140,
  532. prop: 'files',
  533. label: '附件',
  534. slot: 'files',
  535. align: 'center'
  536. },
  537. {
  538. width: 220,
  539. prop: 'remark',
  540. label: '备注',
  541. slot: 'remark',
  542. align: 'center'
  543. }
  544. ]
  545. };
  546. },
  547. created() {
  548. this.requestDict('产地');
  549. },
  550. methods: {
  551. // //导出
  552. // async exportTable() {
  553. // this.loading = true;
  554. // const response = await getExport(this.detailId);
  555. // },
  556. handleTag(val) {
  557. this.activeComp = val;
  558. if (val == 'store') {
  559. this.$nextTick(() => {
  560. this.$refs.innerBoundDetailsRef._getInfo(this.form.planCode);
  561. });
  562. }
  563. },
  564. async open(row) {
  565. this.activeName = '1';
  566. this.activeComp = 'main';
  567. this.sonPurchasePlanList = row.sonPurchasePlanList || [];
  568. this.visible = true;
  569. this.getPlanData(row.planId || row.id);
  570. this.detailId = row.id;
  571. },
  572. cancel() {
  573. this.$nextTick(() => {
  574. // 关闭后,销毁所有的表单数据
  575. (this.form = copyObj(this.formDef)),
  576. (this.otherForm = copyObj(this.otherFormDef)),
  577. (this.tableBankData = []);
  578. this.tableLinkData = [];
  579. this.visible = false;
  580. });
  581. },
  582. handleMethod(row) {
  583. this.$refs.timeDialogRef.open(row);
  584. },
  585. downloadFile(file) {
  586. getFile({ objectName: file.storePath }, file.name);
  587. },
  588. async getPlanData(id) {
  589. this.loading = true;
  590. const data = await getplanDetail(id);
  591. this.loading = false;
  592. if (data) {
  593. this.detailData = data;
  594. this.form = data;
  595. this.$nextTick(() => {
  596. this.$refs.outsourcingRef &&
  597. this.$refs.outsourcingRef.init(data.sourceId);
  598. });
  599. if (data.files && data.files.length > 0) {
  600. this.form.files = data.files[0];
  601. } else {
  602. this.form.files = null;
  603. }
  604. }
  605. },
  606. //查看详情
  607. openDetail(row) {
  608. console.log(row);
  609. this.$refs.contactDetailDialogRef.open(row);
  610. }
  611. }
  612. };
  613. </script>
  614. <style scoped lang="scss">
  615. .ele-dialog-form {
  616. .el-form-item {
  617. margin-bottom: 10px;
  618. }
  619. }
  620. .headbox {
  621. display: flex;
  622. justify-content: space-between;
  623. align-items: center;
  624. .amount {
  625. font-size: 14px;
  626. font-weight: bold;
  627. }
  628. }
  629. </style>