detailDialog.vue 18 KB

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