detailDialog.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form" label-width="120px">
  4. <div v-if="form.outputDetailList?.length > 0">
  5. <div class="title" style="margin-bottom: 10px;"> 采购来源清单</div>
  6. <ele-pro-table
  7. ref="preTable"
  8. :needPage="false"
  9. :columns="preColumns"
  10. :toolkit="[]"
  11. :datasource="form.outputDetailList"
  12. row-key="id"
  13. maxHeight="500px"
  14. style="margin-bottom: 20px"
  15. >
  16. <template v-slot:technicalDrawings="{ row }">
  17. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  18. </template>
  19. <template v-slot:files="{ row }">
  20. <fileMain v-model="row.files" type="view"></fileMain>
  21. </template>
  22. </ele-pro-table>
  23. </div>
  24. <div class="title"> 采购计划信息</div>
  25. <el-row>
  26. <el-col :span="8">
  27. <el-form-item label="需求单名称:" prop="requirementName">
  28. <!-- <el-link
  29. type="primary"
  30. :underline="false"
  31. @click="openDetail(form)"
  32. > -->
  33. {{ form.requirementName }}
  34. <!-- </el-link> -->
  35. <!-- {{ form.requirementCode }} -->
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="8">
  39. <el-form-item label="计划单名称:" prop="planName">
  40. {{ form.planName }}
  41. <!-- {{ form.requirementCode }} -->
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8">
  45. <el-form-item label="负责人:" prop="responsibleName">
  46. {{ form.responsibleName }}
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="8">
  50. <el-form-item label="需求类型:" prop="sourceTypeName">
  51. {{ form.sourceTypeName }}
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="8">
  55. <el-form-item label="需求部门:" prop="requireDeptName">
  56. {{ form.requireDeptName }}
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="8">
  60. <el-form-item label="需求人:" prop="requireUserName">
  61. {{ form.requireUserName }}
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="8">
  65. <el-form-item prop="remark" label="是否接受拆单:">
  66. {{ form.acceptUnpack === 1 ? '接受' : '不接受' }}
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="8">
  70. <el-form-item prop="remark" label="是否需要核价:">
  71. {{ form.acceptUnpack === 1 ? '是' : '否' }}
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="8">
  75. <el-form-item label-width="144px" prop="isGenerateOrder" label="是否自动生成订单:">
  76. {{ form.isGenerateOrder == 1 ? '是' : '否' }}
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="8">
  80. <el-form-item label-width="144px" prop="isGenerateContract" label="是否自动生成合同:">
  81. {{ form.isGenerateContract == 1 ? '是' : '否' }}
  82. </el-form-item>
  83. </el-col>
  84. <!-- <el-col :span="12">
  85. <el-form-item
  86. label="用途"
  87. prop="requireUserName"
  88. style="margin-bottom: 22px"
  89. >
  90. {{ form.requireUserName }}
  91. </el-form-item>
  92. </el-col> -->
  93. <el-col :span="8">
  94. <el-form-item label="完结日期:" prop="receiveDate">
  95. {{ form.receiveDate }}
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="8">
  99. <el-form-item prop="remark" label="备注:">
  100. {{ form.remark }}
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="8">
  104. <el-form-item prop="files" label="附件:">
  105. <fileMain v-model="form.files" type="view"></fileMain>
  106. </el-form-item>
  107. </el-col>
  108. </el-row>
  109. <headerTitle title="计划清单" style="margin-top: 15px"></headerTitle>
  110. <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
  111. <el-tab-pane label="物品清单" name="1">
  112. <ele-pro-table
  113. ref="table"
  114. :needPage="false"
  115. :columns="columns"
  116. :toolkit="[]"
  117. :datasource="form.detailList"
  118. row-key="id"
  119. maxHeight="500px"
  120. >
  121. <template v-slot:totalCount="scope">
  122. <el-input-number
  123. :controls="false"
  124. :min="1"
  125. style="width: 100%"
  126. v-model="scope.row.totalCount"
  127. ></el-input-number>
  128. </template>
  129. <template v-slot:expectReceiveDate="scope">
  130. <div v-if="scope.row.arrivalWay == 1">
  131. {{ scope.row.expectReceiveDate }}
  132. </div>
  133. <div v-if="scope.row.arrivalWay == 2">
  134. <el-link
  135. type="primary"
  136. :underline="false"
  137. @click.native="handleMethod(scope.row)"
  138. >
  139. 查看分批时间
  140. </el-link>
  141. </div>
  142. </template>
  143. <template v-slot:technicalDrawings="{ row }">
  144. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  145. </template>
  146. <template v-slot:files="{ row }">
  147. <fileMain v-model="row.files" type="view"></fileMain>
  148. </template>
  149. </ele-pro-table>
  150. </el-tab-pane>
  151. <el-tab-pane
  152. label="带料清单"
  153. name="2"
  154. v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
  155. >
  156. <ele-pro-table
  157. ref="table"
  158. :needPage="false"
  159. :columns="columns"
  160. :toolkit="[]"
  161. :datasource="form.rawDetailList"
  162. row-key="id"
  163. >
  164. <template v-slot:totalCount="scope">
  165. <el-input-number
  166. :controls="false"
  167. :min="1"
  168. style="width: 100%"
  169. v-model="scope.row.totalCount"
  170. ></el-input-number>
  171. </template>
  172. </ele-pro-table>
  173. </el-tab-pane>
  174. <el-tab-pane
  175. label="产出品清单"
  176. name="3"
  177. v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
  178. >
  179. <ele-pro-table
  180. ref="table"
  181. :needPage="false"
  182. :columns="columns"
  183. :toolkit="[]"
  184. :datasource="form.outputDetailList"
  185. row-key="id"
  186. >
  187. <template v-slot:totalCount="scope">
  188. <el-input-number
  189. :controls="false"
  190. :min="1"
  191. style="width: 100%"
  192. v-model="scope.row.totalCount"
  193. ></el-input-number>
  194. </template>
  195. </ele-pro-table>
  196. </el-tab-pane>
  197. </el-tabs>
  198. </el-form>
  199. <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
  200. <div class="title" v-if="['3', '4', '5'].includes(form.sourceType)">
  201. 入库单信息</div
  202. >
  203. <div v-if="taskDefinitionKey == 'storeManagerApprove'">
  204. <add
  205. ref="inoutBoundRef"
  206. v-if="form.detailList"
  207. :form="form"
  208. :sourceBizNo="form.planCode"
  209. :saleProductList="form.detailList"
  210. :bizType="10"
  211. ></add>
  212. </div>
  213. <div v-if="isView && ['3', '4', '5'].includes(form.sourceType)">
  214. <detailDialog
  215. ref="inoutBoundViewRef"
  216. :bizType="10"
  217. :businessId="form.planCode"
  218. >
  219. </detailDialog>
  220. </div>
  221. </div>
  222. </template>
  223. <script>
  224. import { getplanDetail } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
  225. import { getFile } from '@/api/system/file';
  226. import dictMixins from '@/mixins/dictMixins';
  227. import { getInventoryTotalAPI } from '@/api/bpm/components/wms';
  228. import timeDialog from '@/components/timeDialog/index.vue';
  229. import add from '@/views/bpm/stockManagement/storage.vue';
  230. import detailDialog from '@/views/bpm/stockManagement/details.vue';
  231. import { levelList } from '@/enum/dict.js';
  232. export default {
  233. mixins: [dictMixins],
  234. components: {
  235. // fileMain,
  236. timeDialog,
  237. add,
  238. detailDialog
  239. },
  240. props: {
  241. taskDefinitionKey: {
  242. type: String,
  243. default: 'starter'
  244. },
  245. businessId: {
  246. default: ''
  247. },
  248. isView: {
  249. default: ''
  250. }
  251. },
  252. data() {
  253. return {
  254. activeName: '1',
  255. visible: false,
  256. detailId: '',
  257. title: '详情',
  258. row: {},
  259. form: {
  260. files: []
  261. },
  262. columns: [
  263. {
  264. width: 45,
  265. type: 'index',
  266. columnKey: 'index',
  267. align: 'center',
  268. fixed: 'left'
  269. },
  270. {
  271. width: 150,
  272. prop: 'productCategoryName',
  273. label: '分类',
  274. align: 'center'
  275. },
  276. {
  277. width: 140,
  278. prop: 'productCode',
  279. label: '编码',
  280. align: 'center'
  281. },
  282. {
  283. width: 240,
  284. prop: 'productName',
  285. label: '名称',
  286. align: 'center'
  287. },
  288. {
  289. width: 110,
  290. prop: 'batchNo',
  291. label: '批次号',
  292. align: 'center'
  293. },
  294. {
  295. prop: 'provenance',
  296. label: '产地',
  297. slot: 'provenance',
  298. align: 'center',
  299. minWidth: 200,
  300. showOverflowTooltip: true,
  301. formatter: (row, column) => {
  302. return row.provenance && row.provenance.length
  303. ? row.provenance
  304. .map((item) => this.getDictValue('产地', item))
  305. .join(',')
  306. : '';
  307. }
  308. },
  309. {
  310. width: 150,
  311. prop: 'taskName',
  312. label: '工序',
  313. align: 'center'
  314. },
  315. {
  316. width: 150,
  317. prop: 'productBrand',
  318. label: '牌号',
  319. align: 'center'
  320. },
  321. {
  322. width: 150,
  323. prop: 'purchaseCount',
  324. label: '数量',
  325. align: 'center',
  326. formatter: (row, column) => {
  327. if (row.purchaseCount) {
  328. return row.purchaseCount + ' ' + (row.purchaseUnit || '');
  329. }
  330. }
  331. },
  332. // {
  333. // width: 150,
  334. // prop: 'purchaseUnit',
  335. // label: '单位',
  336. // align: 'center'
  337. // },
  338. {
  339. minWidth: 180,
  340. prop: 'packingSpecification',
  341. align: 'center',
  342. label: '包装规格',
  343. showOverflowTooltip: true
  344. },
  345. {
  346. width: 100,
  347. prop: 'totalCount',
  348. label: '计量数量',
  349. align: 'center',
  350. formatter: (row, column) => {
  351. if (row.totalCount) {
  352. return row.totalCount + ' ' + (row.measuringUnit || '');
  353. }
  354. }
  355. // slot: 'totalCount'
  356. },
  357. // {
  358. // width: 100,
  359. // prop: 'measuringUnit',
  360. // label: '计量单位',
  361. // align: 'center',
  362. // slot: 'measuringUnit'
  363. // },
  364. {
  365. minWidth: 120,
  366. prop: 'goodsLevel',
  367. label: '物品级别',
  368. formatter: (_row, _column, cellValue) => {
  369. return levelList.find((item) => item.value == _row.goodsLevel)
  370. ?.label;
  371. },
  372. align: 'center'
  373. },
  374. {
  375. width: 200,
  376. prop: 'warehouseName',
  377. label: '入库仓库',
  378. align: 'center'
  379. },
  380. {
  381. width: 120,
  382. prop: 'totalWeight',
  383. label: '重量',
  384. formatter: (row, column) => {
  385. if (row.totalWeight) {
  386. return row.totalWeight + ' ' + (row.weightUnit || '');
  387. }
  388. },
  389. align: 'center'
  390. },
  391. {
  392. width: 130,
  393. prop: 'modelType',
  394. label: '型号',
  395. align: 'center',
  396. slot: 'modelType'
  397. },
  398. {
  399. width: 120,
  400. prop: 'specification',
  401. label: '规格',
  402. align: 'center',
  403. slot: 'specification'
  404. },
  405. {
  406. minWidth: 120,
  407. prop: 'modelKey',
  408. label: '机型',
  409. showOverflowTooltip: true,
  410. align: 'center'
  411. },
  412. {
  413. minWidth: 120,
  414. prop: 'colorKey',
  415. showOverflowTooltip: true,
  416. label: '颜色',
  417. align: 'center'
  418. },
  419. {
  420. width: 150,
  421. prop: 'arrivalWay',
  422. label: '到货方式',
  423. formatter: (row, column, cellValue) => {
  424. return cellValue == 1 ? '一次性到货' : '分批到货';
  425. },
  426. align: 'center'
  427. },
  428. {
  429. width: 170,
  430. prop: 'receiveDate',
  431. label: '到货日期',
  432. slot: 'expectReceiveDate',
  433. align: 'center'
  434. },
  435. {
  436. width: 130,
  437. prop: 'supplierName',
  438. label: '供应商',
  439. slot: 'supplierName',
  440. headerSlot: 'headerSupplierName',
  441. align: 'center'
  442. },
  443. {
  444. width: 120,
  445. prop: 'packingSpecification',
  446. align: 'center',
  447. label: '包装规格',
  448. showOverflowTooltip: true
  449. },
  450. {
  451. width: 160,
  452. prop: 'technicalDrawings',
  453. label: '图纸附件',
  454. slot: 'technicalDrawings',
  455. align: 'center'
  456. },
  457. {
  458. width: 140,
  459. prop: 'files',
  460. label: '附件',
  461. slot: 'files',
  462. align: 'center'
  463. },
  464. {
  465. minWidth: 220,
  466. prop: 'remark',
  467. label: '备注',
  468. align: 'center',
  469. slot: 'remark'
  470. }
  471. ],
  472. preColumns: [
  473. {
  474. width: 45,
  475. type: 'index',
  476. columnKey: 'index',
  477. align: 'center',
  478. fixed: 'left'
  479. },
  480. {
  481. // width: 240,
  482. prop: 'orderNo',
  483. label: '来源单号',
  484. align: 'center'
  485. },
  486. {
  487. // width: 150,
  488. prop: 'productCategoryName',
  489. label: '分类',
  490. align: 'center'
  491. },
  492. {
  493. // width: 140,
  494. prop: 'productCode',
  495. label: '编码',
  496. align: 'center'
  497. },
  498. {
  499. // width: 240,
  500. prop: 'productName',
  501. label: '名称',
  502. align: 'center'
  503. },
  504. {
  505. // width: 100,
  506. prop: 'totalCount',
  507. label: '数量',
  508. align: 'center',
  509. formatter: (row, column) => {
  510. if (row.totalCount) {
  511. return row.totalCount + ' ' + (row.measuringUnit || '');
  512. }
  513. }
  514. // slot: 'totalCount'
  515. },
  516. ],
  517. };
  518. },
  519. created() {
  520. this.requestDict('产地');
  521. this.getPlanData(this.businessId);
  522. },
  523. methods: {
  524. downloadFile(file) {
  525. getFile({ objectName: file.storePath }, file.name);
  526. },
  527. async getPlanData(id) {
  528. this.loading = true;
  529. const data = await getplanDetail(id);
  530. this.loading = false;
  531. if (data) {
  532. data.purchaseDate = data.createTime;
  533. let codeList = data.detailList?.map((item) => item.productCode) || [];
  534. let inventoryTotalList = await getInventoryTotalAPI(codeList);
  535. data.detailList?.forEach((item) => {
  536. let find =
  537. inventoryTotalList.find((key) => key.code == item.productCode) ||
  538. {};
  539. item.availableCountBase = find.availableCountBase;
  540. });
  541. this.form = data;
  542. // if (data.files && data.files.length > 0) {
  543. // this.form.files = data.files[0];
  544. // } else {
  545. // this.form.files = null;
  546. // }
  547. }
  548. },
  549. handleMethod(row) {
  550. this.$refs.timeDialogRef.open(row);
  551. },
  552. //查看详情
  553. openDetail(row) {
  554. this.$refs.contactDetailDialogRef.open(row);
  555. },
  556. async getTableValue() {
  557. return {
  558. returnStorageData:
  559. this.$refs.inoutBoundRef &&
  560. (await this.$refs.inoutBoundRef.getReturnStorage())
  561. };
  562. }
  563. }
  564. };
  565. </script>
  566. <style scoped lang="scss">
  567. .ele-dialog-form {
  568. .el-form-item {
  569. margin-bottom: 10px;
  570. }
  571. }
  572. .title {
  573. font-size: 22px;
  574. font-weight: 800;
  575. margin-top: 15px;
  576. }
  577. .headbox {
  578. display: flex;
  579. justify-content: space-between;
  580. align-items: center;
  581. .amount {
  582. font-size: 14px;
  583. font-weight: bold;
  584. }
  585. }
  586. </style>